diff options
author | Yann Collet <yann.collet.73@gmail.com> | 2014-12-16 21:03:16 (GMT) |
---|---|---|
committer | Yann Collet <yann.collet.73@gmail.com> | 2014-12-16 21:03:16 (GMT) |
commit | 8a9fb8cf3229c9a704c982667c63ac440b8487ba (patch) | |
tree | a01e24ab3eb37dde02bb95e73166739faf59659a /lib/lz4.c | |
parent | 95cc6cef6444b202a93ba414b7a9996eb2c72ca3 (diff) | |
download | lz4-8a9fb8cf3229c9a704c982667c63ac440b8487ba.zip lz4-8a9fb8cf3229c9a704c982667c63ac440b8487ba.tar.gz lz4-8a9fb8cf3229c9a704c982667c63ac440b8487ba.tar.bz2 |
Fixed : older compiler don't like nameless unions, reported by Cheyi Lin
Diffstat (limited to 'lib/lz4.c')
-rw-r--r-- | lib/lz4.c | 16 |
1 files changed, 10 insertions, 6 deletions
@@ -112,12 +112,16 @@ # pragma warning(disable : 4127) /* disable: C4127: conditional expression is constant */ # pragma warning(disable : 4293) /* disable: C4293: too large shift (32-bits) */ #else -# ifdef __GNUC__ -# define FORCE_INLINE static inline __attribute__((always_inline)) +# if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */ +# ifdef __GNUC__ +# define FORCE_INLINE static inline __attribute__((always_inline)) +# else +# define FORCE_INLINE static inline +# endif # else -# define FORCE_INLINE static inline -# endif -#endif +# define FORCE_INLINE static +# endif /* __STDC_VERSION__ */ +#endif /* _MSC_VER */ #define GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__) @@ -264,7 +268,7 @@ static void LZ4_copy4(void* dstPtr, const void* srcPtr) static void LZ4_copy8(void* dstPtr, const void* srcPtr) { -#if GCC_VERSION!=409 // disabled on GCC 4.9, as it generates invalid opcode that crashes +#if GCC_VERSION!=409 /* disabled on GCC 4.9, as it generates invalid opcode (crash) */ if (LZ4_UNALIGNED_ACCESS) { if (LZ4_64bits()) |