Skip to content

Commit 9c3828f

Browse files
DBJDBJlemire
authored andcommitted
STRINGIFY implemented (simdjson#402)
* STRINGIFY implemented * SIMDJSON_THREADS_ENABLED def/undef
1 parent 6091631 commit 9c3828f

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

include/simdjson/portability.h

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#ifndef SIMDJSON_PORTABILITY_H
22
#define SIMDJSON_PORTABILITY_H
33

4-
#include <cstdint>
54
#include <cstddef>
6-
#include <cstdlib>
5+
#include <cstdint>
76
#include <cstdio>
7+
#include <cstdlib>
88
#ifdef _MSC_VER
99
#include <iso646.h>
1010
#endif
@@ -17,7 +17,10 @@
1717
#endif
1818

1919
// this is almost standard?
20-
#define STRINGIFY(a) #a
20+
#undef STRINGIFY_IMPLEMENTATION_
21+
#undef STRINGIFY
22+
#define STRINGIFY_IMPLEMENTATION_(a) #a
23+
#define STRINGIFY(a) STRINGIFY_IMPLEMENTATION_(a)
2124

2225
// we are going to use runtime dispatch
2326
#ifdef IS_X86_64
@@ -37,7 +40,7 @@
3740
#define UNTARGET_REGION _Pragma("GCC pop_options")
3841
#endif // clang then gcc
3942

40-
#endif // x86
43+
#endif // x86
4144

4245
// Default target region macros don't do anything.
4346
#ifndef TARGET_REGION
@@ -50,9 +53,11 @@
5053
#define TARGET_WESTMERE TARGET_REGION("sse4.2,pclmul")
5154
#define TARGET_ARM64
5255

56+
// Threading is disabled
57+
#undef SIMDJSON_THREADS_ENABLED
5358
// Is threading enabled?
5459
#if defined(BOOST_HAS_THREADS) || defined(_REENTRANT) || defined(_MT)
55-
#define SIMDJSON_THREADS_ENABLED 1
60+
#define SIMDJSON_THREADS_ENABLED
5661
#endif
5762

5863
#if defined(__clang__)
@@ -67,7 +72,6 @@
6772
#include <intrin.h> // visual studio
6873
#endif
6974

70-
7175
#ifdef _MSC_VER
7276
#define simdjson_strcasecmp _stricmp
7377
#else

0 commit comments

Comments
 (0)