Make LZ4 version check runtime instead of build time in get_frame_info
@@ -849,7 +849,8 @@ get_frame_info (PyObject * Py_UNUSED (self), PyObject * args,
return NULL;
}
-#if LZ4_VERSION_NUMBER >= 10800 /* LZ4 v1.8.0 */
+ if (LZ4_versionNumber() >= 10800)
+ {
if (frame_info.blockChecksumFlag == LZ4F_noBlockChecksum)
{
block_checksum = 0;
@@ -865,12 +866,14 @@ get_frame_info (PyObject * Py_UNUSED (self), PyObject * args,
frame_info.blockChecksumFlag);
return NULL;
}
-#else
+ }
+ else
+ {
/* Prior to LZ4 1.8.0 the blockChecksum functionality wasn't exposed in the
frame API, and blocks weren't checksummed, so we'll always return 0
here. */
block_checksum = 0;
-#endif
+ }
if (frame_info.frameType == LZ4F_frame)
{
