summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYann Collet <cyan@fb.com>2016-11-12 21:30:02 (GMT)
committerYann Collet <cyan@fb.com>2016-11-12 21:30:02 (GMT)
commitbb97e8a6fdac3f3c3239411f7c6788dbbf1c5b33 (patch)
tree4d4614d4fe2912c7cdb6bbc03c11b8b103c634ce
parentcb2230826bb2270fd27fdf9a6afb2d2df19078ce (diff)
downloadlz4-bb97e8a6fdac3f3c3239411f7c6788dbbf1c5b33.zip
lz4-bb97e8a6fdac3f3c3239411f7c6788dbbf1c5b33.tar.gz
lz4-bb97e8a6fdac3f3c3239411f7c6788dbbf1c5b33.tar.bz2
fixed __GNUC__ macro
-rw-r--r--lib/lz4.c10
-rw-r--r--lib/lz4.h4
-rw-r--r--lib/lz4hc.h4
3 files changed, 9 insertions, 9 deletions
diff --git a/lib/lz4.c b/lib/lz4.c
index e59b49c..276c15a 100644
--- a/lib/lz4.c
+++ b/lib/lz4.c
@@ -111,7 +111,7 @@
# endif
#endif /* _MSC_VER */
-#if (defined(__GNU_C__) && (__GNU_C__ >= 3)) || (defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 800)) || defined(__clang__)
+#if (defined(__GNUC__) && (__GNUC__ >= 3)) || (defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 800)) || defined(__clang__)
# define expect(expr,value) (__builtin_expect ((expr),(value)) )
#else
# define expect(expr,value) (expr)
@@ -300,7 +300,7 @@ static unsigned LZ4_NbCommonBytes (register size_t val)
unsigned long r = 0;
_BitScanForward64( &r, (U64)val );
return (int)(r>>3);
-# elif (defined(__clang__) || (LZ4_GCC_VERSION >= 304)) && !defined(LZ4_FORCE_SW_BITCOUNT)
+# elif (defined(__clang__) || (defined(__GNUC__) && (__GNUC__>=3))) && !defined(LZ4_FORCE_SW_BITCOUNT)
return (__builtin_ctzll((U64)val) >> 3);
# else
static const int DeBruijnBytePos[64] = { 0, 0, 0, 0, 0, 1, 1, 2, 0, 3, 1, 3, 1, 4, 2, 7, 0, 2, 3, 6, 1, 5, 3, 5, 1, 3, 4, 4, 2, 5, 6, 7, 7, 0, 1, 2, 3, 3, 4, 6, 2, 6, 5, 5, 3, 4, 5, 6, 7, 1, 2, 4, 6, 4, 4, 5, 7, 2, 6, 5, 7, 6, 7, 7 };
@@ -311,7 +311,7 @@ static unsigned LZ4_NbCommonBytes (register size_t val)
unsigned long r;
_BitScanForward( &r, (U32)val );
return (int)(r>>3);
-# elif (defined(__clang__) || (LZ4_GCC_VERSION >= 304)) && !defined(LZ4_FORCE_SW_BITCOUNT)
+# elif (defined(__clang__) || (defined(__GNUC__) && (__GNUC__>=3))) && !defined(LZ4_FORCE_SW_BITCOUNT)
return (__builtin_ctz((U32)val) >> 3);
# else
static const int DeBruijnBytePos[32] = { 0, 0, 3, 0, 3, 1, 3, 0, 3, 2, 2, 1, 3, 2, 0, 1, 3, 3, 1, 2, 2, 2, 2, 0, 3, 1, 2, 0, 1, 0, 1, 1 };
@@ -324,7 +324,7 @@ static unsigned LZ4_NbCommonBytes (register size_t val)
unsigned long r = 0;
_BitScanReverse64( &r, val );
return (unsigned)(r>>3);
-# elif (defined(__clang__) || (LZ4_GCC_VERSION >= 304)) && !defined(LZ4_FORCE_SW_BITCOUNT)
+# elif (defined(__clang__) || (defined(__GNUC__) && (__GNUC__>=3))) && !defined(LZ4_FORCE_SW_BITCOUNT)
return (__builtin_clzll((U64)val) >> 3);
# else
unsigned r;
@@ -338,7 +338,7 @@ static unsigned LZ4_NbCommonBytes (register size_t val)
unsigned long r = 0;
_BitScanReverse( &r, (unsigned long)val );
return (unsigned)(r>>3);
-# elif (defined(__clang__) || (LZ4_GCC_VERSION >= 304)) && !defined(LZ4_FORCE_SW_BITCOUNT)
+# elif (defined(__clang__) || (defined(__GNUC__) && (__GNUC__>=3))) && !defined(LZ4_FORCE_SW_BITCOUNT)
return (__builtin_clz((U32)val) >> 3);
# else
unsigned r;
diff --git a/lib/lz4.h b/lib/lz4.h
index cc304f2..17abd52 100644
--- a/lib/lz4.h
+++ b/lib/lz4.h
@@ -416,9 +416,9 @@ struct LZ4_streamDecode_s {
#ifdef LZ4_DISABLE_DEPRECATE_WARNINGS
# define LZ4_DEPRECATED(message) /* disable deprecation warnings */
#else
-# if (defined(__GNU_C__) && (__GNU_C__ >= 4)) || defined(__clang__)
+# if (defined(__GNUC__) && (__GNUC__ >= 4)) || defined(__clang__)
# define LZ4_DEPRECATED(message) __attribute__((deprecated(message)))
-# elif defined(__GNU_C__) && (__GNU_C__ >= 3)
+# elif defined(__GNUC__) && (__GNUC__ >= 3)
# define LZ4_DEPRECATED(message) __attribute__((deprecated))
# elif defined(_MSC_VER)
# define LZ4_DEPRECATED(message) __declspec(deprecated(message))
diff --git a/lib/lz4hc.h b/lib/lz4hc.h
index 358e549..aad2d3a 100644
--- a/lib/lz4hc.h
+++ b/lib/lz4hc.h
@@ -217,9 +217,9 @@ struct LZ4_streamHC_s {
#ifdef LZ4HC_DISABLE_DEPRECATE_WARNINGS
# define LZ4_DEPRECATED(message) /* disable deprecation warnings */
#else
-# if (defined(__GNU_C__) && (__GNU_C__ >= 4)) || defined(__clang__)
+# if (defined(__GNUC__) && (__GNUC__ >= 4)) || defined(__clang__)
# define LZ4_DEPRECATED(message) __attribute__((deprecated(message)))
-# elif (defined(__GNU_C__) && (__GNU_C__ >= 3))
+# elif (defined(__GNUC__) && (__GNUC__ >= 3))
# define LZ4_DEPRECATED(message) __attribute__((deprecated))
# elif defined(_MSC_VER)
# define LZ4_DEPRECATED(message) __declspec(deprecated(message))