static bool preset_extreme = false;
/// Integrity check type
-#ifdef HAVE_CHECK_CRC64
-static lzma_check check = LZMA_CHECK_CRC64;
-#else
-static lzma_check check = LZMA_CHECK_CRC32;
-#endif
+static lzma_check check;
+
+/// This becomes false if the --check=CHECK option is used.
+static bool check_default = true;
extern void
coder_set_check(lzma_check new_check)
{
check = new_check;
+ check_default = false;
return;
}
opt_threads = thread_limit;
*/
+ if (check_default) {
+ // The default check type is CRC64, but fallback to CRC32
+ // if CRC64 isn't supported by the copy of liblzma we are
+ // using. CRC32 is always supported.
+ check = LZMA_CHECK_CRC64;
+ if (!lzma_check_is_supported(check))
+ check = LZMA_CHECK_CRC32;
+ }
+
return;
}