From 9c3828fefe395629cb5ef8e2cbe75b20ca2fa8aa Mon Sep 17 00:00:00 2001 From: dbj Date: Fri, 20 Dec 2019 13:57:00 +0100 Subject: [PATCH] STRINGIFY implemented (#402) * STRINGIFY implemented * SIMDJSON_THREADS_ENABLED def/undef --- include/simdjson/portability.h | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/include/simdjson/portability.h b/include/simdjson/portability.h index 12f1eafb5..f862f7130 100644 --- a/include/simdjson/portability.h +++ b/include/simdjson/portability.h @@ -1,10 +1,10 @@ #ifndef SIMDJSON_PORTABILITY_H #define SIMDJSON_PORTABILITY_H -#include #include -#include +#include #include +#include #ifdef _MSC_VER #include #endif @@ -17,7 +17,10 @@ #endif // this is almost standard? -#define STRINGIFY(a) #a +#undef STRINGIFY_IMPLEMENTATION_ +#undef STRINGIFY +#define STRINGIFY_IMPLEMENTATION_(a) #a +#define STRINGIFY(a) STRINGIFY_IMPLEMENTATION_(a) // we are going to use runtime dispatch #ifdef IS_X86_64 @@ -37,7 +40,7 @@ #define UNTARGET_REGION _Pragma("GCC pop_options") #endif // clang then gcc -#endif // x86 +#endif // x86 // Default target region macros don't do anything. #ifndef TARGET_REGION @@ -50,9 +53,11 @@ #define TARGET_WESTMERE TARGET_REGION("sse4.2,pclmul") #define TARGET_ARM64 +// Threading is disabled +#undef SIMDJSON_THREADS_ENABLED // Is threading enabled? #if defined(BOOST_HAS_THREADS) || defined(_REENTRANT) || defined(_MT) -#define SIMDJSON_THREADS_ENABLED 1 +#define SIMDJSON_THREADS_ENABLED #endif #if defined(__clang__) @@ -67,7 +72,6 @@ #include // visual studio #endif - #ifdef _MSC_VER #define simdjson_strcasecmp _stricmp #else