mirror of
https://github.com/lz4/lz4.git
synced 2024-11-27 03:48:08 +08:00
Added preprocessor checks for Clang on Windows
- MSVC-specific code is used in some places and compiled only if _MSC_VER is set; however, Clang under Windows also defines this, which reports errors on this non-standard code if the -pedantic-errors compiler flag is set
This commit is contained in:
parent
92dada5d84
commit
be8a4f6522
@ -145,6 +145,7 @@ endif()
|
||||
include (CheckCCompilerFlag)
|
||||
foreach (flag
|
||||
# GCC-style
|
||||
-pedantic-errors
|
||||
-Wall
|
||||
-Wextra
|
||||
-Wundef
|
||||
|
@ -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
|
||||
|
@ -120,12 +120,12 @@ static void* XXH_memcpy(void* dest, const void* src, size_t size) { return memcp
|
||||
/* *************************************
|
||||
* 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
|
||||
|
Loading…
Reference in New Issue
Block a user