]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Increase x-compatibility
authorRichard Barnes <rbarnes@umn.edu>
Fri, 26 Apr 2024 21:44:41 +0000 (14:44 -0700)
committerNick Terrell <nickrterrell@gmail.com>
Mon, 29 Apr 2024 13:19:24 +0000 (09:19 -0400)
lib/zstd.h

index e4c9ffc87c4e47d01ecc00b0d45c259745af75f1..aa4ea23af4890059582e58e0c5331ef616f5a57f 100644 (file)
@@ -1802,11 +1802,15 @@ static
 #ifdef __GNUC__
 __attribute__((__unused__))
 #endif
-// Disable diagnostic for C++ compatibility
+       
+#if defined(__clang__) && __clang_major__ >= 5
 #pragma clang diagnostic push
 #pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant"
+#endif
 ZSTD_customMem const ZSTD_defaultCMem = { NULL, NULL, NULL };  /**< this constant defers to stdlib's functions */
+#if defined(__clang__) && __clang_major__ >= 5
 #pragma clang diagnostic pop
+#endif
 
 ZSTDLIB_STATIC_API ZSTD_CCtx*    ZSTD_createCCtx_advanced(ZSTD_customMem customMem);
 ZSTDLIB_STATIC_API ZSTD_CStream* ZSTD_createCStream_advanced(ZSTD_customMem customMem);