diff --git a/include/simdjson.h b/include/simdjson.h index 2dc55de0..b795298f 100644 --- a/include/simdjson.h +++ b/include/simdjson.h @@ -11,9 +11,7 @@ #include "simdjson/common_defs.h" SIMDJSON_PUSH_DISABLE_WARNINGS -#if defined(_MSC_VER) && defined(__clang__) -SIMDJSON_DISABLE_GCC_WARNING(-Wmicrosoft-include) -#endif +SIMDJSON_DISABLE_UNDESIRED_WARNINGS // Public API #include "simdjson/simdjson_version.h" diff --git a/include/simdjson/common_defs.h b/include/simdjson/common_defs.h index debf7c8b..47a25089 100644 --- a/include/simdjson/common_defs.h +++ b/include/simdjson/common_defs.h @@ -77,9 +77,12 @@ constexpr size_t DEFAULT_MAX_DEPTH = 1024; #define unlikely(x) x #endif + #include #define SIMDJSON_PUSH_DISABLE_WARNINGS __pragma(warning( push )) #define SIMDJSON_PUSH_DISABLE_ALL_WARNINGS __pragma(warning( push, 0 )) #define SIMDJSON_DISABLE_VS_WARNING(WARNING_NUMBER) __pragma(warning( disable : WARNING_NUMBER )) + // Get rid of Intellisense-only warnings (Code Analysis) + #define SIMDJSON_DISABLE_UNDESIRED_WARNINGS SIMDJSON_DISABLE_VS_WARNING(ALL_CPPCORECHECK_WARNINGS) #define SIMDJSON_DISABLE_DEPRECATED_WARNING SIMDJSON_DISABLE_VS_WARNING(4996) #define SIMDJSON_POP_DISABLE_WARNINGS __pragma(warning( pop )) @@ -113,6 +116,11 @@ constexpr size_t DEFAULT_MAX_DEPTH = 1024; SIMDJSON_DISABLE_GCC_WARNING(-Wunused-variable) #define SIMDJSON_PRAGMA(P) _Pragma(#P) #define SIMDJSON_DISABLE_GCC_WARNING(WARNING) SIMDJSON_PRAGMA(GCC diagnostic ignored #WARNING) + #if defined(SIMDJSON_CLANG_VISUAL_STUDIO) + #define SIMDJSON_DISABLE_UNDESIRED_WARNINGS SIMDJSON_DISABLE_GCC_WARNING(-Wmicrosoft-include) + #else + #define SIMDJSON_DISABLE_UNDESIRED_WARNINGS + #endif #define SIMDJSON_DISABLE_DEPRECATED_WARNING SIMDJSON_DISABLE_GCC_WARNING(-Wdeprecated-declarations) #define SIMDJSON_POP_DISABLE_WARNINGS _Pragma("GCC diagnostic pop") diff --git a/singleheader/simdjson.cpp b/singleheader/simdjson.cpp index c9e0d71e..09b7f713 100644 --- a/singleheader/simdjson.cpp +++ b/singleheader/simdjson.cpp @@ -1,11 +1,9 @@ -/* auto-generated on Sat May 2 15:01:27 PDT 2020. Do not edit! */ +/* auto-generated on Mon May 4 11:46:14 PDT 2020. Do not edit! */ /* begin file src/simdjson.cpp */ #include "simdjson.h" SIMDJSON_PUSH_DISABLE_WARNINGS -#if defined(SIMDJSON_CLANG_VISUAL_STUDIO) -SIMDJSON_DISABLE_GCC_WARNING(-Wmicrosoft-include) -#endif +SIMDJSON_DISABLE_UNDESIRED_WARNINGS /* begin file src/error.cpp */ diff --git a/singleheader/simdjson.h b/singleheader/simdjson.h index d251ae61..7fee763f 100644 --- a/singleheader/simdjson.h +++ b/singleheader/simdjson.h @@ -1,4 +1,4 @@ -/* auto-generated on Sat May 2 15:01:27 PDT 2020. Do not edit! */ +/* auto-generated on Mon May 4 11:46:14 PDT 2020. Do not edit! */ /* begin file include/simdjson.h */ #ifndef SIMDJSON_H #define SIMDJSON_H @@ -328,9 +328,12 @@ constexpr size_t DEFAULT_MAX_DEPTH = 1024; #define unlikely(x) x #endif + #include #define SIMDJSON_PUSH_DISABLE_WARNINGS __pragma(warning( push )) #define SIMDJSON_PUSH_DISABLE_ALL_WARNINGS __pragma(warning( push, 0 )) #define SIMDJSON_DISABLE_VS_WARNING(WARNING_NUMBER) __pragma(warning( disable : WARNING_NUMBER )) + // Get rid of Intellisense-only warnings (Code Analysis) + #define SIMDJSON_DISABLE_UNDESIRED_WARNINGS SIMDJSON_DISABLE_VS_WARNING(ALL_CPPCORECHECK_WARNINGS) #define SIMDJSON_DISABLE_DEPRECATED_WARNING SIMDJSON_DISABLE_VS_WARNING(4996) #define SIMDJSON_POP_DISABLE_WARNINGS __pragma(warning( pop )) @@ -364,6 +367,11 @@ constexpr size_t DEFAULT_MAX_DEPTH = 1024; SIMDJSON_DISABLE_GCC_WARNING(-Wunused-variable) #define SIMDJSON_PRAGMA(P) _Pragma(#P) #define SIMDJSON_DISABLE_GCC_WARNING(WARNING) SIMDJSON_PRAGMA(GCC diagnostic ignored #WARNING) + #if defined(SIMDJSON_CLANG_VISUAL_STUDIO) + #define SIMDJSON_DISABLE_UNDESIRED_WARNINGS SIMDJSON_DISABLE_GCC_WARNING(-Wmicrosoft-include) + #else + #define SIMDJSON_DISABLE_UNDESIRED_WARNINGS + #endif #define SIMDJSON_DISABLE_DEPRECATED_WARNING SIMDJSON_DISABLE_GCC_WARNING(-Wdeprecated-declarations) #define SIMDJSON_POP_DISABLE_WARNINGS _Pragma("GCC diagnostic pop") @@ -1971,9 +1979,7 @@ namespace std { /* end file include/simdjson/nonstd/string_view.hpp */ SIMDJSON_PUSH_DISABLE_WARNINGS -#if defined(_MSC_VER) && defined(__clang__) -SIMDJSON_DISABLE_GCC_WARNING(-Wmicrosoft-include) -#endif +SIMDJSON_DISABLE_UNDESIRED_WARNINGS // Public API /* begin file include/simdjson/simdjson_version.h */ diff --git a/src/simdjson.cpp b/src/simdjson.cpp index 517a1984..d98a8acb 100644 --- a/src/simdjson.cpp +++ b/src/simdjson.cpp @@ -1,9 +1,7 @@ #include "simdjson.h" SIMDJSON_PUSH_DISABLE_WARNINGS -#if defined(SIMDJSON_CLANG_VISUAL_STUDIO) -SIMDJSON_DISABLE_GCC_WARNING(-Wmicrosoft-include) -#endif +SIMDJSON_DISABLE_UNDESIRED_WARNINGS #include "error.cpp" #include "implementation.cpp"