16#if !defined(JSON_HEDLEY_VERSION) || (JSON_HEDLEY_VERSION < 15)
17#if defined(JSON_HEDLEY_VERSION)
18 #undef JSON_HEDLEY_VERSION
20#define JSON_HEDLEY_VERSION 15
22#if defined(JSON_HEDLEY_STRINGIFY_EX)
23 #undef JSON_HEDLEY_STRINGIFY_EX
25#define JSON_HEDLEY_STRINGIFY_EX(x) #x
27#if defined(JSON_HEDLEY_STRINGIFY)
28 #undef JSON_HEDLEY_STRINGIFY
30#define JSON_HEDLEY_STRINGIFY(x) JSON_HEDLEY_STRINGIFY_EX(x)
32#if defined(JSON_HEDLEY_CONCAT_EX)
33 #undef JSON_HEDLEY_CONCAT_EX
35#define JSON_HEDLEY_CONCAT_EX(a,b) a##b
37#if defined(JSON_HEDLEY_CONCAT)
38 #undef JSON_HEDLEY_CONCAT
40#define JSON_HEDLEY_CONCAT(a,b) JSON_HEDLEY_CONCAT_EX(a,b)
42#if defined(JSON_HEDLEY_CONCAT3_EX)
43 #undef JSON_HEDLEY_CONCAT3_EX
45#define JSON_HEDLEY_CONCAT3_EX(a,b,c) a##b##c
47#if defined(JSON_HEDLEY_CONCAT3)
48 #undef JSON_HEDLEY_CONCAT3
50#define JSON_HEDLEY_CONCAT3(a,b,c) JSON_HEDLEY_CONCAT3_EX(a,b,c)
52#if defined(JSON_HEDLEY_VERSION_ENCODE)
53 #undef JSON_HEDLEY_VERSION_ENCODE
55#define JSON_HEDLEY_VERSION_ENCODE(major,minor,revision) (((major) * 1000000) + ((minor) * 1000) + (revision))
57#if defined(JSON_HEDLEY_VERSION_DECODE_MAJOR)
58 #undef JSON_HEDLEY_VERSION_DECODE_MAJOR
60#define JSON_HEDLEY_VERSION_DECODE_MAJOR(version) ((version) / 1000000)
62#if defined(JSON_HEDLEY_VERSION_DECODE_MINOR)
63 #undef JSON_HEDLEY_VERSION_DECODE_MINOR
65#define JSON_HEDLEY_VERSION_DECODE_MINOR(version) (((version) % 1000000) / 1000)
67#if defined(JSON_HEDLEY_VERSION_DECODE_REVISION)
68 #undef JSON_HEDLEY_VERSION_DECODE_REVISION
70#define JSON_HEDLEY_VERSION_DECODE_REVISION(version) ((version) % 1000)
72#if defined(JSON_HEDLEY_GNUC_VERSION)
73 #undef JSON_HEDLEY_GNUC_VERSION
75#if defined(__GNUC__) && defined(__GNUC_PATCHLEVEL__)
76 #define JSON_HEDLEY_GNUC_VERSION JSON_HEDLEY_VERSION_ENCODE(__GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__)
77#elif defined(__GNUC__)
78 #define JSON_HEDLEY_GNUC_VERSION JSON_HEDLEY_VERSION_ENCODE(__GNUC__, __GNUC_MINOR__, 0)
81#if defined(JSON_HEDLEY_GNUC_VERSION_CHECK)
82 #undef JSON_HEDLEY_GNUC_VERSION_CHECK
84#if defined(JSON_HEDLEY_GNUC_VERSION)
85 #define JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_GNUC_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch))
87 #define JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) (0)
90#if defined(JSON_HEDLEY_MSVC_VERSION)
91 #undef JSON_HEDLEY_MSVC_VERSION
93#if defined(_MSC_FULL_VER) && (_MSC_FULL_VER >= 140000000) && !defined(__ICL)
94 #define JSON_HEDLEY_MSVC_VERSION JSON_HEDLEY_VERSION_ENCODE(_MSC_FULL_VER / 10000000, (_MSC_FULL_VER % 10000000) / 100000, (_MSC_FULL_VER % 100000) / 100)
95#elif defined(_MSC_FULL_VER) && !defined(__ICL)
96 #define JSON_HEDLEY_MSVC_VERSION JSON_HEDLEY_VERSION_ENCODE(_MSC_FULL_VER / 1000000, (_MSC_FULL_VER % 1000000) / 10000, (_MSC_FULL_VER % 10000) / 10)
97#elif defined(_MSC_VER) && !defined(__ICL)
98 #define JSON_HEDLEY_MSVC_VERSION JSON_HEDLEY_VERSION_ENCODE(_MSC_VER / 100, _MSC_VER % 100, 0)
101#if defined(JSON_HEDLEY_MSVC_VERSION_CHECK)
102 #undef JSON_HEDLEY_MSVC_VERSION_CHECK
104#if !defined(JSON_HEDLEY_MSVC_VERSION)
105 #define JSON_HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (0)
106#elif defined(_MSC_VER) && (_MSC_VER >= 1400)
107 #define JSON_HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (_MSC_FULL_VER >= ((major * 10000000) + (minor * 100000) + (patch)))
108#elif defined(_MSC_VER) && (_MSC_VER >= 1200)
109 #define JSON_HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (_MSC_FULL_VER >= ((major * 1000000) + (minor * 10000) + (patch)))
111 #define JSON_HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (_MSC_VER >= ((major * 100) + (minor)))
114#if defined(JSON_HEDLEY_INTEL_VERSION)
115 #undef JSON_HEDLEY_INTEL_VERSION
117#if defined(__INTEL_COMPILER) && defined(__INTEL_COMPILER_UPDATE) && !defined(__ICL)
118 #define JSON_HEDLEY_INTEL_VERSION JSON_HEDLEY_VERSION_ENCODE(__INTEL_COMPILER / 100, __INTEL_COMPILER % 100, __INTEL_COMPILER_UPDATE)
119#elif defined(__INTEL_COMPILER) && !defined(__ICL)
120 #define JSON_HEDLEY_INTEL_VERSION JSON_HEDLEY_VERSION_ENCODE(__INTEL_COMPILER / 100, __INTEL_COMPILER % 100, 0)
123#if defined(JSON_HEDLEY_INTEL_VERSION_CHECK)
124 #undef JSON_HEDLEY_INTEL_VERSION_CHECK
126#if defined(JSON_HEDLEY_INTEL_VERSION)
127 #define JSON_HEDLEY_INTEL_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_INTEL_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch))
129 #define JSON_HEDLEY_INTEL_VERSION_CHECK(major,minor,patch) (0)
132#if defined(JSON_HEDLEY_INTEL_CL_VERSION)
133 #undef JSON_HEDLEY_INTEL_CL_VERSION
135#if defined(__INTEL_COMPILER) && defined(__INTEL_COMPILER_UPDATE) && defined(__ICL)
136 #define JSON_HEDLEY_INTEL_CL_VERSION JSON_HEDLEY_VERSION_ENCODE(__INTEL_COMPILER, __INTEL_COMPILER_UPDATE, 0)
139#if defined(JSON_HEDLEY_INTEL_CL_VERSION_CHECK)
140 #undef JSON_HEDLEY_INTEL_CL_VERSION_CHECK
142#if defined(JSON_HEDLEY_INTEL_CL_VERSION)
143 #define JSON_HEDLEY_INTEL_CL_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_INTEL_CL_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch))
145 #define JSON_HEDLEY_INTEL_CL_VERSION_CHECK(major,minor,patch) (0)
148#if defined(JSON_HEDLEY_PGI_VERSION)
149 #undef JSON_HEDLEY_PGI_VERSION
151#if defined(__PGI) && defined(__PGIC__) && defined(__PGIC_MINOR__) && defined(__PGIC_PATCHLEVEL__)
152 #define JSON_HEDLEY_PGI_VERSION JSON_HEDLEY_VERSION_ENCODE(__PGIC__, __PGIC_MINOR__, __PGIC_PATCHLEVEL__)
155#if defined(JSON_HEDLEY_PGI_VERSION_CHECK)
156 #undef JSON_HEDLEY_PGI_VERSION_CHECK
158#if defined(JSON_HEDLEY_PGI_VERSION)
159 #define JSON_HEDLEY_PGI_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_PGI_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch))
161 #define JSON_HEDLEY_PGI_VERSION_CHECK(major,minor,patch) (0)
164#if defined(JSON_HEDLEY_SUNPRO_VERSION)
165 #undef JSON_HEDLEY_SUNPRO_VERSION
167#if defined(__SUNPRO_C) && (__SUNPRO_C > 0x1000)
168 #define JSON_HEDLEY_SUNPRO_VERSION JSON_HEDLEY_VERSION_ENCODE((((__SUNPRO_C >> 16) & 0xf) * 10) + ((__SUNPRO_C >> 12) & 0xf), (((__SUNPRO_C >> 8) & 0xf) * 10) + ((__SUNPRO_C >> 4) & 0xf), (__SUNPRO_C & 0xf) * 10)
169#elif defined(__SUNPRO_C)
170 #define JSON_HEDLEY_SUNPRO_VERSION JSON_HEDLEY_VERSION_ENCODE((__SUNPRO_C >> 8) & 0xf, (__SUNPRO_C >> 4) & 0xf, (__SUNPRO_C) & 0xf)
171#elif defined(__SUNPRO_CC) && (__SUNPRO_CC > 0x1000)
172 #define JSON_HEDLEY_SUNPRO_VERSION JSON_HEDLEY_VERSION_ENCODE((((__SUNPRO_CC >> 16) & 0xf) * 10) + ((__SUNPRO_CC >> 12) & 0xf), (((__SUNPRO_CC >> 8) & 0xf) * 10) + ((__SUNPRO_CC >> 4) & 0xf), (__SUNPRO_CC & 0xf) * 10)
173#elif defined(__SUNPRO_CC)
174 #define JSON_HEDLEY_SUNPRO_VERSION JSON_HEDLEY_VERSION_ENCODE((__SUNPRO_CC >> 8) & 0xf, (__SUNPRO_CC >> 4) & 0xf, (__SUNPRO_CC) & 0xf)
177#if defined(JSON_HEDLEY_SUNPRO_VERSION_CHECK)
178 #undef JSON_HEDLEY_SUNPRO_VERSION_CHECK
180#if defined(JSON_HEDLEY_SUNPRO_VERSION)
181 #define JSON_HEDLEY_SUNPRO_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_SUNPRO_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch))
183 #define JSON_HEDLEY_SUNPRO_VERSION_CHECK(major,minor,patch) (0)
186#if defined(JSON_HEDLEY_EMSCRIPTEN_VERSION)
187 #undef JSON_HEDLEY_EMSCRIPTEN_VERSION
189#if defined(__EMSCRIPTEN__)
190 #define JSON_HEDLEY_EMSCRIPTEN_VERSION JSON_HEDLEY_VERSION_ENCODE(__EMSCRIPTEN_major__, __EMSCRIPTEN_minor__, __EMSCRIPTEN_tiny__)
193#if defined(JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK)
194 #undef JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK
196#if defined(JSON_HEDLEY_EMSCRIPTEN_VERSION)
197 #define JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_EMSCRIPTEN_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch))
199 #define JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK(major,minor,patch) (0)
202#if defined(JSON_HEDLEY_ARM_VERSION)
203 #undef JSON_HEDLEY_ARM_VERSION
205#if defined(__CC_ARM) && defined(__ARMCOMPILER_VERSION)
206 #define JSON_HEDLEY_ARM_VERSION JSON_HEDLEY_VERSION_ENCODE(__ARMCOMPILER_VERSION / 1000000, (__ARMCOMPILER_VERSION % 1000000) / 10000, (__ARMCOMPILER_VERSION % 10000) / 100)
207#elif defined(__CC_ARM) && defined(__ARMCC_VERSION)
208 #define JSON_HEDLEY_ARM_VERSION JSON_HEDLEY_VERSION_ENCODE(__ARMCC_VERSION / 1000000, (__ARMCC_VERSION % 1000000) / 10000, (__ARMCC_VERSION % 10000) / 100)
211#if defined(JSON_HEDLEY_ARM_VERSION_CHECK)
212 #undef JSON_HEDLEY_ARM_VERSION_CHECK
214#if defined(JSON_HEDLEY_ARM_VERSION)
215 #define JSON_HEDLEY_ARM_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_ARM_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch))
217 #define JSON_HEDLEY_ARM_VERSION_CHECK(major,minor,patch) (0)
220#if defined(JSON_HEDLEY_IBM_VERSION)
221 #undef JSON_HEDLEY_IBM_VERSION
223#if defined(__ibmxl__)
224 #define JSON_HEDLEY_IBM_VERSION JSON_HEDLEY_VERSION_ENCODE(__ibmxl_version__, __ibmxl_release__, __ibmxl_modification__)
225#elif defined(__xlC__) && defined(__xlC_ver__)
226 #define JSON_HEDLEY_IBM_VERSION JSON_HEDLEY_VERSION_ENCODE(__xlC__ >> 8, __xlC__ & 0xff, (__xlC_ver__ >> 8) & 0xff)
227#elif defined(__xlC__)
228 #define JSON_HEDLEY_IBM_VERSION JSON_HEDLEY_VERSION_ENCODE(__xlC__ >> 8, __xlC__ & 0xff, 0)
231#if defined(JSON_HEDLEY_IBM_VERSION_CHECK)
232 #undef JSON_HEDLEY_IBM_VERSION_CHECK
234#if defined(JSON_HEDLEY_IBM_VERSION)
235 #define JSON_HEDLEY_IBM_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_IBM_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch))
237 #define JSON_HEDLEY_IBM_VERSION_CHECK(major,minor,patch) (0)
240#if defined(JSON_HEDLEY_TI_VERSION)
241 #undef JSON_HEDLEY_TI_VERSION
244 defined(__TI_COMPILER_VERSION__) && \
246 defined(__TMS470__) || defined(__TI_ARM__) || \
247 defined(__MSP430__) || \
248 defined(__TMS320C2000__) \
250#if (__TI_COMPILER_VERSION__ >= 16000000)
251 #define JSON_HEDLEY_TI_VERSION JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000))
255#if defined(JSON_HEDLEY_TI_VERSION_CHECK)
256 #undef JSON_HEDLEY_TI_VERSION_CHECK
258#if defined(JSON_HEDLEY_TI_VERSION)
259 #define JSON_HEDLEY_TI_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TI_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch))
261 #define JSON_HEDLEY_TI_VERSION_CHECK(major,minor,patch) (0)
264#if defined(JSON_HEDLEY_TI_CL2000_VERSION)
265 #undef JSON_HEDLEY_TI_CL2000_VERSION
267#if defined(__TI_COMPILER_VERSION__) && defined(__TMS320C2000__)
268 #define JSON_HEDLEY_TI_CL2000_VERSION JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000))
271#if defined(JSON_HEDLEY_TI_CL2000_VERSION_CHECK)
272 #undef JSON_HEDLEY_TI_CL2000_VERSION_CHECK
274#if defined(JSON_HEDLEY_TI_CL2000_VERSION)
275 #define JSON_HEDLEY_TI_CL2000_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TI_CL2000_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch))
277 #define JSON_HEDLEY_TI_CL2000_VERSION_CHECK(major,minor,patch) (0)
280#if defined(JSON_HEDLEY_TI_CL430_VERSION)
281 #undef JSON_HEDLEY_TI_CL430_VERSION
283#if defined(__TI_COMPILER_VERSION__) && defined(__MSP430__)
284 #define JSON_HEDLEY_TI_CL430_VERSION JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000))
287#if defined(JSON_HEDLEY_TI_CL430_VERSION_CHECK)
288 #undef JSON_HEDLEY_TI_CL430_VERSION_CHECK
290#if defined(JSON_HEDLEY_TI_CL430_VERSION)
291 #define JSON_HEDLEY_TI_CL430_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TI_CL430_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch))
293 #define JSON_HEDLEY_TI_CL430_VERSION_CHECK(major,minor,patch) (0)
296#if defined(JSON_HEDLEY_TI_ARMCL_VERSION)
297 #undef JSON_HEDLEY_TI_ARMCL_VERSION
299#if defined(__TI_COMPILER_VERSION__) && (defined(__TMS470__) || defined(__TI_ARM__))
300 #define JSON_HEDLEY_TI_ARMCL_VERSION JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000))
303#if defined(JSON_HEDLEY_TI_ARMCL_VERSION_CHECK)
304 #undef JSON_HEDLEY_TI_ARMCL_VERSION_CHECK
306#if defined(JSON_HEDLEY_TI_ARMCL_VERSION)
307 #define JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TI_ARMCL_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch))
309 #define JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(major,minor,patch) (0)
312#if defined(JSON_HEDLEY_TI_CL6X_VERSION)
313 #undef JSON_HEDLEY_TI_CL6X_VERSION
315#if defined(__TI_COMPILER_VERSION__) && defined(__TMS320C6X__)
316 #define JSON_HEDLEY_TI_CL6X_VERSION JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000))
319#if defined(JSON_HEDLEY_TI_CL6X_VERSION_CHECK)
320 #undef JSON_HEDLEY_TI_CL6X_VERSION_CHECK
322#if defined(JSON_HEDLEY_TI_CL6X_VERSION)
323 #define JSON_HEDLEY_TI_CL6X_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TI_CL6X_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch))
325 #define JSON_HEDLEY_TI_CL6X_VERSION_CHECK(major,minor,patch) (0)
328#if defined(JSON_HEDLEY_TI_CL7X_VERSION)
329 #undef JSON_HEDLEY_TI_CL7X_VERSION
331#if defined(__TI_COMPILER_VERSION__) && defined(__C7000__)
332 #define JSON_HEDLEY_TI_CL7X_VERSION JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000))
335#if defined(JSON_HEDLEY_TI_CL7X_VERSION_CHECK)
336 #undef JSON_HEDLEY_TI_CL7X_VERSION_CHECK
338#if defined(JSON_HEDLEY_TI_CL7X_VERSION)
339 #define JSON_HEDLEY_TI_CL7X_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TI_CL7X_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch))
341 #define JSON_HEDLEY_TI_CL7X_VERSION_CHECK(major,minor,patch) (0)
344#if defined(JSON_HEDLEY_TI_CLPRU_VERSION)
345 #undef JSON_HEDLEY_TI_CLPRU_VERSION
347#if defined(__TI_COMPILER_VERSION__) && defined(__PRU__)
348 #define JSON_HEDLEY_TI_CLPRU_VERSION JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000))
351#if defined(JSON_HEDLEY_TI_CLPRU_VERSION_CHECK)
352 #undef JSON_HEDLEY_TI_CLPRU_VERSION_CHECK
354#if defined(JSON_HEDLEY_TI_CLPRU_VERSION)
355 #define JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TI_CLPRU_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch))
357 #define JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(major,minor,patch) (0)
360#if defined(JSON_HEDLEY_CRAY_VERSION)
361 #undef JSON_HEDLEY_CRAY_VERSION
364 #if defined(_RELEASE_PATCHLEVEL)
365 #define JSON_HEDLEY_CRAY_VERSION JSON_HEDLEY_VERSION_ENCODE(_RELEASE_MAJOR, _RELEASE_MINOR, _RELEASE_PATCHLEVEL)
367 #define JSON_HEDLEY_CRAY_VERSION JSON_HEDLEY_VERSION_ENCODE(_RELEASE_MAJOR, _RELEASE_MINOR, 0)
371#if defined(JSON_HEDLEY_CRAY_VERSION_CHECK)
372 #undef JSON_HEDLEY_CRAY_VERSION_CHECK
374#if defined(JSON_HEDLEY_CRAY_VERSION)
375 #define JSON_HEDLEY_CRAY_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_CRAY_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch))
377 #define JSON_HEDLEY_CRAY_VERSION_CHECK(major,minor,patch) (0)
380#if defined(JSON_HEDLEY_IAR_VERSION)
381 #undef JSON_HEDLEY_IAR_VERSION
383#if defined(__IAR_SYSTEMS_ICC__)
385 #define JSON_HEDLEY_IAR_VERSION JSON_HEDLEY_VERSION_ENCODE((__VER__ / 1000000), ((__VER__ / 1000) % 1000), (__VER__ % 1000))
387 #define JSON_HEDLEY_IAR_VERSION JSON_HEDLEY_VERSION_ENCODE(__VER__ / 100, __VER__ % 100, 0)
391#if defined(JSON_HEDLEY_IAR_VERSION_CHECK)
392 #undef JSON_HEDLEY_IAR_VERSION_CHECK
394#if defined(JSON_HEDLEY_IAR_VERSION)
395 #define JSON_HEDLEY_IAR_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_IAR_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch))
397 #define JSON_HEDLEY_IAR_VERSION_CHECK(major,minor,patch) (0)
400#if defined(JSON_HEDLEY_TINYC_VERSION)
401 #undef JSON_HEDLEY_TINYC_VERSION
403#if defined(__TINYC__)
404 #define JSON_HEDLEY_TINYC_VERSION JSON_HEDLEY_VERSION_ENCODE(__TINYC__ / 1000, (__TINYC__ / 100) % 10, __TINYC__ % 100)
407#if defined(JSON_HEDLEY_TINYC_VERSION_CHECK)
408 #undef JSON_HEDLEY_TINYC_VERSION_CHECK
410#if defined(JSON_HEDLEY_TINYC_VERSION)
411 #define JSON_HEDLEY_TINYC_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TINYC_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch))
413 #define JSON_HEDLEY_TINYC_VERSION_CHECK(major,minor,patch) (0)
416#if defined(JSON_HEDLEY_DMC_VERSION)
417 #undef JSON_HEDLEY_DMC_VERSION
420 #define JSON_HEDLEY_DMC_VERSION JSON_HEDLEY_VERSION_ENCODE(__DMC__ >> 8, (__DMC__ >> 4) & 0xf, __DMC__ & 0xf)
423#if defined(JSON_HEDLEY_DMC_VERSION_CHECK)
424 #undef JSON_HEDLEY_DMC_VERSION_CHECK
426#if defined(JSON_HEDLEY_DMC_VERSION)
427 #define JSON_HEDLEY_DMC_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_DMC_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch))
429 #define JSON_HEDLEY_DMC_VERSION_CHECK(major,minor,patch) (0)
432#if defined(JSON_HEDLEY_COMPCERT_VERSION)
433 #undef JSON_HEDLEY_COMPCERT_VERSION
435#if defined(__COMPCERT_VERSION__)
436 #define JSON_HEDLEY_COMPCERT_VERSION JSON_HEDLEY_VERSION_ENCODE(__COMPCERT_VERSION__ / 10000, (__COMPCERT_VERSION__ / 100) % 100, __COMPCERT_VERSION__ % 100)
439#if defined(JSON_HEDLEY_COMPCERT_VERSION_CHECK)
440 #undef JSON_HEDLEY_COMPCERT_VERSION_CHECK
442#if defined(JSON_HEDLEY_COMPCERT_VERSION)
443 #define JSON_HEDLEY_COMPCERT_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_COMPCERT_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch))
445 #define JSON_HEDLEY_COMPCERT_VERSION_CHECK(major,minor,patch) (0)
448#if defined(JSON_HEDLEY_PELLES_VERSION)
449 #undef JSON_HEDLEY_PELLES_VERSION
452 #define JSON_HEDLEY_PELLES_VERSION JSON_HEDLEY_VERSION_ENCODE(__POCC__ / 100, __POCC__ % 100, 0)
455#if defined(JSON_HEDLEY_PELLES_VERSION_CHECK)
456 #undef JSON_HEDLEY_PELLES_VERSION_CHECK
458#if defined(JSON_HEDLEY_PELLES_VERSION)
459 #define JSON_HEDLEY_PELLES_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_PELLES_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch))
461 #define JSON_HEDLEY_PELLES_VERSION_CHECK(major,minor,patch) (0)
464#if defined(JSON_HEDLEY_MCST_LCC_VERSION)
465 #undef JSON_HEDLEY_MCST_LCC_VERSION
467#if defined(__LCC__) && defined(__LCC_MINOR__)
468 #define JSON_HEDLEY_MCST_LCC_VERSION JSON_HEDLEY_VERSION_ENCODE(__LCC__ / 100, __LCC__ % 100, __LCC_MINOR__)
471#if defined(JSON_HEDLEY_MCST_LCC_VERSION_CHECK)
472 #undef JSON_HEDLEY_MCST_LCC_VERSION_CHECK
474#if defined(JSON_HEDLEY_MCST_LCC_VERSION)
475 #define JSON_HEDLEY_MCST_LCC_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_MCST_LCC_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch))
477 #define JSON_HEDLEY_MCST_LCC_VERSION_CHECK(major,minor,patch) (0)
480#if defined(JSON_HEDLEY_GCC_VERSION)
481 #undef JSON_HEDLEY_GCC_VERSION
484 defined(JSON_HEDLEY_GNUC_VERSION) && \
485 !defined(__clang__) && \
486 !defined(JSON_HEDLEY_INTEL_VERSION) && \
487 !defined(JSON_HEDLEY_PGI_VERSION) && \
488 !defined(JSON_HEDLEY_ARM_VERSION) && \
489 !defined(JSON_HEDLEY_CRAY_VERSION) && \
490 !defined(JSON_HEDLEY_TI_VERSION) && \
491 !defined(JSON_HEDLEY_TI_ARMCL_VERSION) && \
492 !defined(JSON_HEDLEY_TI_CL430_VERSION) && \
493 !defined(JSON_HEDLEY_TI_CL2000_VERSION) && \
494 !defined(JSON_HEDLEY_TI_CL6X_VERSION) && \
495 !defined(JSON_HEDLEY_TI_CL7X_VERSION) && \
496 !defined(JSON_HEDLEY_TI_CLPRU_VERSION) && \
497 !defined(__COMPCERT__) && \
498 !defined(JSON_HEDLEY_MCST_LCC_VERSION)
499 #define JSON_HEDLEY_GCC_VERSION JSON_HEDLEY_GNUC_VERSION
502#if defined(JSON_HEDLEY_GCC_VERSION_CHECK)
503 #undef JSON_HEDLEY_GCC_VERSION_CHECK
505#if defined(JSON_HEDLEY_GCC_VERSION)
506 #define JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_GCC_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch))
508 #define JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) (0)
511#if defined(JSON_HEDLEY_HAS_ATTRIBUTE)
512 #undef JSON_HEDLEY_HAS_ATTRIBUTE
515 defined(__has_attribute) && \
517 (!defined(JSON_HEDLEY_IAR_VERSION) || JSON_HEDLEY_IAR_VERSION_CHECK(8,5,9)) \
519# define JSON_HEDLEY_HAS_ATTRIBUTE(attribute) __has_attribute(attribute)
521# define JSON_HEDLEY_HAS_ATTRIBUTE(attribute) (0)
524#if defined(JSON_HEDLEY_GNUC_HAS_ATTRIBUTE)
525 #undef JSON_HEDLEY_GNUC_HAS_ATTRIBUTE
527#if defined(__has_attribute)
528 #define JSON_HEDLEY_GNUC_HAS_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_HAS_ATTRIBUTE(attribute)
530 #define JSON_HEDLEY_GNUC_HAS_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch)
533#if defined(JSON_HEDLEY_GCC_HAS_ATTRIBUTE)
534 #undef JSON_HEDLEY_GCC_HAS_ATTRIBUTE
536#if defined(__has_attribute)
537 #define JSON_HEDLEY_GCC_HAS_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_HAS_ATTRIBUTE(attribute)
539 #define JSON_HEDLEY_GCC_HAS_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch)
542#if defined(JSON_HEDLEY_HAS_CPP_ATTRIBUTE)
543 #undef JSON_HEDLEY_HAS_CPP_ATTRIBUTE
546 defined(__has_cpp_attribute) && \
547 defined(__cplusplus) && \
548 (!defined(JSON_HEDLEY_SUNPRO_VERSION) || JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,15,0))
549 #define JSON_HEDLEY_HAS_CPP_ATTRIBUTE(attribute) __has_cpp_attribute(attribute)
551 #define JSON_HEDLEY_HAS_CPP_ATTRIBUTE(attribute) (0)
554#if defined(JSON_HEDLEY_HAS_CPP_ATTRIBUTE_NS)
555 #undef JSON_HEDLEY_HAS_CPP_ATTRIBUTE_NS
557#if !defined(__cplusplus) || !defined(__has_cpp_attribute)
558 #define JSON_HEDLEY_HAS_CPP_ATTRIBUTE_NS(ns,attribute) (0)
560 !defined(JSON_HEDLEY_PGI_VERSION) && \
561 !defined(JSON_HEDLEY_IAR_VERSION) && \
562 (!defined(JSON_HEDLEY_SUNPRO_VERSION) || JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,15,0)) && \
563 (!defined(JSON_HEDLEY_MSVC_VERSION) || JSON_HEDLEY_MSVC_VERSION_CHECK(19,20,0))
564 #define JSON_HEDLEY_HAS_CPP_ATTRIBUTE_NS(ns,attribute) JSON_HEDLEY_HAS_CPP_ATTRIBUTE(ns::attribute)
566 #define JSON_HEDLEY_HAS_CPP_ATTRIBUTE_NS(ns,attribute) (0)
569#if defined(JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE)
570 #undef JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE
572#if defined(__has_cpp_attribute) && defined(__cplusplus)
573 #define JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) __has_cpp_attribute(attribute)
575 #define JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch)
578#if defined(JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE)
579 #undef JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE
581#if defined(__has_cpp_attribute) && defined(__cplusplus)
582 #define JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) __has_cpp_attribute(attribute)
584 #define JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch)
587#if defined(JSON_HEDLEY_HAS_BUILTIN)
588 #undef JSON_HEDLEY_HAS_BUILTIN
590#if defined(__has_builtin)
591 #define JSON_HEDLEY_HAS_BUILTIN(builtin) __has_builtin(builtin)
593 #define JSON_HEDLEY_HAS_BUILTIN(builtin) (0)
596#if defined(JSON_HEDLEY_GNUC_HAS_BUILTIN)
597 #undef JSON_HEDLEY_GNUC_HAS_BUILTIN
599#if defined(__has_builtin)
600 #define JSON_HEDLEY_GNUC_HAS_BUILTIN(builtin,major,minor,patch) __has_builtin(builtin)
602 #define JSON_HEDLEY_GNUC_HAS_BUILTIN(builtin,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch)
605#if defined(JSON_HEDLEY_GCC_HAS_BUILTIN)
606 #undef JSON_HEDLEY_GCC_HAS_BUILTIN
608#if defined(__has_builtin)
609 #define JSON_HEDLEY_GCC_HAS_BUILTIN(builtin,major,minor,patch) __has_builtin(builtin)
611 #define JSON_HEDLEY_GCC_HAS_BUILTIN(builtin,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch)
614#if defined(JSON_HEDLEY_HAS_FEATURE)
615 #undef JSON_HEDLEY_HAS_FEATURE
617#if defined(__has_feature)
618 #define JSON_HEDLEY_HAS_FEATURE(feature) __has_feature(feature)
620 #define JSON_HEDLEY_HAS_FEATURE(feature) (0)
623#if defined(JSON_HEDLEY_GNUC_HAS_FEATURE)
624 #undef JSON_HEDLEY_GNUC_HAS_FEATURE
626#if defined(__has_feature)
627 #define JSON_HEDLEY_GNUC_HAS_FEATURE(feature,major,minor,patch) __has_feature(feature)
629 #define JSON_HEDLEY_GNUC_HAS_FEATURE(feature,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch)
632#if defined(JSON_HEDLEY_GCC_HAS_FEATURE)
633 #undef JSON_HEDLEY_GCC_HAS_FEATURE
635#if defined(__has_feature)
636 #define JSON_HEDLEY_GCC_HAS_FEATURE(feature,major,minor,patch) __has_feature(feature)
638 #define JSON_HEDLEY_GCC_HAS_FEATURE(feature,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch)
641#if defined(JSON_HEDLEY_HAS_EXTENSION)
642 #undef JSON_HEDLEY_HAS_EXTENSION
644#if defined(__has_extension)
645 #define JSON_HEDLEY_HAS_EXTENSION(extension) __has_extension(extension)
647 #define JSON_HEDLEY_HAS_EXTENSION(extension) (0)
650#if defined(JSON_HEDLEY_GNUC_HAS_EXTENSION)
651 #undef JSON_HEDLEY_GNUC_HAS_EXTENSION
653#if defined(__has_extension)
654 #define JSON_HEDLEY_GNUC_HAS_EXTENSION(extension,major,minor,patch) __has_extension(extension)
656 #define JSON_HEDLEY_GNUC_HAS_EXTENSION(extension,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch)
659#if defined(JSON_HEDLEY_GCC_HAS_EXTENSION)
660 #undef JSON_HEDLEY_GCC_HAS_EXTENSION
662#if defined(__has_extension)
663 #define JSON_HEDLEY_GCC_HAS_EXTENSION(extension,major,minor,patch) __has_extension(extension)
665 #define JSON_HEDLEY_GCC_HAS_EXTENSION(extension,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch)
668#if defined(JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE)
669 #undef JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE
671#if defined(__has_declspec_attribute)
672 #define JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE(attribute) __has_declspec_attribute(attribute)
674 #define JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE(attribute) (0)
677#if defined(JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE)
678 #undef JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE
680#if defined(__has_declspec_attribute)
681 #define JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) __has_declspec_attribute(attribute)
683 #define JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch)
686#if defined(JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE)
687 #undef JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE
689#if defined(__has_declspec_attribute)
690 #define JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) __has_declspec_attribute(attribute)
692 #define JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch)
695#if defined(JSON_HEDLEY_HAS_WARNING)
696 #undef JSON_HEDLEY_HAS_WARNING
698#if defined(__has_warning)
699 #define JSON_HEDLEY_HAS_WARNING(warning) __has_warning(warning)
701 #define JSON_HEDLEY_HAS_WARNING(warning) (0)
704#if defined(JSON_HEDLEY_GNUC_HAS_WARNING)
705 #undef JSON_HEDLEY_GNUC_HAS_WARNING
707#if defined(__has_warning)
708 #define JSON_HEDLEY_GNUC_HAS_WARNING(warning,major,minor,patch) __has_warning(warning)
710 #define JSON_HEDLEY_GNUC_HAS_WARNING(warning,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch)
713#if defined(JSON_HEDLEY_GCC_HAS_WARNING)
714 #undef JSON_HEDLEY_GCC_HAS_WARNING
716#if defined(__has_warning)
717 #define JSON_HEDLEY_GCC_HAS_WARNING(warning,major,minor,patch) __has_warning(warning)
719 #define JSON_HEDLEY_GCC_HAS_WARNING(warning,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch)
723 (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) || \
724 defined(__clang__) || \
725 JSON_HEDLEY_GCC_VERSION_CHECK(3,0,0) || \
726 JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \
727 JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) || \
728 JSON_HEDLEY_PGI_VERSION_CHECK(18,4,0) || \
729 JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \
730 JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \
731 JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,7,0) || \
732 JSON_HEDLEY_TI_CL430_VERSION_CHECK(2,0,1) || \
733 JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,1,0) || \
734 JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,0,0) || \
735 JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \
736 JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \
737 JSON_HEDLEY_CRAY_VERSION_CHECK(5,0,0) || \
738 JSON_HEDLEY_TINYC_VERSION_CHECK(0,9,17) || \
739 JSON_HEDLEY_SUNPRO_VERSION_CHECK(8,0,0) || \
740 (JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) && defined(__C99_PRAGMA_OPERATOR))
741 #define JSON_HEDLEY_PRAGMA(value) _Pragma(#value)
742#elif JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0)
743 #define JSON_HEDLEY_PRAGMA(value) __pragma(value)
745 #define JSON_HEDLEY_PRAGMA(value)
748#if defined(JSON_HEDLEY_DIAGNOSTIC_PUSH)
749 #undef JSON_HEDLEY_DIAGNOSTIC_PUSH
751#if defined(JSON_HEDLEY_DIAGNOSTIC_POP)
752 #undef JSON_HEDLEY_DIAGNOSTIC_POP
754#if defined(__clang__)
755 #define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("clang diagnostic push")
756 #define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("clang diagnostic pop")
757#elif JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0)
758 #define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("warning(push)")
759 #define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("warning(pop)")
760#elif JSON_HEDLEY_GCC_VERSION_CHECK(4,6,0)
761 #define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("GCC diagnostic push")
762 #define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("GCC diagnostic pop")
764 JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0) || \
765 JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0)
766 #define JSON_HEDLEY_DIAGNOSTIC_PUSH __pragma(warning(push))
767 #define JSON_HEDLEY_DIAGNOSTIC_POP __pragma(warning(pop))
768#elif JSON_HEDLEY_ARM_VERSION_CHECK(5,6,0)
769 #define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("push")
770 #define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("pop")
772 JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \
773 JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \
774 JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,4,0) || \
775 JSON_HEDLEY_TI_CL6X_VERSION_CHECK(8,1,0) || \
776 JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \
777 JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0)
778 #define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("diag_push")
779 #define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("diag_pop")
780#elif JSON_HEDLEY_PELLES_VERSION_CHECK(2,90,0)
781 #define JSON_HEDLEY_DIAGNOSTIC_PUSH _Pragma("warning(push)")
782 #define JSON_HEDLEY_DIAGNOSTIC_POP _Pragma("warning(pop)")
784 #define JSON_HEDLEY_DIAGNOSTIC_PUSH
785 #define JSON_HEDLEY_DIAGNOSTIC_POP
790#if defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_)
791 #undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_
793#if defined(__cplusplus)
794# if JSON_HEDLEY_HAS_WARNING("-Wc++98-compat")
795# if JSON_HEDLEY_HAS_WARNING("-Wc++17-extensions")
796# if JSON_HEDLEY_HAS_WARNING("-Wc++1z-extensions")
797# define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(xpr) \
798 JSON_HEDLEY_DIAGNOSTIC_PUSH \
799 _Pragma("clang diagnostic ignored \"-Wc++98-compat\"") \
800 _Pragma("clang diagnostic ignored \"-Wc++17-extensions\"") \
801 _Pragma("clang diagnostic ignored \"-Wc++1z-extensions\"") \
803 JSON_HEDLEY_DIAGNOSTIC_POP
805# define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(xpr) \
806 JSON_HEDLEY_DIAGNOSTIC_PUSH \
807 _Pragma("clang diagnostic ignored \"-Wc++98-compat\"") \
808 _Pragma("clang diagnostic ignored \"-Wc++17-extensions\"") \
810 JSON_HEDLEY_DIAGNOSTIC_POP
813# define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(xpr) \
814 JSON_HEDLEY_DIAGNOSTIC_PUSH \
815 _Pragma("clang diagnostic ignored \"-Wc++98-compat\"") \
817 JSON_HEDLEY_DIAGNOSTIC_POP
821#if !defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_)
822 #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(x) x
825#if defined(JSON_HEDLEY_CONST_CAST)
826 #undef JSON_HEDLEY_CONST_CAST
828#if defined(__cplusplus)
829# define JSON_HEDLEY_CONST_CAST(T, expr) (const_cast<T>(expr))
831 JSON_HEDLEY_HAS_WARNING("-Wcast-qual") || \
832 JSON_HEDLEY_GCC_VERSION_CHECK(4,6,0) || \
833 JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0)
834# define JSON_HEDLEY_CONST_CAST(T, expr) (__extension__ ({ \
835 JSON_HEDLEY_DIAGNOSTIC_PUSH \
836 JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL \
838 JSON_HEDLEY_DIAGNOSTIC_POP \
841# define JSON_HEDLEY_CONST_CAST(T, expr) ((T) (expr))
844#if defined(JSON_HEDLEY_REINTERPRET_CAST)
845 #undef JSON_HEDLEY_REINTERPRET_CAST
847#if defined(__cplusplus)
848 #define JSON_HEDLEY_REINTERPRET_CAST(T, expr) (reinterpret_cast<T>(expr))
850 #define JSON_HEDLEY_REINTERPRET_CAST(T, expr) ((T) (expr))
853#if defined(JSON_HEDLEY_STATIC_CAST)
854 #undef JSON_HEDLEY_STATIC_CAST
856#if defined(__cplusplus)
857 #define JSON_HEDLEY_STATIC_CAST(T, expr) (static_cast<T>(expr))
859 #define JSON_HEDLEY_STATIC_CAST(T, expr) ((T) (expr))
862#if defined(JSON_HEDLEY_CPP_CAST)
863 #undef JSON_HEDLEY_CPP_CAST
865#if defined(__cplusplus)
866# if JSON_HEDLEY_HAS_WARNING("-Wold-style-cast")
867# define JSON_HEDLEY_CPP_CAST(T, expr) \
868 JSON_HEDLEY_DIAGNOSTIC_PUSH \
869 _Pragma("clang diagnostic ignored \"-Wold-style-cast\"") \
871 JSON_HEDLEY_DIAGNOSTIC_POP
872# elif JSON_HEDLEY_IAR_VERSION_CHECK(8,3,0)
873# define JSON_HEDLEY_CPP_CAST(T, expr) \
874 JSON_HEDLEY_DIAGNOSTIC_PUSH \
875 _Pragma("diag_suppress=Pe137") \
876 JSON_HEDLEY_DIAGNOSTIC_POP
878# define JSON_HEDLEY_CPP_CAST(T, expr) ((T) (expr))
881# define JSON_HEDLEY_CPP_CAST(T, expr) (expr)
884#if defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED)
885 #undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED
887#if JSON_HEDLEY_HAS_WARNING("-Wdeprecated-declarations")
888 #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"")
889#elif JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0)
890 #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("warning(disable:1478 1786)")
891#elif JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0)
892 #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED __pragma(warning(disable:1478 1786))
893#elif JSON_HEDLEY_PGI_VERSION_CHECK(20,7,0)
894 #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress 1215,1216,1444,1445")
895#elif JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0)
896 #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress 1215,1444")
897#elif JSON_HEDLEY_GCC_VERSION_CHECK(4,3,0)
898 #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
899#elif JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0)
900 #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED __pragma(warning(disable:4996))
901#elif JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10)
902 #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress 1215,1444")
904 JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \
905 (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
906 JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \
907 (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
908 JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \
909 (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
910 JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \
911 (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
912 JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \
913 JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \
914 JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0)
915 #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress 1291,1718")
916#elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,13,0) && !defined(__cplusplus)
917 #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("error_messages(off,E_DEPRECATED_ATT,E_DEPRECATED_ATT_MESS)")
918#elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,13,0) && defined(__cplusplus)
919 #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("error_messages(off,symdeprecated,symdeprecated2)")
920#elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0)
921 #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress=Pe1444,Pe1215")
922#elif JSON_HEDLEY_PELLES_VERSION_CHECK(2,90,0)
923 #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("warn(disable:2241)")
925 #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED
928#if defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS)
929 #undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS
931#if JSON_HEDLEY_HAS_WARNING("-Wunknown-pragmas")
932 #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("clang diagnostic ignored \"-Wunknown-pragmas\"")
933#elif JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0)
934 #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("warning(disable:161)")
935#elif JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0)
936 #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS __pragma(warning(disable:161))
937#elif JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0)
938 #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress 1675")
939#elif JSON_HEDLEY_GCC_VERSION_CHECK(4,3,0)
940 #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("GCC diagnostic ignored \"-Wunknown-pragmas\"")
941#elif JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0)
942 #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS __pragma(warning(disable:4068))
944 JSON_HEDLEY_TI_VERSION_CHECK(16,9,0) || \
945 JSON_HEDLEY_TI_CL6X_VERSION_CHECK(8,0,0) || \
946 JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \
947 JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,3,0)
948 #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress 163")
949#elif JSON_HEDLEY_TI_CL6X_VERSION_CHECK(8,0,0)
950 #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress 163")
951#elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0)
952 #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress=Pe161")
953#elif JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10)
954 #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress 161")
956 #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS
959#if defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES)
960 #undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES
962#if JSON_HEDLEY_HAS_WARNING("-Wunknown-attributes")
963 #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("clang diagnostic ignored \"-Wunknown-attributes\"")
964#elif JSON_HEDLEY_GCC_VERSION_CHECK(4,6,0)
965 #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
966#elif JSON_HEDLEY_INTEL_VERSION_CHECK(17,0,0)
967 #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("warning(disable:1292)")
968#elif JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0)
969 #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES __pragma(warning(disable:1292))
970#elif JSON_HEDLEY_MSVC_VERSION_CHECK(19,0,0)
971 #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES __pragma(warning(disable:5030))
972#elif JSON_HEDLEY_PGI_VERSION_CHECK(20,7,0)
973 #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("diag_suppress 1097,1098")
974#elif JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0)
975 #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("diag_suppress 1097")
976#elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,14,0) && defined(__cplusplus)
977 #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("error_messages(off,attrskipunsup)")
979 JSON_HEDLEY_TI_VERSION_CHECK(18,1,0) || \
980 JSON_HEDLEY_TI_CL6X_VERSION_CHECK(8,3,0) || \
981 JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0)
982 #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("diag_suppress 1173")
983#elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0)
984 #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("diag_suppress=Pe1097")
985#elif JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10)
986 #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("diag_suppress 1097")
988 #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES
991#if defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL)
992 #undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL
994#if JSON_HEDLEY_HAS_WARNING("-Wcast-qual")
995 #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL _Pragma("clang diagnostic ignored \"-Wcast-qual\"")
996#elif JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0)
997 #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL _Pragma("warning(disable:2203 2331)")
998#elif JSON_HEDLEY_GCC_VERSION_CHECK(3,0,0)
999 #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL _Pragma("GCC diagnostic ignored \"-Wcast-qual\"")
1001 #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL
1004#if defined(JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNUSED_FUNCTION)
1005 #undef JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNUSED_FUNCTION
1007#if JSON_HEDLEY_HAS_WARNING("-Wunused-function")
1008 #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNUSED_FUNCTION _Pragma("clang diagnostic ignored \"-Wunused-function\"")
1009#elif JSON_HEDLEY_GCC_VERSION_CHECK(3,4,0)
1010 #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNUSED_FUNCTION _Pragma("GCC diagnostic ignored \"-Wunused-function\"")
1011#elif JSON_HEDLEY_MSVC_VERSION_CHECK(1,0,0)
1012 #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNUSED_FUNCTION __pragma(warning(disable:4505))
1013#elif JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10)
1014 #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNUSED_FUNCTION _Pragma("diag_suppress 3142")
1016 #define JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNUSED_FUNCTION
1019#if defined(JSON_HEDLEY_DEPRECATED)
1020 #undef JSON_HEDLEY_DEPRECATED
1022#if defined(JSON_HEDLEY_DEPRECATED_FOR)
1023 #undef JSON_HEDLEY_DEPRECATED_FOR
1026 JSON_HEDLEY_MSVC_VERSION_CHECK(14,0,0) || \
1027 JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0)
1028 #define JSON_HEDLEY_DEPRECATED(since) __declspec(deprecated("Since " # since))
1029 #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) __declspec(deprecated("Since " #since "; use " #replacement))
1031 (JSON_HEDLEY_HAS_EXTENSION(attribute_deprecated_with_message) && !defined(JSON_HEDLEY_IAR_VERSION)) || \
1032 JSON_HEDLEY_GCC_VERSION_CHECK(4,5,0) || \
1033 JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \
1034 JSON_HEDLEY_ARM_VERSION_CHECK(5,6,0) || \
1035 JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,13,0) || \
1036 JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) || \
1037 JSON_HEDLEY_TI_VERSION_CHECK(18,1,0) || \
1038 JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(18,1,0) || \
1039 JSON_HEDLEY_TI_CL6X_VERSION_CHECK(8,3,0) || \
1040 JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \
1041 JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,3,0) || \
1042 JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10)
1043 #define JSON_HEDLEY_DEPRECATED(since) __attribute__((__deprecated__("Since " #since)))
1044 #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) __attribute__((__deprecated__("Since " #since "; use " #replacement)))
1045#elif defined(__cplusplus) && (__cplusplus >= 201402L)
1046 #define JSON_HEDLEY_DEPRECATED(since) JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[deprecated("Since " #since)]])
1047 #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[deprecated("Since " #since "; use " #replacement)]])
1049 JSON_HEDLEY_HAS_ATTRIBUTE(deprecated) || \
1050 JSON_HEDLEY_GCC_VERSION_CHECK(3,1,0) || \
1051 JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \
1052 JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \
1053 (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1054 JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \
1055 (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1056 JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \
1057 (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1058 JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \
1059 (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1060 JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \
1061 JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \
1062 JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \
1063 JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) || \
1064 JSON_HEDLEY_IAR_VERSION_CHECK(8,10,0)
1065 #define JSON_HEDLEY_DEPRECATED(since) __attribute__((__deprecated__))
1066 #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) __attribute__((__deprecated__))
1068 JSON_HEDLEY_MSVC_VERSION_CHECK(13,10,0) || \
1069 JSON_HEDLEY_PELLES_VERSION_CHECK(6,50,0) || \
1070 JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0)
1071 #define JSON_HEDLEY_DEPRECATED(since) __declspec(deprecated)
1072 #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) __declspec(deprecated)
1073#elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0)
1074 #define JSON_HEDLEY_DEPRECATED(since) _Pragma("deprecated")
1075 #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement) _Pragma("deprecated")
1077 #define JSON_HEDLEY_DEPRECATED(since)
1078 #define JSON_HEDLEY_DEPRECATED_FOR(since, replacement)
1081#if defined(JSON_HEDLEY_UNAVAILABLE)
1082 #undef JSON_HEDLEY_UNAVAILABLE
1085 JSON_HEDLEY_HAS_ATTRIBUTE(warning) || \
1086 JSON_HEDLEY_GCC_VERSION_CHECK(4,3,0) || \
1087 JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \
1088 JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10)
1089 #define JSON_HEDLEY_UNAVAILABLE(available_since) __attribute__((__warning__("Not available until " #available_since)))
1091 #define JSON_HEDLEY_UNAVAILABLE(available_since)
1094#if defined(JSON_HEDLEY_WARN_UNUSED_RESULT)
1095 #undef JSON_HEDLEY_WARN_UNUSED_RESULT
1097#if defined(JSON_HEDLEY_WARN_UNUSED_RESULT_MSG)
1098 #undef JSON_HEDLEY_WARN_UNUSED_RESULT_MSG
1101 JSON_HEDLEY_HAS_ATTRIBUTE(warn_unused_result) || \
1102 JSON_HEDLEY_GCC_VERSION_CHECK(3,4,0) || \
1103 JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \
1104 JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \
1105 (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1106 JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \
1107 (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1108 JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \
1109 (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1110 JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \
1111 (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1112 JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \
1113 JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \
1114 JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \
1115 (JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,15,0) && defined(__cplusplus)) || \
1116 JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) || \
1117 JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10)
1118 #define JSON_HEDLEY_WARN_UNUSED_RESULT __attribute__((__warn_unused_result__))
1119 #define JSON_HEDLEY_WARN_UNUSED_RESULT_MSG(msg) __attribute__((__warn_unused_result__))
1120#elif (JSON_HEDLEY_HAS_CPP_ATTRIBUTE(nodiscard) >= 201907L)
1121 #define JSON_HEDLEY_WARN_UNUSED_RESULT JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[nodiscard]])
1122 #define JSON_HEDLEY_WARN_UNUSED_RESULT_MSG(msg) JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[nodiscard(msg)]])
1123#elif JSON_HEDLEY_HAS_CPP_ATTRIBUTE(nodiscard)
1124 #define JSON_HEDLEY_WARN_UNUSED_RESULT JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[nodiscard]])
1125 #define JSON_HEDLEY_WARN_UNUSED_RESULT_MSG(msg) JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[nodiscard]])
1126#elif defined(_Check_return_)
1127 #define JSON_HEDLEY_WARN_UNUSED_RESULT _Check_return_
1128 #define JSON_HEDLEY_WARN_UNUSED_RESULT_MSG(msg) _Check_return_
1130 #define JSON_HEDLEY_WARN_UNUSED_RESULT
1131 #define JSON_HEDLEY_WARN_UNUSED_RESULT_MSG(msg)
1134#if defined(JSON_HEDLEY_SENTINEL)
1135 #undef JSON_HEDLEY_SENTINEL
1138 JSON_HEDLEY_HAS_ATTRIBUTE(sentinel) || \
1139 JSON_HEDLEY_GCC_VERSION_CHECK(4,0,0) || \
1140 JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \
1141 JSON_HEDLEY_ARM_VERSION_CHECK(5,4,0) || \
1142 JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10)
1143 #define JSON_HEDLEY_SENTINEL(position) __attribute__((__sentinel__(position)))
1145 #define JSON_HEDLEY_SENTINEL(position)
1148#if defined(JSON_HEDLEY_NO_RETURN)
1149 #undef JSON_HEDLEY_NO_RETURN
1151#if JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0)
1152 #define JSON_HEDLEY_NO_RETURN __noreturn
1154 JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \
1155 JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10)
1156 #define JSON_HEDLEY_NO_RETURN __attribute__((__noreturn__))
1157#elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
1158 #define JSON_HEDLEY_NO_RETURN _Noreturn
1159#elif defined(__cplusplus) && (__cplusplus >= 201103L)
1160 #define JSON_HEDLEY_NO_RETURN JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[noreturn]])
1162 JSON_HEDLEY_HAS_ATTRIBUTE(noreturn) || \
1163 JSON_HEDLEY_GCC_VERSION_CHECK(3,2,0) || \
1164 JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \
1165 JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \
1166 JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \
1167 JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \
1168 (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1169 JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \
1170 (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1171 JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \
1172 (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1173 JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \
1174 (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1175 JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \
1176 JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \
1177 JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \
1178 JSON_HEDLEY_IAR_VERSION_CHECK(8,10,0)
1179 #define JSON_HEDLEY_NO_RETURN __attribute__((__noreturn__))
1180#elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,10,0)
1181 #define JSON_HEDLEY_NO_RETURN _Pragma("does_not_return")
1183 JSON_HEDLEY_MSVC_VERSION_CHECK(13,10,0) || \
1184 JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0)
1185 #define JSON_HEDLEY_NO_RETURN __declspec(noreturn)
1186#elif JSON_HEDLEY_TI_CL6X_VERSION_CHECK(6,0,0) && defined(__cplusplus)
1187 #define JSON_HEDLEY_NO_RETURN _Pragma("FUNC_NEVER_RETURNS;")
1188#elif JSON_HEDLEY_COMPCERT_VERSION_CHECK(3,2,0)
1189 #define JSON_HEDLEY_NO_RETURN __attribute((noreturn))
1190#elif JSON_HEDLEY_PELLES_VERSION_CHECK(9,0,0)
1191 #define JSON_HEDLEY_NO_RETURN __declspec(noreturn)
1193 #define JSON_HEDLEY_NO_RETURN
1196#if defined(JSON_HEDLEY_NO_ESCAPE)
1197 #undef JSON_HEDLEY_NO_ESCAPE
1199#if JSON_HEDLEY_HAS_ATTRIBUTE(noescape)
1200 #define JSON_HEDLEY_NO_ESCAPE __attribute__((__noescape__))
1202 #define JSON_HEDLEY_NO_ESCAPE
1205#if defined(JSON_HEDLEY_UNREACHABLE)
1206 #undef JSON_HEDLEY_UNREACHABLE
1208#if defined(JSON_HEDLEY_UNREACHABLE_RETURN)
1209 #undef JSON_HEDLEY_UNREACHABLE_RETURN
1211#if defined(JSON_HEDLEY_ASSUME)
1212 #undef JSON_HEDLEY_ASSUME
1215 JSON_HEDLEY_MSVC_VERSION_CHECK(13,10,0) || \
1216 JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \
1217 JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0)
1218 #define JSON_HEDLEY_ASSUME(expr) __assume(expr)
1219#elif JSON_HEDLEY_HAS_BUILTIN(__builtin_assume)
1220 #define JSON_HEDLEY_ASSUME(expr) __builtin_assume(expr)
1222 JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,2,0) || \
1223 JSON_HEDLEY_TI_CL6X_VERSION_CHECK(4,0,0)
1224 #if defined(__cplusplus)
1225 #define JSON_HEDLEY_ASSUME(expr) std::_nassert(expr)
1227 #define JSON_HEDLEY_ASSUME(expr) _nassert(expr)
1231 (JSON_HEDLEY_HAS_BUILTIN(__builtin_unreachable) && (!defined(JSON_HEDLEY_ARM_VERSION))) || \
1232 JSON_HEDLEY_GCC_VERSION_CHECK(4,5,0) || \
1233 JSON_HEDLEY_PGI_VERSION_CHECK(18,10,0) || \
1234 JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \
1235 JSON_HEDLEY_IBM_VERSION_CHECK(13,1,5) || \
1236 JSON_HEDLEY_CRAY_VERSION_CHECK(10,0,0) || \
1237 JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10)
1238 #define JSON_HEDLEY_UNREACHABLE() __builtin_unreachable()
1239#elif defined(JSON_HEDLEY_ASSUME)
1240 #define JSON_HEDLEY_UNREACHABLE() JSON_HEDLEY_ASSUME(0)
1242#if !defined(JSON_HEDLEY_ASSUME)
1243 #if defined(JSON_HEDLEY_UNREACHABLE)
1244 #define JSON_HEDLEY_ASSUME(expr) JSON_HEDLEY_STATIC_CAST(void, ((expr) ? 1 : (JSON_HEDLEY_UNREACHABLE(), 1)))
1246 #define JSON_HEDLEY_ASSUME(expr) JSON_HEDLEY_STATIC_CAST(void, expr)
1249#if defined(JSON_HEDLEY_UNREACHABLE)
1251 JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,2,0) || \
1252 JSON_HEDLEY_TI_CL6X_VERSION_CHECK(4,0,0)
1253 #define JSON_HEDLEY_UNREACHABLE_RETURN(value) return (JSON_HEDLEY_STATIC_CAST(void, JSON_HEDLEY_ASSUME(0)), (value))
1255 #define JSON_HEDLEY_UNREACHABLE_RETURN(value) JSON_HEDLEY_UNREACHABLE()
1258 #define JSON_HEDLEY_UNREACHABLE_RETURN(value) return (value)
1260#if !defined(JSON_HEDLEY_UNREACHABLE)
1261 #define JSON_HEDLEY_UNREACHABLE() JSON_HEDLEY_ASSUME(0)
1265#if JSON_HEDLEY_HAS_WARNING("-Wpedantic")
1266 #pragma clang diagnostic ignored "-Wpedantic"
1268#if JSON_HEDLEY_HAS_WARNING("-Wc++98-compat-pedantic") && defined(__cplusplus)
1269 #pragma clang diagnostic ignored "-Wc++98-compat-pedantic"
1271#if JSON_HEDLEY_GCC_HAS_WARNING("-Wvariadic-macros",4,0,0)
1272 #if defined(__clang__)
1273 #pragma clang diagnostic ignored "-Wvariadic-macros"
1274 #elif defined(JSON_HEDLEY_GCC_VERSION)
1275 #pragma GCC diagnostic ignored "-Wvariadic-macros"
1278#if defined(JSON_HEDLEY_NON_NULL)
1279 #undef JSON_HEDLEY_NON_NULL
1282 JSON_HEDLEY_HAS_ATTRIBUTE(nonnull) || \
1283 JSON_HEDLEY_GCC_VERSION_CHECK(3,3,0) || \
1284 JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \
1285 JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0)
1286 #define JSON_HEDLEY_NON_NULL(...) __attribute__((__nonnull__(__VA_ARGS__)))
1288 #define JSON_HEDLEY_NON_NULL(...)
1292#if defined(JSON_HEDLEY_PRINTF_FORMAT)
1293 #undef JSON_HEDLEY_PRINTF_FORMAT
1295#if defined(__MINGW32__) && JSON_HEDLEY_GCC_HAS_ATTRIBUTE(format,4,4,0) && !defined(__USE_MINGW_ANSI_STDIO)
1296 #define JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __attribute__((__format__(ms_printf, string_idx, first_to_check)))
1297#elif defined(__MINGW32__) && JSON_HEDLEY_GCC_HAS_ATTRIBUTE(format,4,4,0) && defined(__USE_MINGW_ANSI_STDIO)
1298 #define JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __attribute__((__format__(gnu_printf, string_idx, first_to_check)))
1300 JSON_HEDLEY_HAS_ATTRIBUTE(format) || \
1301 JSON_HEDLEY_GCC_VERSION_CHECK(3,1,0) || \
1302 JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \
1303 JSON_HEDLEY_ARM_VERSION_CHECK(5,6,0) || \
1304 JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \
1305 JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \
1306 (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1307 JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \
1308 (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1309 JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \
1310 (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1311 JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \
1312 (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1313 JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \
1314 JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \
1315 JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \
1316 JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10)
1317 #define JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __attribute__((__format__(__printf__, string_idx, first_to_check)))
1318#elif JSON_HEDLEY_PELLES_VERSION_CHECK(6,0,0)
1319 #define JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __declspec(vaformat(printf,string_idx,first_to_check))
1321 #define JSON_HEDLEY_PRINTF_FORMAT(string_idx,first_to_check)
1324#if defined(JSON_HEDLEY_CONSTEXPR)
1325 #undef JSON_HEDLEY_CONSTEXPR
1327#if defined(__cplusplus)
1328 #if __cplusplus >= 201103L
1329 #define JSON_HEDLEY_CONSTEXPR JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(constexpr)
1332#if !defined(JSON_HEDLEY_CONSTEXPR)
1333 #define JSON_HEDLEY_CONSTEXPR
1336#if defined(JSON_HEDLEY_PREDICT)
1337 #undef JSON_HEDLEY_PREDICT
1339#if defined(JSON_HEDLEY_LIKELY)
1340 #undef JSON_HEDLEY_LIKELY
1342#if defined(JSON_HEDLEY_UNLIKELY)
1343 #undef JSON_HEDLEY_UNLIKELY
1345#if defined(JSON_HEDLEY_UNPREDICTABLE)
1346 #undef JSON_HEDLEY_UNPREDICTABLE
1348#if JSON_HEDLEY_HAS_BUILTIN(__builtin_unpredictable)
1349 #define JSON_HEDLEY_UNPREDICTABLE(expr) __builtin_unpredictable((expr))
1352 (JSON_HEDLEY_HAS_BUILTIN(__builtin_expect_with_probability) && !defined(JSON_HEDLEY_PGI_VERSION)) || \
1353 JSON_HEDLEY_GCC_VERSION_CHECK(9,0,0) || \
1354 JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10)
1355# define JSON_HEDLEY_PREDICT(expr, value, probability) __builtin_expect_with_probability( (expr), (value), (probability))
1356# define JSON_HEDLEY_PREDICT_TRUE(expr, probability) __builtin_expect_with_probability(!!(expr), 1 , (probability))
1357# define JSON_HEDLEY_PREDICT_FALSE(expr, probability) __builtin_expect_with_probability(!!(expr), 0 , (probability))
1358# define JSON_HEDLEY_LIKELY(expr) __builtin_expect (!!(expr), 1 )
1359# define JSON_HEDLEY_UNLIKELY(expr) __builtin_expect (!!(expr), 0 )
1361 (JSON_HEDLEY_HAS_BUILTIN(__builtin_expect) && !defined(JSON_HEDLEY_INTEL_CL_VERSION)) || \
1362 JSON_HEDLEY_GCC_VERSION_CHECK(3,0,0) || \
1363 JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \
1364 (JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,15,0) && defined(__cplusplus)) || \
1365 JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \
1366 JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \
1367 JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \
1368 JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,7,0) || \
1369 JSON_HEDLEY_TI_CL430_VERSION_CHECK(3,1,0) || \
1370 JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,1,0) || \
1371 JSON_HEDLEY_TI_CL6X_VERSION_CHECK(6,1,0) || \
1372 JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \
1373 JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \
1374 JSON_HEDLEY_TINYC_VERSION_CHECK(0,9,27) || \
1375 JSON_HEDLEY_CRAY_VERSION_CHECK(8,1,0) || \
1376 JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10)
1377# define JSON_HEDLEY_PREDICT(expr, expected, probability) \
1378 (((probability) >= 0.9) ? __builtin_expect((expr), (expected)) : (JSON_HEDLEY_STATIC_CAST(void, expected), (expr)))
1379# define JSON_HEDLEY_PREDICT_TRUE(expr, probability) \
1381 double hedley_probability_ = (probability); \
1382 ((hedley_probability_ >= 0.9) ? __builtin_expect(!!(expr), 1) : ((hedley_probability_ <= 0.1) ? __builtin_expect(!!(expr), 0) : !!(expr))); \
1384# define JSON_HEDLEY_PREDICT_FALSE(expr, probability) \
1386 double hedley_probability_ = (probability); \
1387 ((hedley_probability_ >= 0.9) ? __builtin_expect(!!(expr), 0) : ((hedley_probability_ <= 0.1) ? __builtin_expect(!!(expr), 1) : !!(expr))); \
1389# define JSON_HEDLEY_LIKELY(expr) __builtin_expect(!!(expr), 1)
1390# define JSON_HEDLEY_UNLIKELY(expr) __builtin_expect(!!(expr), 0)
1392# define JSON_HEDLEY_PREDICT(expr, expected, probability) (JSON_HEDLEY_STATIC_CAST(void, expected), (expr))
1393# define JSON_HEDLEY_PREDICT_TRUE(expr, probability) (!!(expr))
1394# define JSON_HEDLEY_PREDICT_FALSE(expr, probability) (!!(expr))
1395# define JSON_HEDLEY_LIKELY(expr) (!!(expr))
1396# define JSON_HEDLEY_UNLIKELY(expr) (!!(expr))
1398#if !defined(JSON_HEDLEY_UNPREDICTABLE)
1399 #define JSON_HEDLEY_UNPREDICTABLE(expr) JSON_HEDLEY_PREDICT(expr, 1, 0.5)
1402#if defined(JSON_HEDLEY_MALLOC)
1403 #undef JSON_HEDLEY_MALLOC
1406 JSON_HEDLEY_HAS_ATTRIBUTE(malloc) || \
1407 JSON_HEDLEY_GCC_VERSION_CHECK(3,1,0) || \
1408 JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \
1409 JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \
1410 JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \
1411 JSON_HEDLEY_IBM_VERSION_CHECK(12,1,0) || \
1412 JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \
1413 (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1414 JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \
1415 (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1416 JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \
1417 (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1418 JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \
1419 (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1420 JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \
1421 JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \
1422 JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \
1423 JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10)
1424 #define JSON_HEDLEY_MALLOC __attribute__((__malloc__))
1425#elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,10,0)
1426 #define JSON_HEDLEY_MALLOC _Pragma("returns_new_memory")
1428 JSON_HEDLEY_MSVC_VERSION_CHECK(14,0,0) || \
1429 JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0)
1430 #define JSON_HEDLEY_MALLOC __declspec(restrict)
1432 #define JSON_HEDLEY_MALLOC
1435#if defined(JSON_HEDLEY_PURE)
1436 #undef JSON_HEDLEY_PURE
1439 JSON_HEDLEY_HAS_ATTRIBUTE(pure) || \
1440 JSON_HEDLEY_GCC_VERSION_CHECK(2,96,0) || \
1441 JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \
1442 JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \
1443 JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \
1444 JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \
1445 JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \
1446 (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1447 JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \
1448 (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1449 JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \
1450 (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1451 JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \
1452 (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1453 JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \
1454 JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \
1455 JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \
1456 JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) || \
1457 JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10)
1458# define JSON_HEDLEY_PURE __attribute__((__pure__))
1459#elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,10,0)
1460# define JSON_HEDLEY_PURE _Pragma("does_not_write_global_data")
1461#elif defined(__cplusplus) && \
1463 JSON_HEDLEY_TI_CL430_VERSION_CHECK(2,0,1) || \
1464 JSON_HEDLEY_TI_CL6X_VERSION_CHECK(4,0,0) || \
1465 JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) \
1467# define JSON_HEDLEY_PURE _Pragma("FUNC_IS_PURE;")
1469# define JSON_HEDLEY_PURE
1472#if defined(JSON_HEDLEY_CONST)
1473 #undef JSON_HEDLEY_CONST
1476 JSON_HEDLEY_HAS_ATTRIBUTE(const) || \
1477 JSON_HEDLEY_GCC_VERSION_CHECK(2,5,0) || \
1478 JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \
1479 JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \
1480 JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \
1481 JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \
1482 JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \
1483 (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1484 JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \
1485 (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1486 JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \
1487 (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1488 JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \
1489 (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1490 JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \
1491 JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \
1492 JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \
1493 JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) || \
1494 JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10)
1495 #define JSON_HEDLEY_CONST __attribute__((__const__))
1497 JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,10,0)
1498 #define JSON_HEDLEY_CONST _Pragma("no_side_effect")
1500 #define JSON_HEDLEY_CONST JSON_HEDLEY_PURE
1503#if defined(JSON_HEDLEY_RESTRICT)
1504 #undef JSON_HEDLEY_RESTRICT
1506#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && !defined(__cplusplus)
1507 #define JSON_HEDLEY_RESTRICT restrict
1509 JSON_HEDLEY_GCC_VERSION_CHECK(3,1,0) || \
1510 JSON_HEDLEY_MSVC_VERSION_CHECK(14,0,0) || \
1511 JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \
1512 JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) || \
1513 JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \
1514 JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \
1515 JSON_HEDLEY_PGI_VERSION_CHECK(17,10,0) || \
1516 JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \
1517 JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,2,4) || \
1518 JSON_HEDLEY_TI_CL6X_VERSION_CHECK(8,1,0) || \
1519 JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \
1520 (JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,14,0) && defined(__cplusplus)) || \
1521 JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0) || \
1522 defined(__clang__) || \
1523 JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10)
1524 #define JSON_HEDLEY_RESTRICT __restrict
1525#elif JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,3,0) && !defined(__cplusplus)
1526 #define JSON_HEDLEY_RESTRICT _Restrict
1528 #define JSON_HEDLEY_RESTRICT
1531#if defined(JSON_HEDLEY_INLINE)
1532 #undef JSON_HEDLEY_INLINE
1535 (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) || \
1536 (defined(__cplusplus) && (__cplusplus >= 199711L))
1537 #define JSON_HEDLEY_INLINE inline
1539 defined(JSON_HEDLEY_GCC_VERSION) || \
1540 JSON_HEDLEY_ARM_VERSION_CHECK(6,2,0)
1541 #define JSON_HEDLEY_INLINE __inline__
1543 JSON_HEDLEY_MSVC_VERSION_CHECK(12,0,0) || \
1544 JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) || \
1545 JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \
1546 JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,1,0) || \
1547 JSON_HEDLEY_TI_CL430_VERSION_CHECK(3,1,0) || \
1548 JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,2,0) || \
1549 JSON_HEDLEY_TI_CL6X_VERSION_CHECK(8,0,0) || \
1550 JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \
1551 JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \
1552 JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10)
1553 #define JSON_HEDLEY_INLINE __inline
1555 #define JSON_HEDLEY_INLINE
1558#if defined(JSON_HEDLEY_ALWAYS_INLINE)
1559 #undef JSON_HEDLEY_ALWAYS_INLINE
1562 JSON_HEDLEY_HAS_ATTRIBUTE(always_inline) || \
1563 JSON_HEDLEY_GCC_VERSION_CHECK(4,0,0) || \
1564 JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \
1565 JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \
1566 JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \
1567 JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \
1568 JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \
1569 (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1570 JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \
1571 (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1572 JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \
1573 (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1574 JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \
1575 (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1576 JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \
1577 JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \
1578 JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \
1579 JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) || \
1580 JSON_HEDLEY_IAR_VERSION_CHECK(8,10,0)
1581# define JSON_HEDLEY_ALWAYS_INLINE __attribute__((__always_inline__)) JSON_HEDLEY_INLINE
1583 JSON_HEDLEY_MSVC_VERSION_CHECK(12,0,0) || \
1584 JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0)
1585# define JSON_HEDLEY_ALWAYS_INLINE __forceinline
1586#elif defined(__cplusplus) && \
1588 JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \
1589 JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \
1590 JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \
1591 JSON_HEDLEY_TI_CL6X_VERSION_CHECK(6,1,0) || \
1592 JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \
1593 JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) \
1595# define JSON_HEDLEY_ALWAYS_INLINE _Pragma("FUNC_ALWAYS_INLINE;")
1596#elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0)
1597# define JSON_HEDLEY_ALWAYS_INLINE _Pragma("inline=forced")
1599# define JSON_HEDLEY_ALWAYS_INLINE JSON_HEDLEY_INLINE
1602#if defined(JSON_HEDLEY_NEVER_INLINE)
1603 #undef JSON_HEDLEY_NEVER_INLINE
1606 JSON_HEDLEY_HAS_ATTRIBUTE(noinline) || \
1607 JSON_HEDLEY_GCC_VERSION_CHECK(4,0,0) || \
1608 JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \
1609 JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \
1610 JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \
1611 JSON_HEDLEY_IBM_VERSION_CHECK(10,1,0) || \
1612 JSON_HEDLEY_TI_VERSION_CHECK(15,12,0) || \
1613 (JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1614 JSON_HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \
1615 (JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1616 JSON_HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \
1617 (JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1618 JSON_HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \
1619 (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1620 JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \
1621 JSON_HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \
1622 JSON_HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \
1623 JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) || \
1624 JSON_HEDLEY_IAR_VERSION_CHECK(8,10,0)
1625 #define JSON_HEDLEY_NEVER_INLINE __attribute__((__noinline__))
1627 JSON_HEDLEY_MSVC_VERSION_CHECK(13,10,0) || \
1628 JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0)
1629 #define JSON_HEDLEY_NEVER_INLINE __declspec(noinline)
1630#elif JSON_HEDLEY_PGI_VERSION_CHECK(10,2,0)
1631 #define JSON_HEDLEY_NEVER_INLINE _Pragma("noinline")
1632#elif JSON_HEDLEY_TI_CL6X_VERSION_CHECK(6,0,0) && defined(__cplusplus)
1633 #define JSON_HEDLEY_NEVER_INLINE _Pragma("FUNC_CANNOT_INLINE;")
1634#elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0)
1635 #define JSON_HEDLEY_NEVER_INLINE _Pragma("inline=never")
1636#elif JSON_HEDLEY_COMPCERT_VERSION_CHECK(3,2,0)
1637 #define JSON_HEDLEY_NEVER_INLINE __attribute((noinline))
1638#elif JSON_HEDLEY_PELLES_VERSION_CHECK(9,0,0)
1639 #define JSON_HEDLEY_NEVER_INLINE __declspec(noinline)
1641 #define JSON_HEDLEY_NEVER_INLINE
1644#if defined(JSON_HEDLEY_PRIVATE)
1645 #undef JSON_HEDLEY_PRIVATE
1647#if defined(JSON_HEDLEY_PUBLIC)
1648 #undef JSON_HEDLEY_PUBLIC
1650#if defined(JSON_HEDLEY_IMPORT)
1651 #undef JSON_HEDLEY_IMPORT
1653#if defined(_WIN32) || defined(__CYGWIN__)
1654# define JSON_HEDLEY_PRIVATE
1655# define JSON_HEDLEY_PUBLIC __declspec(dllexport)
1656# define JSON_HEDLEY_IMPORT __declspec(dllimport)
1659 JSON_HEDLEY_HAS_ATTRIBUTE(visibility) || \
1660 JSON_HEDLEY_GCC_VERSION_CHECK(3,3,0) || \
1661 JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \
1662 JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \
1663 JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \
1664 JSON_HEDLEY_IBM_VERSION_CHECK(13,1,0) || \
1666 defined(__TI_EABI__) && \
1668 (JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1669 JSON_HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) \
1672 JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10)
1673# define JSON_HEDLEY_PRIVATE __attribute__((__visibility__("hidden")))
1674# define JSON_HEDLEY_PUBLIC __attribute__((__visibility__("default")))
1676# define JSON_HEDLEY_PRIVATE
1677# define JSON_HEDLEY_PUBLIC
1679# define JSON_HEDLEY_IMPORT extern
1682#if defined(JSON_HEDLEY_NO_THROW)
1683 #undef JSON_HEDLEY_NO_THROW
1686 JSON_HEDLEY_HAS_ATTRIBUTE(nothrow) || \
1687 JSON_HEDLEY_GCC_VERSION_CHECK(3,3,0) || \
1688 JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \
1689 JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10)
1690 #define JSON_HEDLEY_NO_THROW __attribute__((__nothrow__))
1692 JSON_HEDLEY_MSVC_VERSION_CHECK(13,1,0) || \
1693 JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) || \
1694 JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0)
1695 #define JSON_HEDLEY_NO_THROW __declspec(nothrow)
1697 #define JSON_HEDLEY_NO_THROW
1700#if defined(JSON_HEDLEY_FALL_THROUGH)
1701 #undef JSON_HEDLEY_FALL_THROUGH
1704 JSON_HEDLEY_HAS_ATTRIBUTE(fallthrough) || \
1705 JSON_HEDLEY_GCC_VERSION_CHECK(7,0,0) || \
1706 JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10)
1707 #define JSON_HEDLEY_FALL_THROUGH __attribute__((__fallthrough__))
1708#elif JSON_HEDLEY_HAS_CPP_ATTRIBUTE_NS(clang,fallthrough)
1709 #define JSON_HEDLEY_FALL_THROUGH JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[clang::fallthrough]])
1710#elif JSON_HEDLEY_HAS_CPP_ATTRIBUTE(fallthrough)
1711 #define JSON_HEDLEY_FALL_THROUGH JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[fallthrough]])
1712#elif defined(__fallthrough)
1713 #define JSON_HEDLEY_FALL_THROUGH __fallthrough
1715 #define JSON_HEDLEY_FALL_THROUGH
1718#if defined(JSON_HEDLEY_RETURNS_NON_NULL)
1719 #undef JSON_HEDLEY_RETURNS_NON_NULL
1722 JSON_HEDLEY_HAS_ATTRIBUTE(returns_nonnull) || \
1723 JSON_HEDLEY_GCC_VERSION_CHECK(4,9,0) || \
1724 JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10)
1725 #define JSON_HEDLEY_RETURNS_NON_NULL __attribute__((__returns_nonnull__))
1726#elif defined(_Ret_notnull_)
1727 #define JSON_HEDLEY_RETURNS_NON_NULL _Ret_notnull_
1729 #define JSON_HEDLEY_RETURNS_NON_NULL
1732#if defined(JSON_HEDLEY_ARRAY_PARAM)
1733 #undef JSON_HEDLEY_ARRAY_PARAM
1736 defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && \
1737 !defined(__STDC_NO_VLA__) && \
1738 !defined(__cplusplus) && \
1739 !defined(JSON_HEDLEY_PGI_VERSION) && \
1740 !defined(JSON_HEDLEY_TINYC_VERSION)
1741 #define JSON_HEDLEY_ARRAY_PARAM(name) (name)
1743 #define JSON_HEDLEY_ARRAY_PARAM(name)
1746#if defined(JSON_HEDLEY_IS_CONSTANT)
1747 #undef JSON_HEDLEY_IS_CONSTANT
1749#if defined(JSON_HEDLEY_REQUIRE_CONSTEXPR)
1750 #undef JSON_HEDLEY_REQUIRE_CONSTEXPR
1754#if defined(JSON_HEDLEY_IS_CONSTEXPR_)
1755 #undef JSON_HEDLEY_IS_CONSTEXPR_
1758 JSON_HEDLEY_HAS_BUILTIN(__builtin_constant_p) || \
1759 JSON_HEDLEY_GCC_VERSION_CHECK(3,4,0) || \
1760 JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \
1761 JSON_HEDLEY_TINYC_VERSION_CHECK(0,9,19) || \
1762 JSON_HEDLEY_ARM_VERSION_CHECK(4,1,0) || \
1763 JSON_HEDLEY_IBM_VERSION_CHECK(13,1,0) || \
1764 JSON_HEDLEY_TI_CL6X_VERSION_CHECK(6,1,0) || \
1765 (JSON_HEDLEY_SUNPRO_VERSION_CHECK(5,10,0) && !defined(__cplusplus)) || \
1766 JSON_HEDLEY_CRAY_VERSION_CHECK(8,1,0) || \
1767 JSON_HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10)
1768 #define JSON_HEDLEY_IS_CONSTANT(expr) __builtin_constant_p(expr)
1770#if !defined(__cplusplus)
1772 JSON_HEDLEY_HAS_BUILTIN(__builtin_types_compatible_p) || \
1773 JSON_HEDLEY_GCC_VERSION_CHECK(3,4,0) || \
1774 JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \
1775 JSON_HEDLEY_IBM_VERSION_CHECK(13,1,0) || \
1776 JSON_HEDLEY_CRAY_VERSION_CHECK(8,1,0) || \
1777 JSON_HEDLEY_ARM_VERSION_CHECK(5,4,0) || \
1778 JSON_HEDLEY_TINYC_VERSION_CHECK(0,9,24)
1779#if defined(__INTPTR_TYPE__)
1780 #define JSON_HEDLEY_IS_CONSTEXPR_(expr) __builtin_types_compatible_p(__typeof__((1 ? (void*) ((__INTPTR_TYPE__) ((expr) * 0)) : (int*) 0)), int*)
1783 #define JSON_HEDLEY_IS_CONSTEXPR_(expr) __builtin_types_compatible_p(__typeof__((1 ? (void*) ((intptr_t) ((expr) * 0)) : (int*) 0)), int*)
1787 defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) && \
1788 !defined(JSON_HEDLEY_SUNPRO_VERSION) && \
1789 !defined(JSON_HEDLEY_PGI_VERSION) && \
1790 !defined(JSON_HEDLEY_IAR_VERSION)) || \
1791 (JSON_HEDLEY_HAS_EXTENSION(c_generic_selections) && !defined(JSON_HEDLEY_IAR_VERSION)) || \
1792 JSON_HEDLEY_GCC_VERSION_CHECK(4,9,0) || \
1793 JSON_HEDLEY_INTEL_VERSION_CHECK(17,0,0) || \
1794 JSON_HEDLEY_IBM_VERSION_CHECK(12,1,0) || \
1795 JSON_HEDLEY_ARM_VERSION_CHECK(5,3,0)
1796#if defined(__INTPTR_TYPE__)
1797 #define JSON_HEDLEY_IS_CONSTEXPR_(expr) _Generic((1 ? (void*) ((__INTPTR_TYPE__) ((expr) * 0)) : (int*) 0), int*: 1, void*: 0)
1800 #define JSON_HEDLEY_IS_CONSTEXPR_(expr) _Generic((1 ? (void*) ((intptr_t) * 0) : (int*) 0), int*: 1, void*: 0)
1803 defined(JSON_HEDLEY_GCC_VERSION) || \
1804 defined(JSON_HEDLEY_INTEL_VERSION) || \
1805 defined(JSON_HEDLEY_TINYC_VERSION) || \
1806 defined(JSON_HEDLEY_TI_ARMCL_VERSION) || \
1807 JSON_HEDLEY_TI_CL430_VERSION_CHECK(18,12,0) || \
1808 defined(JSON_HEDLEY_TI_CL2000_VERSION) || \
1809 defined(JSON_HEDLEY_TI_CL6X_VERSION) || \
1810 defined(JSON_HEDLEY_TI_CL7X_VERSION) || \
1811 defined(JSON_HEDLEY_TI_CLPRU_VERSION) || \
1813# define JSON_HEDLEY_IS_CONSTEXPR_(expr) ( \
1817 ((void*) ((expr) * 0L) ) : \
1818((struct { char v[sizeof(void) * 2]; } *) 1) \
1824#if defined(JSON_HEDLEY_IS_CONSTEXPR_)
1825 #if !defined(JSON_HEDLEY_IS_CONSTANT)
1826 #define JSON_HEDLEY_IS_CONSTANT(expr) JSON_HEDLEY_IS_CONSTEXPR_(expr)
1828 #define JSON_HEDLEY_REQUIRE_CONSTEXPR(expr) (JSON_HEDLEY_IS_CONSTEXPR_(expr) ? (expr) : (-1))
1830 #if !defined(JSON_HEDLEY_IS_CONSTANT)
1831 #define JSON_HEDLEY_IS_CONSTANT(expr) (0)
1833 #define JSON_HEDLEY_REQUIRE_CONSTEXPR(expr) (expr)
1836#if defined(JSON_HEDLEY_BEGIN_C_DECLS)
1837 #undef JSON_HEDLEY_BEGIN_C_DECLS
1839#if defined(JSON_HEDLEY_END_C_DECLS)
1840 #undef JSON_HEDLEY_END_C_DECLS
1842#if defined(JSON_HEDLEY_C_DECL)
1843 #undef JSON_HEDLEY_C_DECL
1845#if defined(__cplusplus)
1846 #define JSON_HEDLEY_BEGIN_C_DECLS extern "C" {
1847 #define JSON_HEDLEY_END_C_DECLS }
1848 #define JSON_HEDLEY_C_DECL extern "C"
1850 #define JSON_HEDLEY_BEGIN_C_DECLS
1851 #define JSON_HEDLEY_END_C_DECLS
1852 #define JSON_HEDLEY_C_DECL
1855#if defined(JSON_HEDLEY_STATIC_ASSERT)
1856 #undef JSON_HEDLEY_STATIC_ASSERT
1859 !defined(__cplusplus) && ( \
1860 (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L)) || \
1861 (JSON_HEDLEY_HAS_FEATURE(c_static_assert) && !defined(JSON_HEDLEY_INTEL_CL_VERSION)) || \
1862 JSON_HEDLEY_GCC_VERSION_CHECK(6,0,0) || \
1863 JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \
1864 defined(_Static_assert) \
1866# define JSON_HEDLEY_STATIC_ASSERT(expr, message) _Static_assert(expr, message)
1868 (defined(__cplusplus) && (__cplusplus >= 201103L)) || \
1869 JSON_HEDLEY_MSVC_VERSION_CHECK(16,0,0) || \
1870 JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0)
1871# define JSON_HEDLEY_STATIC_ASSERT(expr, message) JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(static_assert(expr, message))
1873# define JSON_HEDLEY_STATIC_ASSERT(expr, message)
1876#if defined(JSON_HEDLEY_NULL)
1877 #undef JSON_HEDLEY_NULL
1879#if defined(__cplusplus)
1880 #if __cplusplus >= 201103L
1881 #define JSON_HEDLEY_NULL JSON_HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(nullptr)
1883 #define JSON_HEDLEY_NULL NULL
1885 #define JSON_HEDLEY_NULL JSON_HEDLEY_STATIC_CAST(void*, 0)
1888 #define JSON_HEDLEY_NULL NULL
1890 #define JSON_HEDLEY_NULL ((void*) 0)
1893#if defined(JSON_HEDLEY_MESSAGE)
1894 #undef JSON_HEDLEY_MESSAGE
1896#if JSON_HEDLEY_HAS_WARNING("-Wunknown-pragmas")
1897# define JSON_HEDLEY_MESSAGE(msg) \
1898 JSON_HEDLEY_DIAGNOSTIC_PUSH \
1899 JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS \
1900 JSON_HEDLEY_PRAGMA(message msg) \
1901 JSON_HEDLEY_DIAGNOSTIC_POP
1903 JSON_HEDLEY_GCC_VERSION_CHECK(4,4,0) || \
1904 JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0)
1905# define JSON_HEDLEY_MESSAGE(msg) JSON_HEDLEY_PRAGMA(message msg)
1906#elif JSON_HEDLEY_CRAY_VERSION_CHECK(5,0,0)
1907# define JSON_HEDLEY_MESSAGE(msg) JSON_HEDLEY_PRAGMA(_CRI message msg)
1908#elif JSON_HEDLEY_IAR_VERSION_CHECK(8,0,0)
1909# define JSON_HEDLEY_MESSAGE(msg) JSON_HEDLEY_PRAGMA(message(msg))
1910#elif JSON_HEDLEY_PELLES_VERSION_CHECK(2,0,0)
1911# define JSON_HEDLEY_MESSAGE(msg) JSON_HEDLEY_PRAGMA(message(msg))
1913# define JSON_HEDLEY_MESSAGE(msg)
1916#if defined(JSON_HEDLEY_WARNING)
1917 #undef JSON_HEDLEY_WARNING
1919#if JSON_HEDLEY_HAS_WARNING("-Wunknown-pragmas")
1920# define JSON_HEDLEY_WARNING(msg) \
1921 JSON_HEDLEY_DIAGNOSTIC_PUSH \
1922 JSON_HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS \
1923 JSON_HEDLEY_PRAGMA(clang warning msg) \
1924 JSON_HEDLEY_DIAGNOSTIC_POP
1926 JSON_HEDLEY_GCC_VERSION_CHECK(4,8,0) || \
1927 JSON_HEDLEY_PGI_VERSION_CHECK(18,4,0) || \
1928 JSON_HEDLEY_INTEL_VERSION_CHECK(13,0,0)
1929# define JSON_HEDLEY_WARNING(msg) JSON_HEDLEY_PRAGMA(GCC warning msg)
1931 JSON_HEDLEY_MSVC_VERSION_CHECK(15,0,0) || \
1932 JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0)
1933# define JSON_HEDLEY_WARNING(msg) JSON_HEDLEY_PRAGMA(message(msg))
1935# define JSON_HEDLEY_WARNING(msg) JSON_HEDLEY_MESSAGE(msg)
1938#if defined(JSON_HEDLEY_REQUIRE)
1939 #undef JSON_HEDLEY_REQUIRE
1941#if defined(JSON_HEDLEY_REQUIRE_MSG)
1942 #undef JSON_HEDLEY_REQUIRE_MSG
1944#if JSON_HEDLEY_HAS_ATTRIBUTE(diagnose_if)
1945# if JSON_HEDLEY_HAS_WARNING("-Wgcc-compat")
1946# define JSON_HEDLEY_REQUIRE(expr) \
1947 JSON_HEDLEY_DIAGNOSTIC_PUSH \
1948 _Pragma("clang diagnostic ignored \"-Wgcc-compat\"") \
1949 __attribute__((diagnose_if(!(expr), #expr, "error"))) \
1950 JSON_HEDLEY_DIAGNOSTIC_POP
1951# define JSON_HEDLEY_REQUIRE_MSG(expr,msg) \
1952 JSON_HEDLEY_DIAGNOSTIC_PUSH \
1953 _Pragma("clang diagnostic ignored \"-Wgcc-compat\"") \
1954 __attribute__((diagnose_if(!(expr), msg, "error"))) \
1955 JSON_HEDLEY_DIAGNOSTIC_POP
1957# define JSON_HEDLEY_REQUIRE(expr) __attribute__((diagnose_if(!(expr), #expr, "error")))
1958# define JSON_HEDLEY_REQUIRE_MSG(expr,msg) __attribute__((diagnose_if(!(expr), msg, "error")))
1961# define JSON_HEDLEY_REQUIRE(expr)
1962# define JSON_HEDLEY_REQUIRE_MSG(expr,msg)
1965#if defined(JSON_HEDLEY_FLAGS)
1966 #undef JSON_HEDLEY_FLAGS
1968#if JSON_HEDLEY_HAS_ATTRIBUTE(flag_enum) && (!defined(__cplusplus) || JSON_HEDLEY_HAS_WARNING("-Wbitfield-enum-conversion"))
1969 #define JSON_HEDLEY_FLAGS __attribute__((__flag_enum__))
1971 #define JSON_HEDLEY_FLAGS
1974#if defined(JSON_HEDLEY_FLAGS_CAST)
1975 #undef JSON_HEDLEY_FLAGS_CAST
1977#if JSON_HEDLEY_INTEL_VERSION_CHECK(19,0,0)
1978# define JSON_HEDLEY_FLAGS_CAST(T, expr) (__extension__ ({ \
1979 JSON_HEDLEY_DIAGNOSTIC_PUSH \
1980 _Pragma("warning(disable:188)") \
1982 JSON_HEDLEY_DIAGNOSTIC_POP \
1985# define JSON_HEDLEY_FLAGS_CAST(T, expr) JSON_HEDLEY_STATIC_CAST(T, expr)
1988#if defined(JSON_HEDLEY_EMPTY_BASES)
1989 #undef JSON_HEDLEY_EMPTY_BASES
1992 (JSON_HEDLEY_MSVC_VERSION_CHECK(19,0,23918) && !JSON_HEDLEY_MSVC_VERSION_CHECK(20,0,0)) || \
1993 JSON_HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0)
1994 #define JSON_HEDLEY_EMPTY_BASES __declspec(empty_bases)
1996 #define JSON_HEDLEY_EMPTY_BASES
2001#if defined(JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK)
2002 #undef JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK
2004#if defined(__clang__)
2005 #define JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK(major,minor,patch) (0)
2007 #define JSON_HEDLEY_GCC_NOT_CLANG_VERSION_CHECK(major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch)
2010#if defined(JSON_HEDLEY_CLANG_HAS_ATTRIBUTE)
2011 #undef JSON_HEDLEY_CLANG_HAS_ATTRIBUTE
2013#define JSON_HEDLEY_CLANG_HAS_ATTRIBUTE(attribute) JSON_HEDLEY_HAS_ATTRIBUTE(attribute)
2015#if defined(JSON_HEDLEY_CLANG_HAS_CPP_ATTRIBUTE)
2016 #undef JSON_HEDLEY_CLANG_HAS_CPP_ATTRIBUTE
2018#define JSON_HEDLEY_CLANG_HAS_CPP_ATTRIBUTE(attribute) JSON_HEDLEY_HAS_CPP_ATTRIBUTE(attribute)
2020#if defined(JSON_HEDLEY_CLANG_HAS_BUILTIN)
2021 #undef JSON_HEDLEY_CLANG_HAS_BUILTIN
2023#define JSON_HEDLEY_CLANG_HAS_BUILTIN(builtin) JSON_HEDLEY_HAS_BUILTIN(builtin)
2025#if defined(JSON_HEDLEY_CLANG_HAS_FEATURE)
2026 #undef JSON_HEDLEY_CLANG_HAS_FEATURE
2028#define JSON_HEDLEY_CLANG_HAS_FEATURE(feature) JSON_HEDLEY_HAS_FEATURE(feature)
2030#if defined(JSON_HEDLEY_CLANG_HAS_EXTENSION)
2031 #undef JSON_HEDLEY_CLANG_HAS_EXTENSION
2033#define JSON_HEDLEY_CLANG_HAS_EXTENSION(extension) JSON_HEDLEY_HAS_EXTENSION(extension)
2035#if defined(JSON_HEDLEY_CLANG_HAS_DECLSPEC_DECLSPEC_ATTRIBUTE)
2036 #undef JSON_HEDLEY_CLANG_HAS_DECLSPEC_DECLSPEC_ATTRIBUTE
2038#define JSON_HEDLEY_CLANG_HAS_DECLSPEC_ATTRIBUTE(attribute) JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE(attribute)
2040#if defined(JSON_HEDLEY_CLANG_HAS_WARNING)
2041 #undef JSON_HEDLEY_CLANG_HAS_WARNING
2043#define JSON_HEDLEY_CLANG_HAS_WARNING(warning) JSON_HEDLEY_HAS_WARNING(warning)
#define JSON_HEDLEY_DIAGNOSTIC_PUSH
Definition: hedley.h:784
#define JSON_HEDLEY_DIAGNOSTIC_POP
Definition: hedley.h:785