Merge pull request #1370 from Razakhel/fix-clang-pedantic-windows
Added preprocessor checks for Clang on Windows
GitOrigin-RevId: 610c94f80802f67b59c00cac1f229e3d13b8de35
Change-Id: I6245b213682205b9de65c22be2e088efb2e40545
diff --git a/lib/lz4.c b/lib/lz4.c
index 7d9bd45..b7dd32a 100644
--- a/lib/lz4.c
+++ b/lib/lz4.c
@@ -127,11 +127,11 @@
#endif /* _MSC_VER */
#ifndef LZ4_FORCE_INLINE
-# ifdef _MSC_VER /* Visual Studio */
+# if defined (_MSC_VER) && !defined (__clang__) /* MSVC */
# define LZ4_FORCE_INLINE static __forceinline
# else
# if defined (__cplusplus) || defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 */
-# ifdef __GNUC__
+# if defined (__GNUC__) || defined (__clang__)
# define LZ4_FORCE_INLINE static inline __attribute__((always_inline))
# else
# define LZ4_FORCE_INLINE static inline
diff --git a/lib/xxhash.c b/lib/xxhash.c
index ff28749..08d8b36 100644
--- a/lib/xxhash.c
+++ b/lib/xxhash.c
@@ -120,12 +120,12 @@
/* *************************************
* Compiler Specific Options
***************************************/
-#ifdef _MSC_VER /* Visual Studio */
+#if defined (_MSC_VER) && !defined (__clang__) /* MSVC */
# pragma warning(disable : 4127) /* disable: C4127: conditional expression is constant */
# define FORCE_INLINE static __forceinline
#else
# if defined (__cplusplus) || defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 */
-# ifdef __GNUC__
+# if defined (__GNUC__) || defined (__clang__)
# define FORCE_INLINE static inline __attribute__((always_inline))
# else
# define FORCE_INLINE static inline