STRINGIFY implemented (#402)

* STRINGIFY implemented

* SIMDJSON_THREADS_ENABLED def/undef
This commit is contained in:
dbj 2019-12-20 13:57:00 +01:00 committed by Daniel Lemire
parent 60916318f7
commit 9c3828fefe
1 changed files with 10 additions and 6 deletions

View File

@ -1,10 +1,10 @@
#ifndef SIMDJSON_PORTABILITY_H #ifndef SIMDJSON_PORTABILITY_H
#define SIMDJSON_PORTABILITY_H #define SIMDJSON_PORTABILITY_H
#include <cstdint>
#include <cstddef> #include <cstddef>
#include <cstdlib> #include <cstdint>
#include <cstdio> #include <cstdio>
#include <cstdlib>
#ifdef _MSC_VER #ifdef _MSC_VER
#include <iso646.h> #include <iso646.h>
#endif #endif
@ -17,7 +17,10 @@
#endif #endif
// this is almost standard? // 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 // we are going to use runtime dispatch
#ifdef IS_X86_64 #ifdef IS_X86_64
@ -37,7 +40,7 @@
#define UNTARGET_REGION _Pragma("GCC pop_options") #define UNTARGET_REGION _Pragma("GCC pop_options")
#endif // clang then gcc #endif // clang then gcc
#endif // x86 #endif // x86
// Default target region macros don't do anything. // Default target region macros don't do anything.
#ifndef TARGET_REGION #ifndef TARGET_REGION
@ -50,9 +53,11 @@
#define TARGET_WESTMERE TARGET_REGION("sse4.2,pclmul") #define TARGET_WESTMERE TARGET_REGION("sse4.2,pclmul")
#define TARGET_ARM64 #define TARGET_ARM64
// Threading is disabled
#undef SIMDJSON_THREADS_ENABLED
// Is threading enabled? // Is threading enabled?
#if defined(BOOST_HAS_THREADS) || defined(_REENTRANT) || defined(_MT) #if defined(BOOST_HAS_THREADS) || defined(_REENTRANT) || defined(_MT)
#define SIMDJSON_THREADS_ENABLED 1 #define SIMDJSON_THREADS_ENABLED
#endif #endif
#if defined(__clang__) #if defined(__clang__)
@ -67,7 +72,6 @@
#include <intrin.h> // visual studio #include <intrin.h> // visual studio
#endif #endif
#ifdef _MSC_VER #ifdef _MSC_VER
#define simdjson_strcasecmp _stricmp #define simdjson_strcasecmp _stricmp
#else #else