Skip to content

Commit eae87ae

Browse files
committed
refactor: LZ4 version info display to use LZ4_versionString() consistently
1 parent 9474edc commit eae87ae

1 file changed

Lines changed: 1 addition & 21 deletions

File tree

lz4.c

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -115,27 +115,7 @@ ZEND_MINFO_FUNCTION(lz4)
115115
php_info_print_table_start();
116116
php_info_print_table_row(2, "LZ4 support", "enabled");
117117
php_info_print_table_row(2, "Extension Version", LZ4_EXT_VERSION);
118-
#if !defined(HAVE_LIBLZ4)
119-
/* Bundled library */
120-
php_info_print_table_row(2, "LZ4 Version", LZ4_versionString());
121-
#elif defined(LZ4_VERSION_MAJOR)
122-
/* Recent system library */
123-
{
124-
char buffer[128];
125-
126-
snprintf(buffer, sizeof(buffer), "%d.%d.%d",
127-
LZ4_VERSION_MAJOR, LZ4_VERSION_MINOR, LZ4_VERSION_RELEASE);
128-
php_info_print_table_row(2, "LZ4 headers Version", buffer);
129-
130-
/* LZ4_versionString is not usable, see https://github.com/lz4/lz4/issues/301 */
131-
snprintf(buffer, sizeof(buffer), "%d.%d.%d",
132-
LZ4_versionNumber()/10000, (LZ4_versionNumber()/100)%100, LZ4_versionNumber()%100);
133-
php_info_print_table_row(2, "LZ4 library Version", buffer);
134-
}
135-
#else
136-
/* Old system library */
137-
php_info_print_table_row(2, "LZ4 Version", "system library");
138-
#endif
118+
php_info_print_table_row(2, "LZ4 Version", (char *)LZ4_versionString());
139119
#if PHP_MAJOR_VERSION >= 7 && defined(HAVE_APCU_SUPPORT)
140120
php_info_print_table_row(2, "LZ4 APCu serializer ABI", APC_SERIALIZER_ABI);
141121
#endif

0 commit comments

Comments
 (0)