diff options
author | Jim Huang <jserv@biilabs.io> | 2021-06-24 17:29:06 +0800 |
---|---|---|
committer | Jim Huang <jserv@biilabs.io> | 2021-06-24 17:29:06 +0800 |
commit | 4369fe43239c56ad017911ef1b704b666a3e35e8 (patch) | |
tree | c1356200952fcd111cf3443ef44d789fb8a0fe82 /include/mimalloc.h | |
parent | 076f815cece59e0a0ee08237c8fbba75465452b6 (diff) |
Eliminate preprocessor warnings due to undefined "__GNUC__" with ClangCL
When building some code against mimalloc with C inside Visual Studio
with ClangCL, the compiler complains about __GNUC__ being undefined.
Reported by Mojca Miklavec.
Close #422
Diffstat (limited to 'include/mimalloc.h')
-rw-r--r-- | include/mimalloc.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/mimalloc.h b/include/mimalloc.h index fe5aa8f..7ebf3e6 100644 --- a/include/mimalloc.h +++ b/include/mimalloc.h @@ -26,7 +26,7 @@ terms of the MIT license. A copy of the license can be found in the file #if defined(__cplusplus) && (__cplusplus >= 201703) #define mi_decl_nodiscard [[nodiscard]] -#elif (__GNUC__ >= 4) || defined(__clang__) // includes clang, icc, and clang-cl +#elif (defined(__GNUC__) && (__GNUC__ >= 4)) || defined(__clang__) // includes clang, icc, and clang-cl #define mi_decl_nodiscard __attribute__((warn_unused_result)) #elif (_MSC_VER >= 1700) #define mi_decl_nodiscard _Check_return_ |