noobs 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (185) hide show
  1. package/COPYING +339 -0
  2. package/README.md +46 -0
  3. package/bin/64bit/obs.lib +0 -0
  4. package/binding.gyp +23 -0
  5. package/dist/bin/Qt6Core.dll +0 -0
  6. package/dist/bin/Qt6Gui.dll +0 -0
  7. package/dist/bin/Qt6Network.dll +0 -0
  8. package/dist/bin/Qt6Svg.dll +0 -0
  9. package/dist/bin/Qt6Widgets.dll +0 -0
  10. package/dist/bin/Qt6Xml.dll +0 -0
  11. package/dist/bin/avcodec-61.dll +0 -0
  12. package/dist/bin/avdevice-61.dll +0 -0
  13. package/dist/bin/avfilter-10.dll +0 -0
  14. package/dist/bin/avformat-61.dll +0 -0
  15. package/dist/bin/avutil-59.dll +0 -0
  16. package/dist/bin/datachannel.dll +0 -0
  17. package/dist/bin/libcurl.dll +0 -0
  18. package/dist/bin/libobs-d3d11.dll +0 -0
  19. package/dist/bin/libobs-opengl.dll +0 -0
  20. package/dist/bin/libobs-winrt.dll +0 -0
  21. package/dist/bin/librist.dll +0 -0
  22. package/dist/bin/libx264-164.dll +0 -0
  23. package/dist/bin/lua51.dll +0 -0
  24. package/dist/bin/obs-amf-test.exe +0 -0
  25. package/dist/bin/obs-ffmpeg-mux.exe +0 -0
  26. package/dist/bin/obs-frontend-api.dll +0 -0
  27. package/dist/bin/obs-scripting.dll +0 -0
  28. package/dist/bin/obs.dll +0 -0
  29. package/dist/bin/srt.dll +0 -0
  30. package/dist/bin/swresample-5.dll +0 -0
  31. package/dist/bin/swscale-8.dll +0 -0
  32. package/dist/bin/w32-pthreads.dll +0 -0
  33. package/dist/bin/zlib.dll +0 -0
  34. package/dist/effects/area.effect +250 -0
  35. package/dist/effects/bicubic_scale.effect +236 -0
  36. package/dist/effects/bilinear_lowres_scale.effect +123 -0
  37. package/dist/effects/color.effect +172 -0
  38. package/dist/effects/default.effect +254 -0
  39. package/dist/effects/default_rect.effect +84 -0
  40. package/dist/effects/deinterlace_base.effect +325 -0
  41. package/dist/effects/deinterlace_blend.effect +21 -0
  42. package/dist/effects/deinterlace_blend_2x.effect +21 -0
  43. package/dist/effects/deinterlace_discard.effect +21 -0
  44. package/dist/effects/deinterlace_discard_2x.effect +21 -0
  45. package/dist/effects/deinterlace_linear.effect +21 -0
  46. package/dist/effects/deinterlace_linear_2x.effect +21 -0
  47. package/dist/effects/deinterlace_yadif.effect +21 -0
  48. package/dist/effects/deinterlace_yadif_2x.effect +21 -0
  49. package/dist/effects/format_conversion.effect +1823 -0
  50. package/dist/effects/lanczos_scale.effect +292 -0
  51. package/dist/effects/opaque.effect +159 -0
  52. package/dist/effects/premultiplied_alpha.effect +38 -0
  53. package/dist/effects/repeat.effect +36 -0
  54. package/dist/effects/solid.effect +80 -0
  55. package/dist/noobs.node +0 -0
  56. package/dist/plugins/obs-ffmpeg.dll +0 -0
  57. package/dist/plugins/obs-x264.dll +0 -0
  58. package/dist/plugins/win-capture.dll +0 -0
  59. package/include/audio-monitoring/osx/mac-helpers.h +13 -0
  60. package/include/audio-monitoring/pulse/pulseaudio-wrapper.h +212 -0
  61. package/include/audio-monitoring/win32/wasapi-output.h +22 -0
  62. package/include/callback/calldata.h +195 -0
  63. package/include/callback/decl.h +61 -0
  64. package/include/callback/proc.h +52 -0
  65. package/include/callback/signal.h +73 -0
  66. package/include/graphics/axisang.h +65 -0
  67. package/include/graphics/bounds.h +108 -0
  68. package/include/graphics/device-exports.h +177 -0
  69. package/include/graphics/effect-parser.h +290 -0
  70. package/include/graphics/effect.h +190 -0
  71. package/include/graphics/graphics-internal.h +335 -0
  72. package/include/graphics/graphics.h +1024 -0
  73. package/include/graphics/half.h +100 -0
  74. package/include/graphics/image-file.h +124 -0
  75. package/include/graphics/input.h +34 -0
  76. package/include/graphics/libnsgif/libnsgif.h +142 -0
  77. package/include/graphics/math-defs.h +45 -0
  78. package/include/graphics/math-extra.h +61 -0
  79. package/include/graphics/matrix3.h +98 -0
  80. package/include/graphics/matrix4.h +102 -0
  81. package/include/graphics/plane.h +85 -0
  82. package/include/graphics/quat.h +170 -0
  83. package/include/graphics/shader-parser.h +273 -0
  84. package/include/graphics/srgb.h +177 -0
  85. package/include/graphics/vec2.h +148 -0
  86. package/include/graphics/vec3.h +224 -0
  87. package/include/graphics/vec4.h +241 -0
  88. package/include/media-io/audio-io.h +228 -0
  89. package/include/media-io/audio-math.h +43 -0
  90. package/include/media-io/audio-resampler.h +44 -0
  91. package/include/media-io/format-conversion.h +50 -0
  92. package/include/media-io/frame-rate.h +29 -0
  93. package/include/media-io/media-io-defs.h +20 -0
  94. package/include/media-io/media-remux.h +37 -0
  95. package/include/media-io/video-frame.h +64 -0
  96. package/include/media-io/video-io.h +338 -0
  97. package/include/media-io/video-scaler.h +43 -0
  98. package/include/obs-audio-controls.h +250 -0
  99. package/include/obs-av1.h +47 -0
  100. package/include/obs-avc.h +55 -0
  101. package/include/obs-config.h +52 -0
  102. package/include/obs-data.h +311 -0
  103. package/include/obs-defs.h +52 -0
  104. package/include/obs-encoder.h +361 -0
  105. package/include/obs-ffmpeg-compat.h +13 -0
  106. package/include/obs-hevc.h +81 -0
  107. package/include/obs-hotkey.h +271 -0
  108. package/include/obs-hotkeys.h +653 -0
  109. package/include/obs-interaction.h +56 -0
  110. package/include/obs-internal.h +1459 -0
  111. package/include/obs-missing-files.h +53 -0
  112. package/include/obs-module.h +181 -0
  113. package/include/obs-nal.h +37 -0
  114. package/include/obs-nix-platform.h +53 -0
  115. package/include/obs-nix-wayland.h +24 -0
  116. package/include/obs-nix-x11.h +22 -0
  117. package/include/obs-nix.h +42 -0
  118. package/include/obs-output.h +96 -0
  119. package/include/obs-properties.h +364 -0
  120. package/include/obs-scene.h +127 -0
  121. package/include/obs-service.h +115 -0
  122. package/include/obs-source.h +568 -0
  123. package/include/obs.h +2608 -0
  124. package/include/obsconfig.h +13 -0
  125. package/include/obsversion.h +5 -0
  126. package/include/util/apple/cfstring-utils.h +16 -0
  127. package/include/util/array-serializer.h +37 -0
  128. package/include/util/base.h +97 -0
  129. package/include/util/bitstream.h +28 -0
  130. package/include/util/bmem.h +94 -0
  131. package/include/util/buffered-file-serializer.h +32 -0
  132. package/include/util/c99defs.h +75 -0
  133. package/include/util/cf-lexer.h +199 -0
  134. package/include/util/cf-parser.h +281 -0
  135. package/include/util/circlebuf.h +319 -0
  136. package/include/util/config-file.h +103 -0
  137. package/include/util/crc32.h +29 -0
  138. package/include/util/curl/curl-helper.h +35 -0
  139. package/include/util/darray.h +606 -0
  140. package/include/util/deque.h +319 -0
  141. package/include/util/dstr.h +320 -0
  142. package/include/util/file-serializer.h +34 -0
  143. package/include/util/lexer.h +273 -0
  144. package/include/util/pipe.h +52 -0
  145. package/include/util/platform.h +223 -0
  146. package/include/util/profiler.h +97 -0
  147. package/include/util/serializer.h +158 -0
  148. package/include/util/simde/check.h +285 -0
  149. package/include/util/simde/debug-trap.h +117 -0
  150. package/include/util/simde/hedley.h +2123 -0
  151. package/include/util/simde/simde-align.h +481 -0
  152. package/include/util/simde/simde-arch.h +537 -0
  153. package/include/util/simde/simde-common.h +918 -0
  154. package/include/util/simde/simde-constify.h +925 -0
  155. package/include/util/simde/simde-detect-clang.h +114 -0
  156. package/include/util/simde/simde-diagnostic.h +447 -0
  157. package/include/util/simde/simde-features.h +550 -0
  158. package/include/util/simde/simde-math.h +1858 -0
  159. package/include/util/simde/x86/mmx.h +2456 -0
  160. package/include/util/simde/x86/sse.h +4479 -0
  161. package/include/util/simde/x86/sse2.h +7549 -0
  162. package/include/util/source-profiler.h +66 -0
  163. package/include/util/sse-intrin.h +32 -0
  164. package/include/util/task.h +22 -0
  165. package/include/util/text-lookup.h +45 -0
  166. package/include/util/threading-posix.h +77 -0
  167. package/include/util/threading-windows.h +142 -0
  168. package/include/util/threading.h +103 -0
  169. package/include/util/utf8.h +35 -0
  170. package/include/util/uthash.h +34 -0
  171. package/include/util/util_uint128.h +108 -0
  172. package/include/util/util_uint64.h +34 -0
  173. package/include/util/windows/device-enum.h +14 -0
  174. package/include/util/windows/obfuscate.h +16 -0
  175. package/include/util/windows/win-registry.h +37 -0
  176. package/include/util/windows/win-version.h +57 -0
  177. package/include/util/windows/window-helpers.h +47 -0
  178. package/index.d.ts +38 -0
  179. package/index.js +8 -0
  180. package/package.json +31 -0
  181. package/src/main.cpp +321 -0
  182. package/src/obs_interface.cpp +605 -0
  183. package/src/obs_interface.h +74 -0
  184. package/src/utils.cpp +80 -0
  185. package/src/utils.h +3 -0
@@ -0,0 +1,2123 @@
1
+ /* Hedley - https://nemequ.github.io/hedley
2
+ * Created by Evan Nemerson <evan@nemerson.com>
3
+ *
4
+ * To the extent possible under law, the author(s) have dedicated all
5
+ * copyright and related and neighboring rights to this software to
6
+ * the public domain worldwide. This software is distributed without
7
+ * any warranty.
8
+ *
9
+ * For details, see <http://creativecommons.org/publicdomain/zero/1.0/>.
10
+ * SPDX-License-Identifier: CC0-1.0
11
+ */
12
+
13
+ #if !defined(HEDLEY_VERSION) || (HEDLEY_VERSION < 14)
14
+ #if defined(HEDLEY_VERSION)
15
+ #undef HEDLEY_VERSION
16
+ #endif
17
+ #define HEDLEY_VERSION 14
18
+
19
+ #if defined(HEDLEY_STRINGIFY_EX)
20
+ #undef HEDLEY_STRINGIFY_EX
21
+ #endif
22
+ #define HEDLEY_STRINGIFY_EX(x) #x
23
+
24
+ #if defined(HEDLEY_STRINGIFY)
25
+ #undef HEDLEY_STRINGIFY
26
+ #endif
27
+ #define HEDLEY_STRINGIFY(x) HEDLEY_STRINGIFY_EX(x)
28
+
29
+ #if defined(HEDLEY_CONCAT_EX)
30
+ #undef HEDLEY_CONCAT_EX
31
+ #endif
32
+ #define HEDLEY_CONCAT_EX(a, b) a##b
33
+
34
+ #if defined(HEDLEY_CONCAT)
35
+ #undef HEDLEY_CONCAT
36
+ #endif
37
+ #define HEDLEY_CONCAT(a, b) HEDLEY_CONCAT_EX(a, b)
38
+
39
+ #if defined(HEDLEY_CONCAT3_EX)
40
+ #undef HEDLEY_CONCAT3_EX
41
+ #endif
42
+ #define HEDLEY_CONCAT3_EX(a, b, c) a##b##c
43
+
44
+ #if defined(HEDLEY_CONCAT3)
45
+ #undef HEDLEY_CONCAT3
46
+ #endif
47
+ #define HEDLEY_CONCAT3(a, b, c) HEDLEY_CONCAT3_EX(a, b, c)
48
+
49
+ #if defined(HEDLEY_VERSION_ENCODE)
50
+ #undef HEDLEY_VERSION_ENCODE
51
+ #endif
52
+ #define HEDLEY_VERSION_ENCODE(major, minor, revision) \
53
+ (((major)*1000000) + ((minor)*1000) + (revision))
54
+
55
+ #if defined(HEDLEY_VERSION_DECODE_MAJOR)
56
+ #undef HEDLEY_VERSION_DECODE_MAJOR
57
+ #endif
58
+ #define HEDLEY_VERSION_DECODE_MAJOR(version) ((version) / 1000000)
59
+
60
+ #if defined(HEDLEY_VERSION_DECODE_MINOR)
61
+ #undef HEDLEY_VERSION_DECODE_MINOR
62
+ #endif
63
+ #define HEDLEY_VERSION_DECODE_MINOR(version) (((version) % 1000000) / 1000)
64
+
65
+ #if defined(HEDLEY_VERSION_DECODE_REVISION)
66
+ #undef HEDLEY_VERSION_DECODE_REVISION
67
+ #endif
68
+ #define HEDLEY_VERSION_DECODE_REVISION(version) ((version) % 1000)
69
+
70
+ #if defined(HEDLEY_GNUC_VERSION)
71
+ #undef HEDLEY_GNUC_VERSION
72
+ #endif
73
+ #if defined(__GNUC__) && defined(__GNUC_PATCHLEVEL__)
74
+ #define HEDLEY_GNUC_VERSION \
75
+ HEDLEY_VERSION_ENCODE(__GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__)
76
+ #elif defined(__GNUC__)
77
+ #define HEDLEY_GNUC_VERSION HEDLEY_VERSION_ENCODE(__GNUC__, __GNUC_MINOR__, 0)
78
+ #endif
79
+
80
+ #if defined(HEDLEY_GNUC_VERSION_CHECK)
81
+ #undef HEDLEY_GNUC_VERSION_CHECK
82
+ #endif
83
+ #if defined(HEDLEY_GNUC_VERSION)
84
+ #define HEDLEY_GNUC_VERSION_CHECK(major, minor, patch) \
85
+ (HEDLEY_GNUC_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch))
86
+ #else
87
+ #define HEDLEY_GNUC_VERSION_CHECK(major, minor, patch) (0)
88
+ #endif
89
+
90
+ #if defined(HEDLEY_MSVC_VERSION)
91
+ #undef HEDLEY_MSVC_VERSION
92
+ #endif
93
+ #if defined(_MSC_FULL_VER) && (_MSC_FULL_VER >= 140000000) && !defined(__ICL)
94
+ #define HEDLEY_MSVC_VERSION \
95
+ HEDLEY_VERSION_ENCODE(_MSC_FULL_VER / 10000000, \
96
+ (_MSC_FULL_VER % 10000000) / 100000, \
97
+ (_MSC_FULL_VER % 100000) / 100)
98
+ #elif defined(_MSC_FULL_VER) && !defined(__ICL)
99
+ #define HEDLEY_MSVC_VERSION \
100
+ HEDLEY_VERSION_ENCODE(_MSC_FULL_VER / 1000000, \
101
+ (_MSC_FULL_VER % 1000000) / 10000, \
102
+ (_MSC_FULL_VER % 10000) / 10)
103
+ #elif defined(_MSC_VER) && !defined(__ICL)
104
+ #define HEDLEY_MSVC_VERSION \
105
+ HEDLEY_VERSION_ENCODE(_MSC_VER / 100, _MSC_VER % 100, 0)
106
+ #endif
107
+
108
+ #if defined(HEDLEY_MSVC_VERSION_CHECK)
109
+ #undef HEDLEY_MSVC_VERSION_CHECK
110
+ #endif
111
+ #if !defined(HEDLEY_MSVC_VERSION)
112
+ #define HEDLEY_MSVC_VERSION_CHECK(major, minor, patch) (0)
113
+ #elif defined(_MSC_VER) && (_MSC_VER >= 1400)
114
+ #define HEDLEY_MSVC_VERSION_CHECK(major, minor, patch) \
115
+ (_MSC_FULL_VER >= ((major * 10000000) + (minor * 100000) + (patch)))
116
+ #elif defined(_MSC_VER) && (_MSC_VER >= 1200)
117
+ #define HEDLEY_MSVC_VERSION_CHECK(major, minor, patch) \
118
+ (_MSC_FULL_VER >= ((major * 1000000) + (minor * 10000) + (patch)))
119
+ #else
120
+ #define HEDLEY_MSVC_VERSION_CHECK(major, minor, patch) \
121
+ (_MSC_VER >= ((major * 100) + (minor)))
122
+ #endif
123
+
124
+ #if defined(HEDLEY_INTEL_VERSION)
125
+ #undef HEDLEY_INTEL_VERSION
126
+ #endif
127
+ #if defined(__INTEL_COMPILER) && defined(__INTEL_COMPILER_UPDATE) && \
128
+ !defined(__ICL)
129
+ #define HEDLEY_INTEL_VERSION \
130
+ HEDLEY_VERSION_ENCODE(__INTEL_COMPILER / 100, __INTEL_COMPILER % 100, \
131
+ __INTEL_COMPILER_UPDATE)
132
+ #elif defined(__INTEL_COMPILER) && !defined(__ICL)
133
+ #define HEDLEY_INTEL_VERSION \
134
+ HEDLEY_VERSION_ENCODE(__INTEL_COMPILER / 100, __INTEL_COMPILER % 100, 0)
135
+ #endif
136
+
137
+ #if defined(HEDLEY_INTEL_VERSION_CHECK)
138
+ #undef HEDLEY_INTEL_VERSION_CHECK
139
+ #endif
140
+ #if defined(HEDLEY_INTEL_VERSION)
141
+ #define HEDLEY_INTEL_VERSION_CHECK(major, minor, patch) \
142
+ (HEDLEY_INTEL_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch))
143
+ #else
144
+ #define HEDLEY_INTEL_VERSION_CHECK(major, minor, patch) (0)
145
+ #endif
146
+
147
+ #if defined(HEDLEY_INTEL_CL_VERSION)
148
+ #undef HEDLEY_INTEL_CL_VERSION
149
+ #endif
150
+ #if defined(__INTEL_COMPILER) && defined(__INTEL_COMPILER_UPDATE) && \
151
+ defined(__ICL)
152
+ #define HEDLEY_INTEL_CL_VERSION \
153
+ HEDLEY_VERSION_ENCODE(__INTEL_COMPILER, __INTEL_COMPILER_UPDATE, 0)
154
+ #endif
155
+
156
+ #if defined(HEDLEY_INTEL_CL_VERSION_CHECK)
157
+ #undef HEDLEY_INTEL_CL_VERSION_CHECK
158
+ #endif
159
+ #if defined(HEDLEY_INTEL_CL_VERSION)
160
+ #define HEDLEY_INTEL_CL_VERSION_CHECK(major, minor, patch) \
161
+ (HEDLEY_INTEL_CL_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch))
162
+ #else
163
+ #define HEDLEY_INTEL_CL_VERSION_CHECK(major, minor, patch) (0)
164
+ #endif
165
+
166
+ #if defined(HEDLEY_PGI_VERSION)
167
+ #undef HEDLEY_PGI_VERSION
168
+ #endif
169
+ #if defined(__PGI) && defined(__PGIC__) && defined(__PGIC_MINOR__) && \
170
+ defined(__PGIC_PATCHLEVEL__)
171
+ #define HEDLEY_PGI_VERSION \
172
+ HEDLEY_VERSION_ENCODE(__PGIC__, __PGIC_MINOR__, __PGIC_PATCHLEVEL__)
173
+ #endif
174
+
175
+ #if defined(HEDLEY_PGI_VERSION_CHECK)
176
+ #undef HEDLEY_PGI_VERSION_CHECK
177
+ #endif
178
+ #if defined(HEDLEY_PGI_VERSION)
179
+ #define HEDLEY_PGI_VERSION_CHECK(major, minor, patch) \
180
+ (HEDLEY_PGI_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch))
181
+ #else
182
+ #define HEDLEY_PGI_VERSION_CHECK(major, minor, patch) (0)
183
+ #endif
184
+
185
+ #if defined(HEDLEY_SUNPRO_VERSION)
186
+ #undef HEDLEY_SUNPRO_VERSION
187
+ #endif
188
+ #if defined(__SUNPRO_C) && (__SUNPRO_C > 0x1000)
189
+ #define HEDLEY_SUNPRO_VERSION \
190
+ HEDLEY_VERSION_ENCODE((((__SUNPRO_C >> 16) & 0xf) * 10) + \
191
+ ((__SUNPRO_C >> 12) & 0xf), \
192
+ (((__SUNPRO_C >> 8) & 0xf) * 10) + \
193
+ ((__SUNPRO_C >> 4) & 0xf), \
194
+ (__SUNPRO_C & 0xf) * 10)
195
+ #elif defined(__SUNPRO_C)
196
+ #define HEDLEY_SUNPRO_VERSION \
197
+ HEDLEY_VERSION_ENCODE((__SUNPRO_C >> 8) & 0xf, \
198
+ (__SUNPRO_C >> 4) & 0xf, (__SUNPRO_C)&0xf)
199
+ #elif defined(__SUNPRO_CC) && (__SUNPRO_CC > 0x1000)
200
+ #define HEDLEY_SUNPRO_VERSION \
201
+ HEDLEY_VERSION_ENCODE((((__SUNPRO_CC >> 16) & 0xf) * 10) + \
202
+ ((__SUNPRO_CC >> 12) & 0xf), \
203
+ (((__SUNPRO_CC >> 8) & 0xf) * 10) + \
204
+ ((__SUNPRO_CC >> 4) & 0xf), \
205
+ (__SUNPRO_CC & 0xf) * 10)
206
+ #elif defined(__SUNPRO_CC)
207
+ #define HEDLEY_SUNPRO_VERSION \
208
+ HEDLEY_VERSION_ENCODE((__SUNPRO_CC >> 8) & 0xf, \
209
+ (__SUNPRO_CC >> 4) & 0xf, (__SUNPRO_CC)&0xf)
210
+ #endif
211
+
212
+ #if defined(HEDLEY_SUNPRO_VERSION_CHECK)
213
+ #undef HEDLEY_SUNPRO_VERSION_CHECK
214
+ #endif
215
+ #if defined(HEDLEY_SUNPRO_VERSION)
216
+ #define HEDLEY_SUNPRO_VERSION_CHECK(major, minor, patch) \
217
+ (HEDLEY_SUNPRO_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch))
218
+ #else
219
+ #define HEDLEY_SUNPRO_VERSION_CHECK(major, minor, patch) (0)
220
+ #endif
221
+
222
+ #if defined(HEDLEY_EMSCRIPTEN_VERSION)
223
+ #undef HEDLEY_EMSCRIPTEN_VERSION
224
+ #endif
225
+ #if defined(__EMSCRIPTEN__)
226
+ #define HEDLEY_EMSCRIPTEN_VERSION \
227
+ HEDLEY_VERSION_ENCODE(__EMSCRIPTEN_major__, __EMSCRIPTEN_minor__, \
228
+ __EMSCRIPTEN_tiny__)
229
+ #endif
230
+
231
+ #if defined(HEDLEY_EMSCRIPTEN_VERSION_CHECK)
232
+ #undef HEDLEY_EMSCRIPTEN_VERSION_CHECK
233
+ #endif
234
+ #if defined(HEDLEY_EMSCRIPTEN_VERSION)
235
+ #define HEDLEY_EMSCRIPTEN_VERSION_CHECK(major, minor, patch) \
236
+ (HEDLEY_EMSCRIPTEN_VERSION >= \
237
+ HEDLEY_VERSION_ENCODE(major, minor, patch))
238
+ #else
239
+ #define HEDLEY_EMSCRIPTEN_VERSION_CHECK(major, minor, patch) (0)
240
+ #endif
241
+
242
+ #if defined(HEDLEY_ARM_VERSION)
243
+ #undef HEDLEY_ARM_VERSION
244
+ #endif
245
+ #if defined(__CC_ARM) && defined(__ARMCOMPILER_VERSION)
246
+ #define HEDLEY_ARM_VERSION \
247
+ HEDLEY_VERSION_ENCODE(__ARMCOMPILER_VERSION / 1000000, \
248
+ (__ARMCOMPILER_VERSION % 1000000) / 10000, \
249
+ (__ARMCOMPILER_VERSION % 10000) / 100)
250
+ #elif defined(__CC_ARM) && defined(__ARMCC_VERSION)
251
+ #define HEDLEY_ARM_VERSION \
252
+ HEDLEY_VERSION_ENCODE(__ARMCC_VERSION / 1000000, \
253
+ (__ARMCC_VERSION % 1000000) / 10000, \
254
+ (__ARMCC_VERSION % 10000) / 100)
255
+ #endif
256
+
257
+ #if defined(HEDLEY_ARM_VERSION_CHECK)
258
+ #undef HEDLEY_ARM_VERSION_CHECK
259
+ #endif
260
+ #if defined(HEDLEY_ARM_VERSION)
261
+ #define HEDLEY_ARM_VERSION_CHECK(major, minor, patch) \
262
+ (HEDLEY_ARM_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch))
263
+ #else
264
+ #define HEDLEY_ARM_VERSION_CHECK(major, minor, patch) (0)
265
+ #endif
266
+
267
+ #if defined(HEDLEY_IBM_VERSION)
268
+ #undef HEDLEY_IBM_VERSION
269
+ #endif
270
+ #if defined(__ibmxl__)
271
+ #define HEDLEY_IBM_VERSION \
272
+ HEDLEY_VERSION_ENCODE(__ibmxl_version__, __ibmxl_release__, \
273
+ __ibmxl_modification__)
274
+ #elif defined(__xlC__) && defined(__xlC_ver__)
275
+ #define HEDLEY_IBM_VERSION \
276
+ HEDLEY_VERSION_ENCODE(__xlC__ >> 8, __xlC__ & 0xff, \
277
+ (__xlC_ver__ >> 8) & 0xff)
278
+ #elif defined(__xlC__)
279
+ #define HEDLEY_IBM_VERSION \
280
+ HEDLEY_VERSION_ENCODE(__xlC__ >> 8, __xlC__ & 0xff, 0)
281
+ #endif
282
+
283
+ #if defined(HEDLEY_IBM_VERSION_CHECK)
284
+ #undef HEDLEY_IBM_VERSION_CHECK
285
+ #endif
286
+ #if defined(HEDLEY_IBM_VERSION)
287
+ #define HEDLEY_IBM_VERSION_CHECK(major, minor, patch) \
288
+ (HEDLEY_IBM_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch))
289
+ #else
290
+ #define HEDLEY_IBM_VERSION_CHECK(major, minor, patch) (0)
291
+ #endif
292
+
293
+ #if defined(HEDLEY_TI_VERSION)
294
+ #undef HEDLEY_TI_VERSION
295
+ #endif
296
+ #if defined(__TI_COMPILER_VERSION__) && \
297
+ (defined(__TMS470__) || defined(__TI_ARM__) || defined(__MSP430__) || \
298
+ defined(__TMS320C2000__))
299
+ #if (__TI_COMPILER_VERSION__ >= 16000000)
300
+ #define HEDLEY_TI_VERSION \
301
+ HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, \
302
+ (__TI_COMPILER_VERSION__ % 1000000) / 1000, \
303
+ (__TI_COMPILER_VERSION__ % 1000))
304
+ #endif
305
+ #endif
306
+
307
+ #if defined(HEDLEY_TI_VERSION_CHECK)
308
+ #undef HEDLEY_TI_VERSION_CHECK
309
+ #endif
310
+ #if defined(HEDLEY_TI_VERSION)
311
+ #define HEDLEY_TI_VERSION_CHECK(major, minor, patch) \
312
+ (HEDLEY_TI_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch))
313
+ #else
314
+ #define HEDLEY_TI_VERSION_CHECK(major, minor, patch) (0)
315
+ #endif
316
+
317
+ #if defined(HEDLEY_TI_CL2000_VERSION)
318
+ #undef HEDLEY_TI_CL2000_VERSION
319
+ #endif
320
+ #if defined(__TI_COMPILER_VERSION__) && defined(__TMS320C2000__)
321
+ #define HEDLEY_TI_CL2000_VERSION \
322
+ HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, \
323
+ (__TI_COMPILER_VERSION__ % 1000000) / 1000, \
324
+ (__TI_COMPILER_VERSION__ % 1000))
325
+ #endif
326
+
327
+ #if defined(HEDLEY_TI_CL2000_VERSION_CHECK)
328
+ #undef HEDLEY_TI_CL2000_VERSION_CHECK
329
+ #endif
330
+ #if defined(HEDLEY_TI_CL2000_VERSION)
331
+ #define HEDLEY_TI_CL2000_VERSION_CHECK(major, minor, patch) \
332
+ (HEDLEY_TI_CL2000_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch))
333
+ #else
334
+ #define HEDLEY_TI_CL2000_VERSION_CHECK(major, minor, patch) (0)
335
+ #endif
336
+
337
+ #if defined(HEDLEY_TI_CL430_VERSION)
338
+ #undef HEDLEY_TI_CL430_VERSION
339
+ #endif
340
+ #if defined(__TI_COMPILER_VERSION__) && defined(__MSP430__)
341
+ #define HEDLEY_TI_CL430_VERSION \
342
+ HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, \
343
+ (__TI_COMPILER_VERSION__ % 1000000) / 1000, \
344
+ (__TI_COMPILER_VERSION__ % 1000))
345
+ #endif
346
+
347
+ #if defined(HEDLEY_TI_CL430_VERSION_CHECK)
348
+ #undef HEDLEY_TI_CL430_VERSION_CHECK
349
+ #endif
350
+ #if defined(HEDLEY_TI_CL430_VERSION)
351
+ #define HEDLEY_TI_CL430_VERSION_CHECK(major, minor, patch) \
352
+ (HEDLEY_TI_CL430_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch))
353
+ #else
354
+ #define HEDLEY_TI_CL430_VERSION_CHECK(major, minor, patch) (0)
355
+ #endif
356
+
357
+ #if defined(HEDLEY_TI_ARMCL_VERSION)
358
+ #undef HEDLEY_TI_ARMCL_VERSION
359
+ #endif
360
+ #if defined(__TI_COMPILER_VERSION__) && \
361
+ (defined(__TMS470__) || defined(__TI_ARM__))
362
+ #define HEDLEY_TI_ARMCL_VERSION \
363
+ HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, \
364
+ (__TI_COMPILER_VERSION__ % 1000000) / 1000, \
365
+ (__TI_COMPILER_VERSION__ % 1000))
366
+ #endif
367
+
368
+ #if defined(HEDLEY_TI_ARMCL_VERSION_CHECK)
369
+ #undef HEDLEY_TI_ARMCL_VERSION_CHECK
370
+ #endif
371
+ #if defined(HEDLEY_TI_ARMCL_VERSION)
372
+ #define HEDLEY_TI_ARMCL_VERSION_CHECK(major, minor, patch) \
373
+ (HEDLEY_TI_ARMCL_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch))
374
+ #else
375
+ #define HEDLEY_TI_ARMCL_VERSION_CHECK(major, minor, patch) (0)
376
+ #endif
377
+
378
+ #if defined(HEDLEY_TI_CL6X_VERSION)
379
+ #undef HEDLEY_TI_CL6X_VERSION
380
+ #endif
381
+ #if defined(__TI_COMPILER_VERSION__) && defined(__TMS320C6X__)
382
+ #define HEDLEY_TI_CL6X_VERSION \
383
+ HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, \
384
+ (__TI_COMPILER_VERSION__ % 1000000) / 1000, \
385
+ (__TI_COMPILER_VERSION__ % 1000))
386
+ #endif
387
+
388
+ #if defined(HEDLEY_TI_CL6X_VERSION_CHECK)
389
+ #undef HEDLEY_TI_CL6X_VERSION_CHECK
390
+ #endif
391
+ #if defined(HEDLEY_TI_CL6X_VERSION)
392
+ #define HEDLEY_TI_CL6X_VERSION_CHECK(major, minor, patch) \
393
+ (HEDLEY_TI_CL6X_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch))
394
+ #else
395
+ #define HEDLEY_TI_CL6X_VERSION_CHECK(major, minor, patch) (0)
396
+ #endif
397
+
398
+ #if defined(HEDLEY_TI_CL7X_VERSION)
399
+ #undef HEDLEY_TI_CL7X_VERSION
400
+ #endif
401
+ #if defined(__TI_COMPILER_VERSION__) && defined(__C7000__)
402
+ #define HEDLEY_TI_CL7X_VERSION \
403
+ HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, \
404
+ (__TI_COMPILER_VERSION__ % 1000000) / 1000, \
405
+ (__TI_COMPILER_VERSION__ % 1000))
406
+ #endif
407
+
408
+ #if defined(HEDLEY_TI_CL7X_VERSION_CHECK)
409
+ #undef HEDLEY_TI_CL7X_VERSION_CHECK
410
+ #endif
411
+ #if defined(HEDLEY_TI_CL7X_VERSION)
412
+ #define HEDLEY_TI_CL7X_VERSION_CHECK(major, minor, patch) \
413
+ (HEDLEY_TI_CL7X_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch))
414
+ #else
415
+ #define HEDLEY_TI_CL7X_VERSION_CHECK(major, minor, patch) (0)
416
+ #endif
417
+
418
+ #if defined(HEDLEY_TI_CLPRU_VERSION)
419
+ #undef HEDLEY_TI_CLPRU_VERSION
420
+ #endif
421
+ #if defined(__TI_COMPILER_VERSION__) && defined(__PRU__)
422
+ #define HEDLEY_TI_CLPRU_VERSION \
423
+ HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, \
424
+ (__TI_COMPILER_VERSION__ % 1000000) / 1000, \
425
+ (__TI_COMPILER_VERSION__ % 1000))
426
+ #endif
427
+
428
+ #if defined(HEDLEY_TI_CLPRU_VERSION_CHECK)
429
+ #undef HEDLEY_TI_CLPRU_VERSION_CHECK
430
+ #endif
431
+ #if defined(HEDLEY_TI_CLPRU_VERSION)
432
+ #define HEDLEY_TI_CLPRU_VERSION_CHECK(major, minor, patch) \
433
+ (HEDLEY_TI_CLPRU_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch))
434
+ #else
435
+ #define HEDLEY_TI_CLPRU_VERSION_CHECK(major, minor, patch) (0)
436
+ #endif
437
+
438
+ #if defined(HEDLEY_CRAY_VERSION)
439
+ #undef HEDLEY_CRAY_VERSION
440
+ #endif
441
+ #if defined(_CRAYC)
442
+ #if defined(_RELEASE_PATCHLEVEL)
443
+ #define HEDLEY_CRAY_VERSION \
444
+ HEDLEY_VERSION_ENCODE(_RELEASE_MAJOR, _RELEASE_MINOR, \
445
+ _RELEASE_PATCHLEVEL)
446
+ #else
447
+ #define HEDLEY_CRAY_VERSION \
448
+ HEDLEY_VERSION_ENCODE(_RELEASE_MAJOR, _RELEASE_MINOR, 0)
449
+ #endif
450
+ #endif
451
+
452
+ #if defined(HEDLEY_CRAY_VERSION_CHECK)
453
+ #undef HEDLEY_CRAY_VERSION_CHECK
454
+ #endif
455
+ #if defined(HEDLEY_CRAY_VERSION)
456
+ #define HEDLEY_CRAY_VERSION_CHECK(major, minor, patch) \
457
+ (HEDLEY_CRAY_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch))
458
+ #else
459
+ #define HEDLEY_CRAY_VERSION_CHECK(major, minor, patch) (0)
460
+ #endif
461
+
462
+ #if defined(HEDLEY_IAR_VERSION)
463
+ #undef HEDLEY_IAR_VERSION
464
+ #endif
465
+ #if defined(__IAR_SYSTEMS_ICC__)
466
+ #if __VER__ > 1000
467
+ #define HEDLEY_IAR_VERSION \
468
+ HEDLEY_VERSION_ENCODE((__VER__ / 1000000), ((__VER__ / 1000) % 1000), \
469
+ (__VER__ % 1000))
470
+ #else
471
+ #define HEDLEY_IAR_VERSION HEDLEY_VERSION_ENCODE(VER / 100, __VER__ % 100, 0)
472
+ #endif
473
+ #endif
474
+
475
+ #if defined(HEDLEY_IAR_VERSION_CHECK)
476
+ #undef HEDLEY_IAR_VERSION_CHECK
477
+ #endif
478
+ #if defined(HEDLEY_IAR_VERSION)
479
+ #define HEDLEY_IAR_VERSION_CHECK(major, minor, patch) \
480
+ (HEDLEY_IAR_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch))
481
+ #else
482
+ #define HEDLEY_IAR_VERSION_CHECK(major, minor, patch) (0)
483
+ #endif
484
+
485
+ #if defined(HEDLEY_TINYC_VERSION)
486
+ #undef HEDLEY_TINYC_VERSION
487
+ #endif
488
+ #if defined(__TINYC__)
489
+ #define HEDLEY_TINYC_VERSION \
490
+ HEDLEY_VERSION_ENCODE(__TINYC__ / 1000, (__TINYC__ / 100) % 10, \
491
+ __TINYC__ % 100)
492
+ #endif
493
+
494
+ #if defined(HEDLEY_TINYC_VERSION_CHECK)
495
+ #undef HEDLEY_TINYC_VERSION_CHECK
496
+ #endif
497
+ #if defined(HEDLEY_TINYC_VERSION)
498
+ #define HEDLEY_TINYC_VERSION_CHECK(major, minor, patch) \
499
+ (HEDLEY_TINYC_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch))
500
+ #else
501
+ #define HEDLEY_TINYC_VERSION_CHECK(major, minor, patch) (0)
502
+ #endif
503
+
504
+ #if defined(HEDLEY_DMC_VERSION)
505
+ #undef HEDLEY_DMC_VERSION
506
+ #endif
507
+ #if defined(__DMC__)
508
+ #define HEDLEY_DMC_VERSION \
509
+ HEDLEY_VERSION_ENCODE(__DMC__ >> 8, (__DMC__ >> 4) & 0xf, __DMC__ & 0xf)
510
+ #endif
511
+
512
+ #if defined(HEDLEY_DMC_VERSION_CHECK)
513
+ #undef HEDLEY_DMC_VERSION_CHECK
514
+ #endif
515
+ #if defined(HEDLEY_DMC_VERSION)
516
+ #define HEDLEY_DMC_VERSION_CHECK(major, minor, patch) \
517
+ (HEDLEY_DMC_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch))
518
+ #else
519
+ #define HEDLEY_DMC_VERSION_CHECK(major, minor, patch) (0)
520
+ #endif
521
+
522
+ #if defined(HEDLEY_COMPCERT_VERSION)
523
+ #undef HEDLEY_COMPCERT_VERSION
524
+ #endif
525
+ #if defined(__COMPCERT_VERSION__)
526
+ #define HEDLEY_COMPCERT_VERSION \
527
+ HEDLEY_VERSION_ENCODE(__COMPCERT_VERSION__ / 10000, \
528
+ (__COMPCERT_VERSION__ / 100) % 100, \
529
+ __COMPCERT_VERSION__ % 100)
530
+ #endif
531
+
532
+ #if defined(HEDLEY_COMPCERT_VERSION_CHECK)
533
+ #undef HEDLEY_COMPCERT_VERSION_CHECK
534
+ #endif
535
+ #if defined(HEDLEY_COMPCERT_VERSION)
536
+ #define HEDLEY_COMPCERT_VERSION_CHECK(major, minor, patch) \
537
+ (HEDLEY_COMPCERT_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch))
538
+ #else
539
+ #define HEDLEY_COMPCERT_VERSION_CHECK(major, minor, patch) (0)
540
+ #endif
541
+
542
+ #if defined(HEDLEY_PELLES_VERSION)
543
+ #undef HEDLEY_PELLES_VERSION
544
+ #endif
545
+ #if defined(__POCC__)
546
+ #define HEDLEY_PELLES_VERSION \
547
+ HEDLEY_VERSION_ENCODE(__POCC__ / 100, __POCC__ % 100, 0)
548
+ #endif
549
+
550
+ #if defined(HEDLEY_PELLES_VERSION_CHECK)
551
+ #undef HEDLEY_PELLES_VERSION_CHECK
552
+ #endif
553
+ #if defined(HEDLEY_PELLES_VERSION)
554
+ #define HEDLEY_PELLES_VERSION_CHECK(major, minor, patch) \
555
+ (HEDLEY_PELLES_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch))
556
+ #else
557
+ #define HEDLEY_PELLES_VERSION_CHECK(major, minor, patch) (0)
558
+ #endif
559
+
560
+ #if defined(HEDLEY_GCC_VERSION)
561
+ #undef HEDLEY_GCC_VERSION
562
+ #endif
563
+ #if defined(HEDLEY_GNUC_VERSION) && !defined(__clang__) && \
564
+ !defined(HEDLEY_INTEL_VERSION) && !defined(HEDLEY_PGI_VERSION) && \
565
+ !defined(HEDLEY_ARM_VERSION) && !defined(HEDLEY_TI_VERSION) && \
566
+ !defined(HEDLEY_TI_ARMCL_VERSION) && \
567
+ !defined(HEDLEY_TI_CL430_VERSION) && \
568
+ !defined(HEDLEY_TI_CL2000_VERSION) && \
569
+ !defined(HEDLEY_TI_CL6X_VERSION) && \
570
+ !defined(HEDLEY_TI_CL7X_VERSION) && \
571
+ !defined(HEDLEY_TI_CLPRU_VERSION) && !defined(__COMPCERT__)
572
+ #define HEDLEY_GCC_VERSION HEDLEY_GNUC_VERSION
573
+ #endif
574
+
575
+ #if defined(HEDLEY_GCC_VERSION_CHECK)
576
+ #undef HEDLEY_GCC_VERSION_CHECK
577
+ #endif
578
+ #if defined(HEDLEY_GCC_VERSION)
579
+ #define HEDLEY_GCC_VERSION_CHECK(major, minor, patch) \
580
+ (HEDLEY_GCC_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch))
581
+ #else
582
+ #define HEDLEY_GCC_VERSION_CHECK(major, minor, patch) (0)
583
+ #endif
584
+
585
+ #if defined(HEDLEY_HAS_ATTRIBUTE)
586
+ #undef HEDLEY_HAS_ATTRIBUTE
587
+ #endif
588
+ #if defined(__has_attribute)
589
+ #define HEDLEY_HAS_ATTRIBUTE(attribute) __has_attribute(attribute)
590
+ #else
591
+ #define HEDLEY_HAS_ATTRIBUTE(attribute) (0)
592
+ #endif
593
+
594
+ #if defined(HEDLEY_GNUC_HAS_ATTRIBUTE)
595
+ #undef HEDLEY_GNUC_HAS_ATTRIBUTE
596
+ #endif
597
+ #if defined(__has_attribute)
598
+ #define HEDLEY_GNUC_HAS_ATTRIBUTE(attribute, major, minor, patch) \
599
+ __has_attribute(attribute)
600
+ #else
601
+ #define HEDLEY_GNUC_HAS_ATTRIBUTE(attribute, major, minor, patch) \
602
+ HEDLEY_GNUC_VERSION_CHECK(major, minor, patch)
603
+ #endif
604
+
605
+ #if defined(HEDLEY_GCC_HAS_ATTRIBUTE)
606
+ #undef HEDLEY_GCC_HAS_ATTRIBUTE
607
+ #endif
608
+ #if defined(__has_attribute)
609
+ #define HEDLEY_GCC_HAS_ATTRIBUTE(attribute, major, minor, patch) \
610
+ __has_attribute(attribute)
611
+ #else
612
+ #define HEDLEY_GCC_HAS_ATTRIBUTE(attribute, major, minor, patch) \
613
+ HEDLEY_GCC_VERSION_CHECK(major, minor, patch)
614
+ #endif
615
+
616
+ #if defined(HEDLEY_HAS_CPP_ATTRIBUTE)
617
+ #undef HEDLEY_HAS_CPP_ATTRIBUTE
618
+ #endif
619
+ #if defined(__has_cpp_attribute) && defined(__cplusplus) && \
620
+ (!defined(HEDLEY_SUNPRO_VERSION) || \
621
+ HEDLEY_SUNPRO_VERSION_CHECK(5, 15, 0))
622
+ #define HEDLEY_HAS_CPP_ATTRIBUTE(attribute) __has_cpp_attribute(attribute)
623
+ #else
624
+ #define HEDLEY_HAS_CPP_ATTRIBUTE(attribute) (0)
625
+ #endif
626
+
627
+ #if defined(HEDLEY_HAS_CPP_ATTRIBUTE_NS)
628
+ #undef HEDLEY_HAS_CPP_ATTRIBUTE_NS
629
+ #endif
630
+ #if !defined(__cplusplus) || !defined(__has_cpp_attribute)
631
+ #define HEDLEY_HAS_CPP_ATTRIBUTE_NS(ns, attribute) (0)
632
+ #elif !defined(HEDLEY_PGI_VERSION) && !defined(HEDLEY_IAR_VERSION) && \
633
+ (!defined(HEDLEY_SUNPRO_VERSION) || \
634
+ HEDLEY_SUNPRO_VERSION_CHECK(5, 15, 0)) && \
635
+ (!defined(HEDLEY_MSVC_VERSION) || \
636
+ HEDLEY_MSVC_VERSION_CHECK(19, 20, 0))
637
+ #define HEDLEY_HAS_CPP_ATTRIBUTE_NS(ns, attribute) \
638
+ HEDLEY_HAS_CPP_ATTRIBUTE(ns::attribute)
639
+ #else
640
+ #define HEDLEY_HAS_CPP_ATTRIBUTE_NS(ns, attribute) (0)
641
+ #endif
642
+
643
+ #if defined(HEDLEY_GNUC_HAS_CPP_ATTRIBUTE)
644
+ #undef HEDLEY_GNUC_HAS_CPP_ATTRIBUTE
645
+ #endif
646
+ #if defined(__has_cpp_attribute) && defined(__cplusplus)
647
+ #define HEDLEY_GNUC_HAS_CPP_ATTRIBUTE(attribute, major, minor, patch) \
648
+ __has_cpp_attribute(attribute)
649
+ #else
650
+ #define HEDLEY_GNUC_HAS_CPP_ATTRIBUTE(attribute, major, minor, patch) \
651
+ HEDLEY_GNUC_VERSION_CHECK(major, minor, patch)
652
+ #endif
653
+
654
+ #if defined(HEDLEY_GCC_HAS_CPP_ATTRIBUTE)
655
+ #undef HEDLEY_GCC_HAS_CPP_ATTRIBUTE
656
+ #endif
657
+ #if defined(__has_cpp_attribute) && defined(__cplusplus)
658
+ #define HEDLEY_GCC_HAS_CPP_ATTRIBUTE(attribute, major, minor, patch) \
659
+ __has_cpp_attribute(attribute)
660
+ #else
661
+ #define HEDLEY_GCC_HAS_CPP_ATTRIBUTE(attribute, major, minor, patch) \
662
+ HEDLEY_GCC_VERSION_CHECK(major, minor, patch)
663
+ #endif
664
+
665
+ #if defined(HEDLEY_HAS_BUILTIN)
666
+ #undef HEDLEY_HAS_BUILTIN
667
+ #endif
668
+ #if defined(__has_builtin)
669
+ #define HEDLEY_HAS_BUILTIN(builtin) __has_builtin(builtin)
670
+ #else
671
+ #define HEDLEY_HAS_BUILTIN(builtin) (0)
672
+ #endif
673
+
674
+ #if defined(HEDLEY_GNUC_HAS_BUILTIN)
675
+ #undef HEDLEY_GNUC_HAS_BUILTIN
676
+ #endif
677
+ #if defined(__has_builtin)
678
+ #define HEDLEY_GNUC_HAS_BUILTIN(builtin, major, minor, patch) \
679
+ __has_builtin(builtin)
680
+ #else
681
+ #define HEDLEY_GNUC_HAS_BUILTIN(builtin, major, minor, patch) \
682
+ HEDLEY_GNUC_VERSION_CHECK(major, minor, patch)
683
+ #endif
684
+
685
+ #if defined(HEDLEY_GCC_HAS_BUILTIN)
686
+ #undef HEDLEY_GCC_HAS_BUILTIN
687
+ #endif
688
+ #if defined(__has_builtin)
689
+ #define HEDLEY_GCC_HAS_BUILTIN(builtin, major, minor, patch) \
690
+ __has_builtin(builtin)
691
+ #else
692
+ #define HEDLEY_GCC_HAS_BUILTIN(builtin, major, minor, patch) \
693
+ HEDLEY_GCC_VERSION_CHECK(major, minor, patch)
694
+ #endif
695
+
696
+ #if defined(HEDLEY_HAS_FEATURE)
697
+ #undef HEDLEY_HAS_FEATURE
698
+ #endif
699
+ #if defined(__has_feature)
700
+ #define HEDLEY_HAS_FEATURE(feature) __has_feature(feature)
701
+ #else
702
+ #define HEDLEY_HAS_FEATURE(feature) (0)
703
+ #endif
704
+
705
+ #if defined(HEDLEY_GNUC_HAS_FEATURE)
706
+ #undef HEDLEY_GNUC_HAS_FEATURE
707
+ #endif
708
+ #if defined(__has_feature)
709
+ #define HEDLEY_GNUC_HAS_FEATURE(feature, major, minor, patch) \
710
+ __has_feature(feature)
711
+ #else
712
+ #define HEDLEY_GNUC_HAS_FEATURE(feature, major, minor, patch) \
713
+ HEDLEY_GNUC_VERSION_CHECK(major, minor, patch)
714
+ #endif
715
+
716
+ #if defined(HEDLEY_GCC_HAS_FEATURE)
717
+ #undef HEDLEY_GCC_HAS_FEATURE
718
+ #endif
719
+ #if defined(__has_feature)
720
+ #define HEDLEY_GCC_HAS_FEATURE(feature, major, minor, patch) \
721
+ __has_feature(feature)
722
+ #else
723
+ #define HEDLEY_GCC_HAS_FEATURE(feature, major, minor, patch) \
724
+ HEDLEY_GCC_VERSION_CHECK(major, minor, patch)
725
+ #endif
726
+
727
+ #if defined(HEDLEY_HAS_EXTENSION)
728
+ #undef HEDLEY_HAS_EXTENSION
729
+ #endif
730
+ #if defined(__has_extension)
731
+ #define HEDLEY_HAS_EXTENSION(extension) __has_extension(extension)
732
+ #else
733
+ #define HEDLEY_HAS_EXTENSION(extension) (0)
734
+ #endif
735
+
736
+ #if defined(HEDLEY_GNUC_HAS_EXTENSION)
737
+ #undef HEDLEY_GNUC_HAS_EXTENSION
738
+ #endif
739
+ #if defined(__has_extension)
740
+ #define HEDLEY_GNUC_HAS_EXTENSION(extension, major, minor, patch) \
741
+ __has_extension(extension)
742
+ #else
743
+ #define HEDLEY_GNUC_HAS_EXTENSION(extension, major, minor, patch) \
744
+ HEDLEY_GNUC_VERSION_CHECK(major, minor, patch)
745
+ #endif
746
+
747
+ #if defined(HEDLEY_GCC_HAS_EXTENSION)
748
+ #undef HEDLEY_GCC_HAS_EXTENSION
749
+ #endif
750
+ #if defined(__has_extension)
751
+ #define HEDLEY_GCC_HAS_EXTENSION(extension, major, minor, patch) \
752
+ __has_extension(extension)
753
+ #else
754
+ #define HEDLEY_GCC_HAS_EXTENSION(extension, major, minor, patch) \
755
+ HEDLEY_GCC_VERSION_CHECK(major, minor, patch)
756
+ #endif
757
+
758
+ #if defined(HEDLEY_HAS_DECLSPEC_ATTRIBUTE)
759
+ #undef HEDLEY_HAS_DECLSPEC_ATTRIBUTE
760
+ #endif
761
+ #if defined(__has_declspec_attribute)
762
+ #define HEDLEY_HAS_DECLSPEC_ATTRIBUTE(attribute) \
763
+ __has_declspec_attribute(attribute)
764
+ #else
765
+ #define HEDLEY_HAS_DECLSPEC_ATTRIBUTE(attribute) (0)
766
+ #endif
767
+
768
+ #if defined(HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE)
769
+ #undef HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE
770
+ #endif
771
+ #if defined(__has_declspec_attribute)
772
+ #define HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE(attribute, major, minor, patch) \
773
+ __has_declspec_attribute(attribute)
774
+ #else
775
+ #define HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE(attribute, major, minor, patch) \
776
+ HEDLEY_GNUC_VERSION_CHECK(major, minor, patch)
777
+ #endif
778
+
779
+ #if defined(HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE)
780
+ #undef HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE
781
+ #endif
782
+ #if defined(__has_declspec_attribute)
783
+ #define HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE(attribute, major, minor, patch) \
784
+ __has_declspec_attribute(attribute)
785
+ #else
786
+ #define HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE(attribute, major, minor, patch) \
787
+ HEDLEY_GCC_VERSION_CHECK(major, minor, patch)
788
+ #endif
789
+
790
+ #if defined(HEDLEY_HAS_WARNING)
791
+ #undef HEDLEY_HAS_WARNING
792
+ #endif
793
+ #if defined(__has_warning)
794
+ #define HEDLEY_HAS_WARNING(warning) __has_warning(warning)
795
+ #else
796
+ #define HEDLEY_HAS_WARNING(warning) (0)
797
+ #endif
798
+
799
+ #if defined(HEDLEY_GNUC_HAS_WARNING)
800
+ #undef HEDLEY_GNUC_HAS_WARNING
801
+ #endif
802
+ #if defined(__has_warning)
803
+ #define HEDLEY_GNUC_HAS_WARNING(warning, major, minor, patch) \
804
+ __has_warning(warning)
805
+ #else
806
+ #define HEDLEY_GNUC_HAS_WARNING(warning, major, minor, patch) \
807
+ HEDLEY_GNUC_VERSION_CHECK(major, minor, patch)
808
+ #endif
809
+
810
+ #if defined(HEDLEY_GCC_HAS_WARNING)
811
+ #undef HEDLEY_GCC_HAS_WARNING
812
+ #endif
813
+ #if defined(__has_warning)
814
+ #define HEDLEY_GCC_HAS_WARNING(warning, major, minor, patch) \
815
+ __has_warning(warning)
816
+ #else
817
+ #define HEDLEY_GCC_HAS_WARNING(warning, major, minor, patch) \
818
+ HEDLEY_GCC_VERSION_CHECK(major, minor, patch)
819
+ #endif
820
+
821
+ #if (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) || \
822
+ defined(__clang__) || HEDLEY_GCC_VERSION_CHECK(3, 0, 0) || \
823
+ HEDLEY_INTEL_VERSION_CHECK(13, 0, 0) || \
824
+ HEDLEY_IAR_VERSION_CHECK(8, 0, 0) || \
825
+ HEDLEY_PGI_VERSION_CHECK(18, 4, 0) || \
826
+ HEDLEY_ARM_VERSION_CHECK(4, 1, 0) || \
827
+ HEDLEY_TI_VERSION_CHECK(15, 12, 0) || \
828
+ HEDLEY_TI_ARMCL_VERSION_CHECK(4, 7, 0) || \
829
+ HEDLEY_TI_CL430_VERSION_CHECK(2, 0, 1) || \
830
+ HEDLEY_TI_CL2000_VERSION_CHECK(6, 1, 0) || \
831
+ HEDLEY_TI_CL6X_VERSION_CHECK(7, 0, 0) || \
832
+ HEDLEY_TI_CL7X_VERSION_CHECK(1, 2, 0) || \
833
+ HEDLEY_TI_CLPRU_VERSION_CHECK(2, 1, 0) || \
834
+ HEDLEY_CRAY_VERSION_CHECK(5, 0, 0) || \
835
+ HEDLEY_TINYC_VERSION_CHECK(0, 9, 17) || \
836
+ HEDLEY_SUNPRO_VERSION_CHECK(8, 0, 0) || \
837
+ (HEDLEY_IBM_VERSION_CHECK(10, 1, 0) && defined(__C99_PRAGMA_OPERATOR))
838
+ #define HEDLEY_PRAGMA(value) _Pragma(#value)
839
+ #elif HEDLEY_MSVC_VERSION_CHECK(15, 0, 0)
840
+ #define HEDLEY_PRAGMA(value) __pragma(value)
841
+ #else
842
+ #define HEDLEY_PRAGMA(value)
843
+ #endif
844
+
845
+ #if defined(HEDLEY_DIAGNOSTIC_PUSH)
846
+ #undef HEDLEY_DIAGNOSTIC_PUSH
847
+ #endif
848
+ #if defined(HEDLEY_DIAGNOSTIC_POP)
849
+ #undef HEDLEY_DIAGNOSTIC_POP
850
+ #endif
851
+ #if defined(__clang__)
852
+ #define HEDLEY_DIAGNOSTIC_PUSH _Pragma("clang diagnostic push")
853
+ #define HEDLEY_DIAGNOSTIC_POP _Pragma("clang diagnostic pop")
854
+ #elif HEDLEY_INTEL_VERSION_CHECK(13, 0, 0)
855
+ #define HEDLEY_DIAGNOSTIC_PUSH _Pragma("warning(push)")
856
+ #define HEDLEY_DIAGNOSTIC_POP _Pragma("warning(pop)")
857
+ #elif HEDLEY_GCC_VERSION_CHECK(4, 6, 0)
858
+ #define HEDLEY_DIAGNOSTIC_PUSH _Pragma("GCC diagnostic push")
859
+ #define HEDLEY_DIAGNOSTIC_POP _Pragma("GCC diagnostic pop")
860
+ #elif HEDLEY_MSVC_VERSION_CHECK(15, 0, 0) || \
861
+ HEDLEY_INTEL_CL_VERSION_CHECK(2021, 1, 0)
862
+ #define HEDLEY_DIAGNOSTIC_PUSH __pragma(warning(push))
863
+ #define HEDLEY_DIAGNOSTIC_POP __pragma(warning(pop))
864
+ #elif HEDLEY_ARM_VERSION_CHECK(5, 6, 0)
865
+ #define HEDLEY_DIAGNOSTIC_PUSH _Pragma("push")
866
+ #define HEDLEY_DIAGNOSTIC_POP _Pragma("pop")
867
+ #elif HEDLEY_TI_VERSION_CHECK(15, 12, 0) || \
868
+ HEDLEY_TI_ARMCL_VERSION_CHECK(5, 2, 0) || \
869
+ HEDLEY_TI_CL430_VERSION_CHECK(4, 4, 0) || \
870
+ HEDLEY_TI_CL6X_VERSION_CHECK(8, 1, 0) || \
871
+ HEDLEY_TI_CL7X_VERSION_CHECK(1, 2, 0) || \
872
+ HEDLEY_TI_CLPRU_VERSION_CHECK(2, 1, 0)
873
+ #define HEDLEY_DIAGNOSTIC_PUSH _Pragma("diag_push")
874
+ #define HEDLEY_DIAGNOSTIC_POP _Pragma("diag_pop")
875
+ #elif HEDLEY_PELLES_VERSION_CHECK(2, 90, 0)
876
+ #define HEDLEY_DIAGNOSTIC_PUSH _Pragma("warning(push)")
877
+ #define HEDLEY_DIAGNOSTIC_POP _Pragma("warning(pop)")
878
+ #else
879
+ #define HEDLEY_DIAGNOSTIC_PUSH
880
+ #define HEDLEY_DIAGNOSTIC_POP
881
+ #endif
882
+
883
+ /* HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_ is for
884
+ HEDLEY INTERNAL USE ONLY. API subject to change without notice. */
885
+ #if defined(HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_)
886
+ #undef HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_
887
+ #endif
888
+ #if defined(__cplusplus)
889
+ #if HEDLEY_HAS_WARNING("-Wc++98-compat")
890
+ #if HEDLEY_HAS_WARNING("-Wc++17-extensions")
891
+ #if HEDLEY_HAS_WARNING("-Wc++1z-extensions")
892
+ #define HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(xpr) \
893
+ HEDLEY_DIAGNOSTIC_PUSH \
894
+ _Pragma("clang diagnostic ignored \"-Wc++98-compat\"") _Pragma( \
895
+ "clang diagnostic ignored \"-Wc++17-extensions\"") \
896
+ _Pragma("clang diagnostic ignored \"-Wc++1z-extensions\"") \
897
+ xpr HEDLEY_DIAGNOSTIC_POP
898
+ #else
899
+ #define HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(xpr) \
900
+ HEDLEY_DIAGNOSTIC_PUSH \
901
+ _Pragma("clang diagnostic ignored \"-Wc++98-compat\"") \
902
+ _Pragma("clang diagnostic ignored \"-Wc++17-extensions\"") \
903
+ xpr HEDLEY_DIAGNOSTIC_POP
904
+ #endif
905
+ #else
906
+ #define HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(xpr) \
907
+ HEDLEY_DIAGNOSTIC_PUSH \
908
+ _Pragma("clang diagnostic ignored \"-Wc++98-compat\"") \
909
+ xpr HEDLEY_DIAGNOSTIC_POP
910
+ #endif
911
+ #endif
912
+ #endif
913
+ #if !defined(HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_)
914
+ #define HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(x) x
915
+ #endif
916
+
917
+ #if defined(HEDLEY_CONST_CAST)
918
+ #undef HEDLEY_CONST_CAST
919
+ #endif
920
+ #if defined(__cplusplus)
921
+ #define HEDLEY_CONST_CAST(T, expr) (const_cast<T>(expr))
922
+ #elif HEDLEY_HAS_WARNING("-Wcast-qual") || \
923
+ HEDLEY_GCC_VERSION_CHECK(4, 6, 0) || \
924
+ HEDLEY_INTEL_VERSION_CHECK(13, 0, 0)
925
+ #define HEDLEY_CONST_CAST(T, expr) \
926
+ (__extension__({ \
927
+ HEDLEY_DIAGNOSTIC_PUSH \
928
+ HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL((T)(expr)); \
929
+ HEDLEY_DIAGNOSTIC_POP \
930
+ }))
931
+ #else
932
+ #define HEDLEY_CONST_CAST(T, expr) ((T)(expr))
933
+ #endif
934
+
935
+ #if defined(HEDLEY_REINTERPRET_CAST)
936
+ #undef HEDLEY_REINTERPRET_CAST
937
+ #endif
938
+ #if defined(__cplusplus)
939
+ #define HEDLEY_REINTERPRET_CAST(T, expr) (reinterpret_cast<T>(expr))
940
+ #else
941
+ #define HEDLEY_REINTERPRET_CAST(T, expr) ((T)(expr))
942
+ #endif
943
+
944
+ #if defined(HEDLEY_STATIC_CAST)
945
+ #undef HEDLEY_STATIC_CAST
946
+ #endif
947
+ #if defined(__cplusplus)
948
+ #define HEDLEY_STATIC_CAST(T, expr) (static_cast<T>(expr))
949
+ #else
950
+ #define HEDLEY_STATIC_CAST(T, expr) ((T)(expr))
951
+ #endif
952
+
953
+ #if defined(HEDLEY_CPP_CAST)
954
+ #undef HEDLEY_CPP_CAST
955
+ #endif
956
+ #if defined(__cplusplus)
957
+ #if HEDLEY_HAS_WARNING("-Wold-style-cast")
958
+ #define HEDLEY_CPP_CAST(T, expr) \
959
+ HEDLEY_DIAGNOSTIC_PUSH \
960
+ _Pragma("clang diagnostic ignored \"-Wold-style-cast\"")((T)(expr)) \
961
+ HEDLEY_DIAGNOSTIC_POP
962
+ #elif HEDLEY_IAR_VERSION_CHECK(8, 3, 0)
963
+ #define HEDLEY_CPP_CAST(T, expr) \
964
+ HEDLEY_DIAGNOSTIC_PUSH \
965
+ _Pragma("diag_suppress=Pe137") HEDLEY_DIAGNOSTIC_POP
966
+ #else
967
+ #define HEDLEY_CPP_CAST(T, expr) ((T)(expr))
968
+ #endif
969
+ #else
970
+ #define HEDLEY_CPP_CAST(T, expr) (expr)
971
+ #endif
972
+
973
+ #if defined(HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED)
974
+ #undef HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED
975
+ #endif
976
+ #if HEDLEY_HAS_WARNING("-Wdeprecated-declarations")
977
+ #define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED \
978
+ _Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"")
979
+ #elif HEDLEY_INTEL_VERSION_CHECK(13, 0, 0)
980
+ #define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED \
981
+ _Pragma("warning(disable:1478 1786)")
982
+ #elif HEDLEY_INTEL_CL_VERSION_CHECK(2021, 1, 0)
983
+ #define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED \
984
+ __pragma(warning(disable : 1478 1786))
985
+ #elif HEDLEY_PGI_VERSION_CHECK(20, 7, 0)
986
+ #define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED \
987
+ _Pragma("diag_suppress 1215,1216,1444,1445")
988
+ #elif HEDLEY_PGI_VERSION_CHECK(17, 10, 0)
989
+ #define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress 1215,1444")
990
+ #elif HEDLEY_GCC_VERSION_CHECK(4, 3, 0)
991
+ #define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED \
992
+ _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
993
+ #elif HEDLEY_MSVC_VERSION_CHECK(15, 0, 0)
994
+ #define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED __pragma(warning(disable : 4996))
995
+ #elif HEDLEY_TI_VERSION_CHECK(15, 12, 0) || \
996
+ (HEDLEY_TI_ARMCL_VERSION_CHECK(4, 8, 0) && \
997
+ defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
998
+ HEDLEY_TI_ARMCL_VERSION_CHECK(5, 2, 0) || \
999
+ (HEDLEY_TI_CL2000_VERSION_CHECK(6, 0, 0) && \
1000
+ defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1001
+ HEDLEY_TI_CL2000_VERSION_CHECK(6, 4, 0) || \
1002
+ (HEDLEY_TI_CL430_VERSION_CHECK(4, 0, 0) && \
1003
+ defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1004
+ HEDLEY_TI_CL430_VERSION_CHECK(4, 3, 0) || \
1005
+ (HEDLEY_TI_CL6X_VERSION_CHECK(7, 2, 0) && \
1006
+ defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1007
+ HEDLEY_TI_CL6X_VERSION_CHECK(7, 5, 0) || \
1008
+ HEDLEY_TI_CL7X_VERSION_CHECK(1, 2, 0) || \
1009
+ HEDLEY_TI_CLPRU_VERSION_CHECK(2, 1, 0)
1010
+ #define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress 1291,1718")
1011
+ #elif HEDLEY_SUNPRO_VERSION_CHECK(5, 13, 0) && !defined(__cplusplus)
1012
+ #define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED \
1013
+ _Pragma("error_messages(off,E_DEPRECATED_ATT,E_DEPRECATED_ATT_MESS)")
1014
+ #elif HEDLEY_SUNPRO_VERSION_CHECK(5, 13, 0) && defined(__cplusplus)
1015
+ #define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED \
1016
+ _Pragma("error_messages(off,symdeprecated,symdeprecated2)")
1017
+ #elif HEDLEY_IAR_VERSION_CHECK(8, 0, 0)
1018
+ #define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED \
1019
+ _Pragma("diag_suppress=Pe1444,Pe1215")
1020
+ #elif HEDLEY_PELLES_VERSION_CHECK(2, 90, 0)
1021
+ #define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("warn(disable:2241)")
1022
+ #else
1023
+ #define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED
1024
+ #endif
1025
+
1026
+ #if defined(HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS)
1027
+ #undef HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS
1028
+ #endif
1029
+ #if HEDLEY_HAS_WARNING("-Wunknown-pragmas")
1030
+ #define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS \
1031
+ _Pragma("clang diagnostic ignored \"-Wunknown-pragmas\"")
1032
+ #elif HEDLEY_INTEL_VERSION_CHECK(13, 0, 0)
1033
+ #define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS \
1034
+ _Pragma("warning(disable:161)")
1035
+ #elif HEDLEY_INTEL_CL_VERSION_CHECK(2021, 1, 0)
1036
+ #define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS \
1037
+ __pragma(warning(disable : 161))
1038
+ #elif HEDLEY_PGI_VERSION_CHECK(17, 10, 0)
1039
+ #define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress 1675")
1040
+ #elif HEDLEY_GCC_VERSION_CHECK(4, 3, 0)
1041
+ #define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS \
1042
+ _Pragma("GCC diagnostic ignored \"-Wunknown-pragmas\"")
1043
+ #elif HEDLEY_MSVC_VERSION_CHECK(15, 0, 0)
1044
+ #define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS \
1045
+ __pragma(warning(disable : 4068))
1046
+ #elif HEDLEY_TI_VERSION_CHECK(16, 9, 0) || \
1047
+ HEDLEY_TI_CL6X_VERSION_CHECK(8, 0, 0) || \
1048
+ HEDLEY_TI_CL7X_VERSION_CHECK(1, 2, 0) || \
1049
+ HEDLEY_TI_CLPRU_VERSION_CHECK(2, 3, 0)
1050
+ #define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress 163")
1051
+ #elif HEDLEY_TI_CL6X_VERSION_CHECK(8, 0, 0)
1052
+ #define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress 163")
1053
+ #elif HEDLEY_IAR_VERSION_CHECK(8, 0, 0)
1054
+ #define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress=Pe161")
1055
+ #else
1056
+ #define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS
1057
+ #endif
1058
+
1059
+ #if defined(HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES)
1060
+ #undef HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES
1061
+ #endif
1062
+ #if HEDLEY_HAS_WARNING("-Wunknown-attributes")
1063
+ #define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES \
1064
+ _Pragma("clang diagnostic ignored \"-Wunknown-attributes\"")
1065
+ #elif HEDLEY_GCC_VERSION_CHECK(4, 6, 0)
1066
+ #define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES \
1067
+ _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
1068
+ #elif HEDLEY_INTEL_VERSION_CHECK(17, 0, 0)
1069
+ #define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES \
1070
+ _Pragma("warning(disable:1292)")
1071
+ #elif HEDLEY_INTEL_CL_VERSION_CHECK(2021, 1, 0)
1072
+ #define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES \
1073
+ __pragma(warning(disable : 1292))
1074
+ #elif HEDLEY_MSVC_VERSION_CHECK(19, 0, 0)
1075
+ #define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES \
1076
+ __pragma(warning(disable : 5030))
1077
+ #elif HEDLEY_PGI_VERSION_CHECK(20, 7, 0)
1078
+ #define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES \
1079
+ _Pragma("diag_suppress 1097,1098")
1080
+ #elif HEDLEY_PGI_VERSION_CHECK(17, 10, 0)
1081
+ #define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES \
1082
+ _Pragma("diag_suppress 1097")
1083
+ #elif HEDLEY_SUNPRO_VERSION_CHECK(5, 14, 0) && defined(__cplusplus)
1084
+ #define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES \
1085
+ _Pragma("error_messages(off,attrskipunsup)")
1086
+ #elif HEDLEY_TI_VERSION_CHECK(18, 1, 0) || \
1087
+ HEDLEY_TI_CL6X_VERSION_CHECK(8, 3, 0) || \
1088
+ HEDLEY_TI_CL7X_VERSION_CHECK(1, 2, 0)
1089
+ #define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES \
1090
+ _Pragma("diag_suppress 1173")
1091
+ #elif HEDLEY_IAR_VERSION_CHECK(8, 0, 0)
1092
+ #define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES \
1093
+ _Pragma("diag_suppress=Pe1097")
1094
+ #else
1095
+ #define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES
1096
+ #endif
1097
+
1098
+ #if defined(HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL)
1099
+ #undef HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL
1100
+ #endif
1101
+ #if HEDLEY_HAS_WARNING("-Wcast-qual")
1102
+ #define HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL \
1103
+ _Pragma("clang diagnostic ignored \"-Wcast-qual\"")
1104
+ #elif HEDLEY_INTEL_VERSION_CHECK(13, 0, 0)
1105
+ #define HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL \
1106
+ _Pragma("warning(disable:2203 2331)")
1107
+ #elif HEDLEY_GCC_VERSION_CHECK(3, 0, 0)
1108
+ #define HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL \
1109
+ _Pragma("GCC diagnostic ignored \"-Wcast-qual\"")
1110
+ #else
1111
+ #define HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL
1112
+ #endif
1113
+
1114
+ #if defined(HEDLEY_DEPRECATED)
1115
+ #undef HEDLEY_DEPRECATED
1116
+ #endif
1117
+ #if defined(HEDLEY_DEPRECATED_FOR)
1118
+ #undef HEDLEY_DEPRECATED_FOR
1119
+ #endif
1120
+ #if HEDLEY_MSVC_VERSION_CHECK(14, 0, 0) || \
1121
+ HEDLEY_INTEL_CL_VERSION_CHECK(2021, 1, 0)
1122
+ #define HEDLEY_DEPRECATED(since) __declspec(deprecated("Since " #since))
1123
+ #define HEDLEY_DEPRECATED_FOR(since, replacement) \
1124
+ __declspec(deprecated("Since " #since "; use " #replacement))
1125
+ #elif HEDLEY_HAS_EXTENSION(attribute_deprecated_with_message) || \
1126
+ HEDLEY_GCC_VERSION_CHECK(4, 5, 0) || \
1127
+ HEDLEY_INTEL_VERSION_CHECK(13, 0, 0) || \
1128
+ HEDLEY_ARM_VERSION_CHECK(5, 6, 0) || \
1129
+ HEDLEY_SUNPRO_VERSION_CHECK(5, 13, 0) || \
1130
+ HEDLEY_PGI_VERSION_CHECK(17, 10, 0) || \
1131
+ HEDLEY_TI_VERSION_CHECK(18, 1, 0) || \
1132
+ HEDLEY_TI_ARMCL_VERSION_CHECK(18, 1, 0) || \
1133
+ HEDLEY_TI_CL6X_VERSION_CHECK(8, 3, 0) || \
1134
+ HEDLEY_TI_CL7X_VERSION_CHECK(1, 2, 0) || \
1135
+ HEDLEY_TI_CLPRU_VERSION_CHECK(2, 3, 0)
1136
+ #define HEDLEY_DEPRECATED(since) \
1137
+ __attribute__((__deprecated__("Since " #since)))
1138
+ #define HEDLEY_DEPRECATED_FOR(since, replacement) \
1139
+ __attribute__((__deprecated__("Since " #since "; use " #replacement)))
1140
+ #elif defined(__cplusplus) && (__cplusplus >= 201402L)
1141
+ #define HEDLEY_DEPRECATED(since) \
1142
+ HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_( \
1143
+ [[deprecated("Since " #since)]])
1144
+ #define HEDLEY_DEPRECATED_FOR(since, replacement) \
1145
+ HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_( \
1146
+ [[deprecated("Since " #since "; use " #replacement)]])
1147
+ #elif HEDLEY_HAS_ATTRIBUTE(deprecated) || HEDLEY_GCC_VERSION_CHECK(3, 1, 0) || \
1148
+ HEDLEY_ARM_VERSION_CHECK(4, 1, 0) || \
1149
+ HEDLEY_TI_VERSION_CHECK(15, 12, 0) || \
1150
+ (HEDLEY_TI_ARMCL_VERSION_CHECK(4, 8, 0) && \
1151
+ defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1152
+ HEDLEY_TI_ARMCL_VERSION_CHECK(5, 2, 0) || \
1153
+ (HEDLEY_TI_CL2000_VERSION_CHECK(6, 0, 0) && \
1154
+ defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1155
+ HEDLEY_TI_CL2000_VERSION_CHECK(6, 4, 0) || \
1156
+ (HEDLEY_TI_CL430_VERSION_CHECK(4, 0, 0) && \
1157
+ defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1158
+ HEDLEY_TI_CL430_VERSION_CHECK(4, 3, 0) || \
1159
+ (HEDLEY_TI_CL6X_VERSION_CHECK(7, 2, 0) && \
1160
+ defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1161
+ HEDLEY_TI_CL6X_VERSION_CHECK(7, 5, 0) || \
1162
+ HEDLEY_TI_CL7X_VERSION_CHECK(1, 2, 0) || \
1163
+ HEDLEY_TI_CLPRU_VERSION_CHECK(2, 1, 0)
1164
+ #define HEDLEY_DEPRECATED(since) __attribute__((__deprecated__))
1165
+ #define HEDLEY_DEPRECATED_FOR(since, replacement) \
1166
+ __attribute__((__deprecated__))
1167
+ #elif HEDLEY_MSVC_VERSION_CHECK(13, 10, 0) || \
1168
+ HEDLEY_PELLES_VERSION_CHECK(6, 50, 0) || \
1169
+ HEDLEY_INTEL_CL_VERSION_CHECK(2021, 1, 0)
1170
+ #define HEDLEY_DEPRECATED(since) __declspec(deprecated)
1171
+ #define HEDLEY_DEPRECATED_FOR(since, replacement) __declspec(deprecated)
1172
+ #elif HEDLEY_IAR_VERSION_CHECK(8, 0, 0)
1173
+ #define HEDLEY_DEPRECATED(since) _Pragma("deprecated")
1174
+ #define HEDLEY_DEPRECATED_FOR(since, replacement) _Pragma("deprecated")
1175
+ #else
1176
+ #define HEDLEY_DEPRECATED(since)
1177
+ #define HEDLEY_DEPRECATED_FOR(since, replacement)
1178
+ #endif
1179
+
1180
+ #if defined(HEDLEY_UNAVAILABLE)
1181
+ #undef HEDLEY_UNAVAILABLE
1182
+ #endif
1183
+ #if HEDLEY_HAS_ATTRIBUTE(warning) || HEDLEY_GCC_VERSION_CHECK(4, 3, 0) || \
1184
+ HEDLEY_INTEL_VERSION_CHECK(13, 0, 0)
1185
+ #define HEDLEY_UNAVAILABLE(available_since) \
1186
+ __attribute__((__warning__("Not available until " #available_since)))
1187
+ #else
1188
+ #define HEDLEY_UNAVAILABLE(available_since)
1189
+ #endif
1190
+
1191
+ #if defined(HEDLEY_WARN_UNUSED_RESULT)
1192
+ #undef HEDLEY_WARN_UNUSED_RESULT
1193
+ #endif
1194
+ #if defined(HEDLEY_WARN_UNUSED_RESULT_MSG)
1195
+ #undef HEDLEY_WARN_UNUSED_RESULT_MSG
1196
+ #endif
1197
+ #if HEDLEY_HAS_ATTRIBUTE(warn_unused_result) || \
1198
+ HEDLEY_GCC_VERSION_CHECK(3, 4, 0) || \
1199
+ HEDLEY_INTEL_VERSION_CHECK(13, 0, 0) || \
1200
+ HEDLEY_TI_VERSION_CHECK(15, 12, 0) || \
1201
+ (HEDLEY_TI_ARMCL_VERSION_CHECK(4, 8, 0) && \
1202
+ defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1203
+ HEDLEY_TI_ARMCL_VERSION_CHECK(5, 2, 0) || \
1204
+ (HEDLEY_TI_CL2000_VERSION_CHECK(6, 0, 0) && \
1205
+ defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1206
+ HEDLEY_TI_CL2000_VERSION_CHECK(6, 4, 0) || \
1207
+ (HEDLEY_TI_CL430_VERSION_CHECK(4, 0, 0) && \
1208
+ defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1209
+ HEDLEY_TI_CL430_VERSION_CHECK(4, 3, 0) || \
1210
+ (HEDLEY_TI_CL6X_VERSION_CHECK(7, 2, 0) && \
1211
+ defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1212
+ HEDLEY_TI_CL6X_VERSION_CHECK(7, 5, 0) || \
1213
+ HEDLEY_TI_CL7X_VERSION_CHECK(1, 2, 0) || \
1214
+ HEDLEY_TI_CLPRU_VERSION_CHECK(2, 1, 0) || \
1215
+ (HEDLEY_SUNPRO_VERSION_CHECK(5, 15, 0) && defined(__cplusplus)) || \
1216
+ HEDLEY_PGI_VERSION_CHECK(17, 10, 0)
1217
+ #define HEDLEY_WARN_UNUSED_RESULT __attribute__((__warn_unused_result__))
1218
+ #define HEDLEY_WARN_UNUSED_RESULT_MSG(msg) \
1219
+ __attribute__((__warn_unused_result__))
1220
+ #elif (HEDLEY_HAS_CPP_ATTRIBUTE(nodiscard) >= 201907L)
1221
+ #define HEDLEY_WARN_UNUSED_RESULT \
1222
+ HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[nodiscard]])
1223
+ #define HEDLEY_WARN_UNUSED_RESULT_MSG(msg) \
1224
+ HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[nodiscard(msg)]])
1225
+ #elif HEDLEY_HAS_CPP_ATTRIBUTE(nodiscard)
1226
+ #define HEDLEY_WARN_UNUSED_RESULT \
1227
+ HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[nodiscard]])
1228
+ #define HEDLEY_WARN_UNUSED_RESULT_MSG(msg) \
1229
+ HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[nodiscard]])
1230
+ #elif defined(_Check_return_) /* SAL */
1231
+ #define HEDLEY_WARN_UNUSED_RESULT _Check_return_
1232
+ #define HEDLEY_WARN_UNUSED_RESULT_MSG(msg) _Check_return_
1233
+ #else
1234
+ #define HEDLEY_WARN_UNUSED_RESULT
1235
+ #define HEDLEY_WARN_UNUSED_RESULT_MSG(msg)
1236
+ #endif
1237
+
1238
+ #if defined(HEDLEY_SENTINEL)
1239
+ #undef HEDLEY_SENTINEL
1240
+ #endif
1241
+ #if HEDLEY_HAS_ATTRIBUTE(sentinel) || HEDLEY_GCC_VERSION_CHECK(4, 0, 0) || \
1242
+ HEDLEY_INTEL_VERSION_CHECK(13, 0, 0) || \
1243
+ HEDLEY_ARM_VERSION_CHECK(5, 4, 0)
1244
+ #define HEDLEY_SENTINEL(position) __attribute__((__sentinel__(position)))
1245
+ #else
1246
+ #define HEDLEY_SENTINEL(position)
1247
+ #endif
1248
+
1249
+ #if defined(HEDLEY_NO_RETURN)
1250
+ #undef HEDLEY_NO_RETURN
1251
+ #endif
1252
+ #if HEDLEY_IAR_VERSION_CHECK(8, 0, 0)
1253
+ #define HEDLEY_NO_RETURN __noreturn
1254
+ #elif HEDLEY_INTEL_VERSION_CHECK(13, 0, 0)
1255
+ #define HEDLEY_NO_RETURN __attribute__((__noreturn__))
1256
+ #elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
1257
+ #define HEDLEY_NO_RETURN _Noreturn
1258
+ #elif defined(__cplusplus) && (__cplusplus >= 201103L)
1259
+ #define HEDLEY_NO_RETURN \
1260
+ HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[noreturn]])
1261
+ #elif HEDLEY_HAS_ATTRIBUTE(noreturn) || HEDLEY_GCC_VERSION_CHECK(3, 2, 0) || \
1262
+ HEDLEY_SUNPRO_VERSION_CHECK(5, 11, 0) || \
1263
+ HEDLEY_ARM_VERSION_CHECK(4, 1, 0) || \
1264
+ HEDLEY_IBM_VERSION_CHECK(10, 1, 0) || \
1265
+ HEDLEY_TI_VERSION_CHECK(15, 12, 0) || \
1266
+ (HEDLEY_TI_ARMCL_VERSION_CHECK(4, 8, 0) && \
1267
+ defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1268
+ HEDLEY_TI_ARMCL_VERSION_CHECK(5, 2, 0) || \
1269
+ (HEDLEY_TI_CL2000_VERSION_CHECK(6, 0, 0) && \
1270
+ defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1271
+ HEDLEY_TI_CL2000_VERSION_CHECK(6, 4, 0) || \
1272
+ (HEDLEY_TI_CL430_VERSION_CHECK(4, 0, 0) && \
1273
+ defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1274
+ HEDLEY_TI_CL430_VERSION_CHECK(4, 3, 0) || \
1275
+ (HEDLEY_TI_CL6X_VERSION_CHECK(7, 2, 0) && \
1276
+ defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1277
+ HEDLEY_TI_CL6X_VERSION_CHECK(7, 5, 0) || \
1278
+ HEDLEY_TI_CL7X_VERSION_CHECK(1, 2, 0) || \
1279
+ HEDLEY_TI_CLPRU_VERSION_CHECK(2, 1, 0)
1280
+ #define HEDLEY_NO_RETURN __attribute__((__noreturn__))
1281
+ #elif HEDLEY_SUNPRO_VERSION_CHECK(5, 10, 0)
1282
+ #define HEDLEY_NO_RETURN _Pragma("does_not_return")
1283
+ #elif HEDLEY_MSVC_VERSION_CHECK(13, 10, 0) || \
1284
+ HEDLEY_INTEL_CL_VERSION_CHECK(2021, 1, 0)
1285
+ #define HEDLEY_NO_RETURN __declspec(noreturn)
1286
+ #elif HEDLEY_TI_CL6X_VERSION_CHECK(6, 0, 0) && defined(__cplusplus)
1287
+ #define HEDLEY_NO_RETURN _Pragma("FUNC_NEVER_RETURNS;")
1288
+ #elif HEDLEY_COMPCERT_VERSION_CHECK(3, 2, 0)
1289
+ #define HEDLEY_NO_RETURN __attribute((noreturn))
1290
+ #elif HEDLEY_PELLES_VERSION_CHECK(9, 0, 0)
1291
+ #define HEDLEY_NO_RETURN __declspec(noreturn)
1292
+ #else
1293
+ #define HEDLEY_NO_RETURN
1294
+ #endif
1295
+
1296
+ #if defined(HEDLEY_NO_ESCAPE)
1297
+ #undef HEDLEY_NO_ESCAPE
1298
+ #endif
1299
+ #if HEDLEY_HAS_ATTRIBUTE(noescape)
1300
+ #define HEDLEY_NO_ESCAPE __attribute__((__noescape__))
1301
+ #else
1302
+ #define HEDLEY_NO_ESCAPE
1303
+ #endif
1304
+
1305
+ #if defined(HEDLEY_UNREACHABLE)
1306
+ #undef HEDLEY_UNREACHABLE
1307
+ #endif
1308
+ #if defined(HEDLEY_UNREACHABLE_RETURN)
1309
+ #undef HEDLEY_UNREACHABLE_RETURN
1310
+ #endif
1311
+ #if defined(HEDLEY_ASSUME)
1312
+ #undef HEDLEY_ASSUME
1313
+ #endif
1314
+ #if HEDLEY_MSVC_VERSION_CHECK(13, 10, 0) || \
1315
+ HEDLEY_INTEL_VERSION_CHECK(13, 0, 0) || \
1316
+ HEDLEY_INTEL_CL_VERSION_CHECK(2021, 1, 0)
1317
+ #define HEDLEY_ASSUME(expr) __assume(expr)
1318
+ #elif HEDLEY_HAS_BUILTIN(__builtin_assume)
1319
+ #define HEDLEY_ASSUME(expr) __builtin_assume(expr)
1320
+ #elif HEDLEY_TI_CL2000_VERSION_CHECK(6, 2, 0) || \
1321
+ HEDLEY_TI_CL6X_VERSION_CHECK(4, 0, 0)
1322
+ #if defined(__cplusplus)
1323
+ #define HEDLEY_ASSUME(expr) std::_nassert(expr)
1324
+ #else
1325
+ #define HEDLEY_ASSUME(expr) _nassert(expr)
1326
+ #endif
1327
+ #endif
1328
+ #if (HEDLEY_HAS_BUILTIN(__builtin_unreachable) && \
1329
+ (!defined(HEDLEY_ARM_VERSION))) || \
1330
+ HEDLEY_GCC_VERSION_CHECK(4, 5, 0) || \
1331
+ HEDLEY_PGI_VERSION_CHECK(18, 10, 0) || \
1332
+ HEDLEY_INTEL_VERSION_CHECK(13, 0, 0) || \
1333
+ HEDLEY_IBM_VERSION_CHECK(13, 1, 5)
1334
+ #define HEDLEY_UNREACHABLE() __builtin_unreachable()
1335
+ #elif defined(HEDLEY_ASSUME)
1336
+ #define HEDLEY_UNREACHABLE() HEDLEY_ASSUME(0)
1337
+ #endif
1338
+ #if !defined(HEDLEY_ASSUME)
1339
+ #if defined(HEDLEY_UNREACHABLE)
1340
+ #define HEDLEY_ASSUME(expr) \
1341
+ HEDLEY_STATIC_CAST(void, ((expr) ? 1 : (HEDLEY_UNREACHABLE(), 1)))
1342
+ #else
1343
+ #define HEDLEY_ASSUME(expr) HEDLEY_STATIC_CAST(void, expr)
1344
+ #endif
1345
+ #endif
1346
+ #if defined(HEDLEY_UNREACHABLE)
1347
+ #if HEDLEY_TI_CL2000_VERSION_CHECK(6, 2, 0) || \
1348
+ HEDLEY_TI_CL6X_VERSION_CHECK(4, 0, 0)
1349
+ #define HEDLEY_UNREACHABLE_RETURN(value) \
1350
+ return (HEDLEY_STATIC_CAST(void, HEDLEY_ASSUME(0)), (value))
1351
+ #else
1352
+ #define HEDLEY_UNREACHABLE_RETURN(value) HEDLEY_UNREACHABLE()
1353
+ #endif
1354
+ #else
1355
+ #define HEDLEY_UNREACHABLE_RETURN(value) return (value)
1356
+ #endif
1357
+ #if !defined(HEDLEY_UNREACHABLE)
1358
+ #define HEDLEY_UNREACHABLE() HEDLEY_ASSUME(0)
1359
+ #endif
1360
+
1361
+ HEDLEY_DIAGNOSTIC_PUSH
1362
+ #if HEDLEY_HAS_WARNING("-Wpedantic")
1363
+ #pragma clang diagnostic ignored "-Wpedantic"
1364
+ #endif
1365
+ #if HEDLEY_HAS_WARNING("-Wc++98-compat-pedantic") && defined(__cplusplus)
1366
+ #pragma clang diagnostic ignored "-Wc++98-compat-pedantic"
1367
+ #endif
1368
+ #if HEDLEY_GCC_HAS_WARNING("-Wvariadic-macros", 4, 0, 0)
1369
+ #if defined(__clang__)
1370
+ #pragma clang diagnostic ignored "-Wvariadic-macros"
1371
+ #elif defined(HEDLEY_GCC_VERSION)
1372
+ #pragma GCC diagnostic ignored "-Wvariadic-macros"
1373
+ #endif
1374
+ #endif
1375
+ #if defined(HEDLEY_NON_NULL)
1376
+ #undef HEDLEY_NON_NULL
1377
+ #endif
1378
+ #if HEDLEY_HAS_ATTRIBUTE(nonnull) || HEDLEY_GCC_VERSION_CHECK(3, 3, 0) || \
1379
+ HEDLEY_INTEL_VERSION_CHECK(13, 0, 0) || \
1380
+ HEDLEY_ARM_VERSION_CHECK(4, 1, 0)
1381
+ #define HEDLEY_NON_NULL(...) __attribute__((__nonnull__(__VA_ARGS__)))
1382
+ #else
1383
+ #define HEDLEY_NON_NULL(...)
1384
+ #endif
1385
+ HEDLEY_DIAGNOSTIC_POP
1386
+
1387
+ #if defined(HEDLEY_PRINTF_FORMAT)
1388
+ #undef HEDLEY_PRINTF_FORMAT
1389
+ #endif
1390
+ #if defined(__MINGW32__) && HEDLEY_GCC_HAS_ATTRIBUTE(format, 4, 4, 0) && \
1391
+ !defined(__USE_MINGW_ANSI_STDIO)
1392
+ #define HEDLEY_PRINTF_FORMAT(string_idx, first_to_check) \
1393
+ __attribute__((__format__(ms_printf, string_idx, first_to_check)))
1394
+ #elif defined(__MINGW32__) && HEDLEY_GCC_HAS_ATTRIBUTE(format, 4, 4, 0) && \
1395
+ defined(__USE_MINGW_ANSI_STDIO)
1396
+ #define HEDLEY_PRINTF_FORMAT(string_idx, first_to_check) \
1397
+ __attribute__((__format__(gnu_printf, string_idx, first_to_check)))
1398
+ #elif HEDLEY_HAS_ATTRIBUTE(format) || HEDLEY_GCC_VERSION_CHECK(3, 1, 0) || \
1399
+ HEDLEY_INTEL_VERSION_CHECK(13, 0, 0) || \
1400
+ HEDLEY_ARM_VERSION_CHECK(5, 6, 0) || \
1401
+ HEDLEY_IBM_VERSION_CHECK(10, 1, 0) || \
1402
+ HEDLEY_TI_VERSION_CHECK(15, 12, 0) || \
1403
+ (HEDLEY_TI_ARMCL_VERSION_CHECK(4, 8, 0) && \
1404
+ defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1405
+ HEDLEY_TI_ARMCL_VERSION_CHECK(5, 2, 0) || \
1406
+ (HEDLEY_TI_CL2000_VERSION_CHECK(6, 0, 0) && \
1407
+ defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1408
+ HEDLEY_TI_CL2000_VERSION_CHECK(6, 4, 0) || \
1409
+ (HEDLEY_TI_CL430_VERSION_CHECK(4, 0, 0) && \
1410
+ defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1411
+ HEDLEY_TI_CL430_VERSION_CHECK(4, 3, 0) || \
1412
+ (HEDLEY_TI_CL6X_VERSION_CHECK(7, 2, 0) && \
1413
+ defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1414
+ HEDLEY_TI_CL6X_VERSION_CHECK(7, 5, 0) || \
1415
+ HEDLEY_TI_CL7X_VERSION_CHECK(1, 2, 0) || \
1416
+ HEDLEY_TI_CLPRU_VERSION_CHECK(2, 1, 0)
1417
+ #define HEDLEY_PRINTF_FORMAT(string_idx, first_to_check) \
1418
+ __attribute__((__format__(__printf__, string_idx, first_to_check)))
1419
+ #elif HEDLEY_PELLES_VERSION_CHECK(6, 0, 0)
1420
+ #define HEDLEY_PRINTF_FORMAT(string_idx, first_to_check) \
1421
+ __declspec(vaformat(printf, string_idx, first_to_check))
1422
+ #else
1423
+ #define HEDLEY_PRINTF_FORMAT(string_idx, first_to_check)
1424
+ #endif
1425
+
1426
+ #if defined(HEDLEY_CONSTEXPR)
1427
+ #undef HEDLEY_CONSTEXPR
1428
+ #endif
1429
+ #if defined(__cplusplus)
1430
+ #if __cplusplus >= 201103L
1431
+ #define HEDLEY_CONSTEXPR HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(constexpr)
1432
+ #endif
1433
+ #endif
1434
+ #if !defined(HEDLEY_CONSTEXPR)
1435
+ #define HEDLEY_CONSTEXPR
1436
+ #endif
1437
+
1438
+ #if defined(HEDLEY_PREDICT)
1439
+ #undef HEDLEY_PREDICT
1440
+ #endif
1441
+ #if defined(HEDLEY_LIKELY)
1442
+ #undef HEDLEY_LIKELY
1443
+ #endif
1444
+ #if defined(HEDLEY_UNLIKELY)
1445
+ #undef HEDLEY_UNLIKELY
1446
+ #endif
1447
+ #if defined(HEDLEY_UNPREDICTABLE)
1448
+ #undef HEDLEY_UNPREDICTABLE
1449
+ #endif
1450
+ #if HEDLEY_HAS_BUILTIN(__builtin_unpredictable)
1451
+ #define HEDLEY_UNPREDICTABLE(expr) __builtin_unpredictable((expr))
1452
+ #endif
1453
+ #if (HEDLEY_HAS_BUILTIN(__builtin_expect_with_probability) && \
1454
+ !defined(HEDLEY_PGI_VERSION)) || \
1455
+ HEDLEY_GCC_VERSION_CHECK(9, 0, 0)
1456
+ #define HEDLEY_PREDICT(expr, value, probability) \
1457
+ __builtin_expect_with_probability((expr), (value), (probability))
1458
+ #define HEDLEY_PREDICT_TRUE(expr, probability) \
1459
+ __builtin_expect_with_probability(!!(expr), 1, (probability))
1460
+ #define HEDLEY_PREDICT_FALSE(expr, probability) \
1461
+ __builtin_expect_with_probability(!!(expr), 0, (probability))
1462
+ #define HEDLEY_LIKELY(expr) __builtin_expect(!!(expr), 1)
1463
+ #define HEDLEY_UNLIKELY(expr) __builtin_expect(!!(expr), 0)
1464
+ #elif (HEDLEY_HAS_BUILTIN(__builtin_expect) && \
1465
+ !defined(HEDLEY_INTEL_CL_VERSION)) || \
1466
+ HEDLEY_GCC_VERSION_CHECK(3, 0, 0) || \
1467
+ HEDLEY_INTEL_VERSION_CHECK(13, 0, 0) || \
1468
+ (HEDLEY_SUNPRO_VERSION_CHECK(5, 15, 0) && defined(__cplusplus)) || \
1469
+ HEDLEY_ARM_VERSION_CHECK(4, 1, 0) || \
1470
+ HEDLEY_IBM_VERSION_CHECK(10, 1, 0) || \
1471
+ HEDLEY_TI_VERSION_CHECK(15, 12, 0) || \
1472
+ HEDLEY_TI_ARMCL_VERSION_CHECK(4, 7, 0) || \
1473
+ HEDLEY_TI_CL430_VERSION_CHECK(3, 1, 0) || \
1474
+ HEDLEY_TI_CL2000_VERSION_CHECK(6, 1, 0) || \
1475
+ HEDLEY_TI_CL6X_VERSION_CHECK(6, 1, 0) || \
1476
+ HEDLEY_TI_CL7X_VERSION_CHECK(1, 2, 0) || \
1477
+ HEDLEY_TI_CLPRU_VERSION_CHECK(2, 1, 0) || \
1478
+ HEDLEY_TINYC_VERSION_CHECK(0, 9, 27) || \
1479
+ HEDLEY_CRAY_VERSION_CHECK(8, 1, 0)
1480
+ #define HEDLEY_PREDICT(expr, expected, probability) \
1481
+ (((probability) >= 0.9) \
1482
+ ? __builtin_expect((expr), (expected)) \
1483
+ : (HEDLEY_STATIC_CAST(void, expected), (expr)))
1484
+ #define HEDLEY_PREDICT_TRUE(expr, probability) \
1485
+ (__extension__({ \
1486
+ double hedley_probability_ = (probability); \
1487
+ ((hedley_probability_ >= 0.9) \
1488
+ ? __builtin_expect(!!(expr), 1) \
1489
+ : ((hedley_probability_ <= 0.1) \
1490
+ ? __builtin_expect(!!(expr), 0) \
1491
+ : !!(expr))); \
1492
+ }))
1493
+ #define HEDLEY_PREDICT_FALSE(expr, probability) \
1494
+ (__extension__({ \
1495
+ double hedley_probability_ = (probability); \
1496
+ ((hedley_probability_ >= 0.9) \
1497
+ ? __builtin_expect(!!(expr), 0) \
1498
+ : ((hedley_probability_ <= 0.1) \
1499
+ ? __builtin_expect(!!(expr), 1) \
1500
+ : !!(expr))); \
1501
+ }))
1502
+ #define HEDLEY_LIKELY(expr) __builtin_expect(!!(expr), 1)
1503
+ #define HEDLEY_UNLIKELY(expr) __builtin_expect(!!(expr), 0)
1504
+ #else
1505
+ #define HEDLEY_PREDICT(expr, expected, probability) \
1506
+ (HEDLEY_STATIC_CAST(void, expected), (expr))
1507
+ #define HEDLEY_PREDICT_TRUE(expr, probability) (!!(expr))
1508
+ #define HEDLEY_PREDICT_FALSE(expr, probability) (!!(expr))
1509
+ #define HEDLEY_LIKELY(expr) (!!(expr))
1510
+ #define HEDLEY_UNLIKELY(expr) (!!(expr))
1511
+ #endif
1512
+ #if !defined(HEDLEY_UNPREDICTABLE)
1513
+ #define HEDLEY_UNPREDICTABLE(expr) HEDLEY_PREDICT(expr, 1, 0.5)
1514
+ #endif
1515
+
1516
+ #if defined(HEDLEY_MALLOC)
1517
+ #undef HEDLEY_MALLOC
1518
+ #endif
1519
+ #if HEDLEY_HAS_ATTRIBUTE(malloc) || HEDLEY_GCC_VERSION_CHECK(3, 1, 0) || \
1520
+ HEDLEY_INTEL_VERSION_CHECK(13, 0, 0) || \
1521
+ HEDLEY_SUNPRO_VERSION_CHECK(5, 11, 0) || \
1522
+ HEDLEY_ARM_VERSION_CHECK(4, 1, 0) || \
1523
+ HEDLEY_IBM_VERSION_CHECK(12, 1, 0) || \
1524
+ HEDLEY_TI_VERSION_CHECK(15, 12, 0) || \
1525
+ (HEDLEY_TI_ARMCL_VERSION_CHECK(4, 8, 0) && \
1526
+ defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1527
+ HEDLEY_TI_ARMCL_VERSION_CHECK(5, 2, 0) || \
1528
+ (HEDLEY_TI_CL2000_VERSION_CHECK(6, 0, 0) && \
1529
+ defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1530
+ HEDLEY_TI_CL2000_VERSION_CHECK(6, 4, 0) || \
1531
+ (HEDLEY_TI_CL430_VERSION_CHECK(4, 0, 0) && \
1532
+ defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1533
+ HEDLEY_TI_CL430_VERSION_CHECK(4, 3, 0) || \
1534
+ (HEDLEY_TI_CL6X_VERSION_CHECK(7, 2, 0) && \
1535
+ defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1536
+ HEDLEY_TI_CL6X_VERSION_CHECK(7, 5, 0) || \
1537
+ HEDLEY_TI_CL7X_VERSION_CHECK(1, 2, 0) || \
1538
+ HEDLEY_TI_CLPRU_VERSION_CHECK(2, 1, 0)
1539
+ #define HEDLEY_MALLOC __attribute__((__malloc__))
1540
+ #elif HEDLEY_SUNPRO_VERSION_CHECK(5, 10, 0)
1541
+ #define HEDLEY_MALLOC _Pragma("returns_new_memory")
1542
+ #elif HEDLEY_MSVC_VERSION_CHECK(14, 0, 0) || \
1543
+ HEDLEY_INTEL_CL_VERSION_CHECK(2021, 1, 0)
1544
+ #define HEDLEY_MALLOC __declspec(restrict)
1545
+ #else
1546
+ #define HEDLEY_MALLOC
1547
+ #endif
1548
+
1549
+ #if defined(HEDLEY_PURE)
1550
+ #undef HEDLEY_PURE
1551
+ #endif
1552
+ #if HEDLEY_HAS_ATTRIBUTE(pure) || HEDLEY_GCC_VERSION_CHECK(2, 96, 0) || \
1553
+ HEDLEY_INTEL_VERSION_CHECK(13, 0, 0) || \
1554
+ HEDLEY_SUNPRO_VERSION_CHECK(5, 11, 0) || \
1555
+ HEDLEY_ARM_VERSION_CHECK(4, 1, 0) || \
1556
+ HEDLEY_IBM_VERSION_CHECK(10, 1, 0) || \
1557
+ HEDLEY_TI_VERSION_CHECK(15, 12, 0) || \
1558
+ (HEDLEY_TI_ARMCL_VERSION_CHECK(4, 8, 0) && \
1559
+ defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1560
+ HEDLEY_TI_ARMCL_VERSION_CHECK(5, 2, 0) || \
1561
+ (HEDLEY_TI_CL2000_VERSION_CHECK(6, 0, 0) && \
1562
+ defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1563
+ HEDLEY_TI_CL2000_VERSION_CHECK(6, 4, 0) || \
1564
+ (HEDLEY_TI_CL430_VERSION_CHECK(4, 0, 0) && \
1565
+ defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1566
+ HEDLEY_TI_CL430_VERSION_CHECK(4, 3, 0) || \
1567
+ (HEDLEY_TI_CL6X_VERSION_CHECK(7, 2, 0) && \
1568
+ defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1569
+ HEDLEY_TI_CL6X_VERSION_CHECK(7, 5, 0) || \
1570
+ HEDLEY_TI_CL7X_VERSION_CHECK(1, 2, 0) || \
1571
+ HEDLEY_TI_CLPRU_VERSION_CHECK(2, 1, 0) || \
1572
+ HEDLEY_PGI_VERSION_CHECK(17, 10, 0)
1573
+ #define HEDLEY_PURE __attribute__((__pure__))
1574
+ #elif HEDLEY_SUNPRO_VERSION_CHECK(5, 10, 0)
1575
+ #define HEDLEY_PURE _Pragma("does_not_write_global_data")
1576
+ #elif defined(__cplusplus) && (HEDLEY_TI_CL430_VERSION_CHECK(2, 0, 1) || \
1577
+ HEDLEY_TI_CL6X_VERSION_CHECK(4, 0, 0) || \
1578
+ HEDLEY_TI_CL7X_VERSION_CHECK(1, 2, 0))
1579
+ #define HEDLEY_PURE _Pragma("FUNC_IS_PURE;")
1580
+ #else
1581
+ #define HEDLEY_PURE
1582
+ #endif
1583
+
1584
+ #if defined(HEDLEY_CONST)
1585
+ #undef HEDLEY_CONST
1586
+ #endif
1587
+ #if HEDLEY_HAS_ATTRIBUTE(const) || HEDLEY_GCC_VERSION_CHECK(2, 5, 0) || \
1588
+ HEDLEY_INTEL_VERSION_CHECK(13, 0, 0) || \
1589
+ HEDLEY_SUNPRO_VERSION_CHECK(5, 11, 0) || \
1590
+ HEDLEY_ARM_VERSION_CHECK(4, 1, 0) || \
1591
+ HEDLEY_IBM_VERSION_CHECK(10, 1, 0) || \
1592
+ HEDLEY_TI_VERSION_CHECK(15, 12, 0) || \
1593
+ (HEDLEY_TI_ARMCL_VERSION_CHECK(4, 8, 0) && \
1594
+ defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1595
+ HEDLEY_TI_ARMCL_VERSION_CHECK(5, 2, 0) || \
1596
+ (HEDLEY_TI_CL2000_VERSION_CHECK(6, 0, 0) && \
1597
+ defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1598
+ HEDLEY_TI_CL2000_VERSION_CHECK(6, 4, 0) || \
1599
+ (HEDLEY_TI_CL430_VERSION_CHECK(4, 0, 0) && \
1600
+ defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1601
+ HEDLEY_TI_CL430_VERSION_CHECK(4, 3, 0) || \
1602
+ (HEDLEY_TI_CL6X_VERSION_CHECK(7, 2, 0) && \
1603
+ defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1604
+ HEDLEY_TI_CL6X_VERSION_CHECK(7, 5, 0) || \
1605
+ HEDLEY_TI_CL7X_VERSION_CHECK(1, 2, 0) || \
1606
+ HEDLEY_TI_CLPRU_VERSION_CHECK(2, 1, 0) || \
1607
+ HEDLEY_PGI_VERSION_CHECK(17, 10, 0)
1608
+ #define HEDLEY_CONST __attribute__((__const__))
1609
+ #elif HEDLEY_SUNPRO_VERSION_CHECK(5, 10, 0)
1610
+ #define HEDLEY_CONST _Pragma("no_side_effect")
1611
+ #else
1612
+ #define HEDLEY_CONST HEDLEY_PURE
1613
+ #endif
1614
+
1615
+ #if defined(HEDLEY_RESTRICT)
1616
+ #undef HEDLEY_RESTRICT
1617
+ #endif
1618
+ #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && \
1619
+ !defined(__cplusplus)
1620
+ #define HEDLEY_RESTRICT restrict
1621
+ #elif HEDLEY_GCC_VERSION_CHECK(3, 1, 0) || \
1622
+ HEDLEY_MSVC_VERSION_CHECK(14, 0, 0) || \
1623
+ HEDLEY_INTEL_VERSION_CHECK(13, 0, 0) || \
1624
+ HEDLEY_INTEL_CL_VERSION_CHECK(2021, 1, 0) || \
1625
+ HEDLEY_ARM_VERSION_CHECK(4, 1, 0) || \
1626
+ HEDLEY_IBM_VERSION_CHECK(10, 1, 0) || \
1627
+ HEDLEY_PGI_VERSION_CHECK(17, 10, 0) || \
1628
+ HEDLEY_TI_CL430_VERSION_CHECK(4, 3, 0) || \
1629
+ HEDLEY_TI_CL2000_VERSION_CHECK(6, 2, 4) || \
1630
+ HEDLEY_TI_CL6X_VERSION_CHECK(8, 1, 0) || \
1631
+ HEDLEY_TI_CL7X_VERSION_CHECK(1, 2, 0) || \
1632
+ (HEDLEY_SUNPRO_VERSION_CHECK(5, 14, 0) && defined(__cplusplus)) || \
1633
+ HEDLEY_IAR_VERSION_CHECK(8, 0, 0) || defined(__clang__)
1634
+ #define HEDLEY_RESTRICT __restrict
1635
+ #elif HEDLEY_SUNPRO_VERSION_CHECK(5, 3, 0) && !defined(__cplusplus)
1636
+ #define HEDLEY_RESTRICT _Restrict
1637
+ #else
1638
+ #define HEDLEY_RESTRICT
1639
+ #endif
1640
+
1641
+ #if defined(HEDLEY_INLINE)
1642
+ #undef HEDLEY_INLINE
1643
+ #endif
1644
+ #if (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) || \
1645
+ (defined(__cplusplus) && (__cplusplus >= 199711L))
1646
+ #define HEDLEY_INLINE inline
1647
+ #elif defined(HEDLEY_GCC_VERSION) || HEDLEY_ARM_VERSION_CHECK(6, 2, 0)
1648
+ #define HEDLEY_INLINE __inline__
1649
+ #elif HEDLEY_MSVC_VERSION_CHECK(12, 0, 0) || \
1650
+ HEDLEY_INTEL_CL_VERSION_CHECK(2021, 1, 0) || \
1651
+ HEDLEY_ARM_VERSION_CHECK(4, 1, 0) || \
1652
+ HEDLEY_TI_ARMCL_VERSION_CHECK(5, 1, 0) || \
1653
+ HEDLEY_TI_CL430_VERSION_CHECK(3, 1, 0) || \
1654
+ HEDLEY_TI_CL2000_VERSION_CHECK(6, 2, 0) || \
1655
+ HEDLEY_TI_CL6X_VERSION_CHECK(8, 0, 0) || \
1656
+ HEDLEY_TI_CL7X_VERSION_CHECK(1, 2, 0) || \
1657
+ HEDLEY_TI_CLPRU_VERSION_CHECK(2, 1, 0)
1658
+ #define HEDLEY_INLINE __inline
1659
+ #else
1660
+ #define HEDLEY_INLINE
1661
+ #endif
1662
+
1663
+ #if defined(HEDLEY_ALWAYS_INLINE)
1664
+ #undef HEDLEY_ALWAYS_INLINE
1665
+ #endif
1666
+ #if HEDLEY_HAS_ATTRIBUTE(always_inline) || \
1667
+ HEDLEY_GCC_VERSION_CHECK(4, 0, 0) || \
1668
+ HEDLEY_INTEL_VERSION_CHECK(13, 0, 0) || \
1669
+ HEDLEY_SUNPRO_VERSION_CHECK(5, 11, 0) || \
1670
+ HEDLEY_ARM_VERSION_CHECK(4, 1, 0) || \
1671
+ HEDLEY_IBM_VERSION_CHECK(10, 1, 0) || \
1672
+ HEDLEY_TI_VERSION_CHECK(15, 12, 0) || \
1673
+ (HEDLEY_TI_ARMCL_VERSION_CHECK(4, 8, 0) && \
1674
+ defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1675
+ HEDLEY_TI_ARMCL_VERSION_CHECK(5, 2, 0) || \
1676
+ (HEDLEY_TI_CL2000_VERSION_CHECK(6, 0, 0) && \
1677
+ defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1678
+ HEDLEY_TI_CL2000_VERSION_CHECK(6, 4, 0) || \
1679
+ (HEDLEY_TI_CL430_VERSION_CHECK(4, 0, 0) && \
1680
+ defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1681
+ HEDLEY_TI_CL430_VERSION_CHECK(4, 3, 0) || \
1682
+ (HEDLEY_TI_CL6X_VERSION_CHECK(7, 2, 0) && \
1683
+ defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1684
+ HEDLEY_TI_CL6X_VERSION_CHECK(7, 5, 0) || \
1685
+ HEDLEY_TI_CL7X_VERSION_CHECK(1, 2, 0) || \
1686
+ HEDLEY_TI_CLPRU_VERSION_CHECK(2, 1, 0)
1687
+ #define HEDLEY_ALWAYS_INLINE __attribute__((__always_inline__)) HEDLEY_INLINE
1688
+ #elif HEDLEY_MSVC_VERSION_CHECK(12, 0, 0) || \
1689
+ HEDLEY_INTEL_CL_VERSION_CHECK(2021, 1, 0)
1690
+ #define HEDLEY_ALWAYS_INLINE __forceinline
1691
+ #elif defined(__cplusplus) && (HEDLEY_TI_ARMCL_VERSION_CHECK(5, 2, 0) || \
1692
+ HEDLEY_TI_CL430_VERSION_CHECK(4, 3, 0) || \
1693
+ HEDLEY_TI_CL2000_VERSION_CHECK(6, 4, 0) || \
1694
+ HEDLEY_TI_CL6X_VERSION_CHECK(6, 1, 0) || \
1695
+ HEDLEY_TI_CL7X_VERSION_CHECK(1, 2, 0) || \
1696
+ HEDLEY_TI_CLPRU_VERSION_CHECK(2, 1, 0))
1697
+ #define HEDLEY_ALWAYS_INLINE _Pragma("FUNC_ALWAYS_INLINE;")
1698
+ #elif HEDLEY_IAR_VERSION_CHECK(8, 0, 0)
1699
+ #define HEDLEY_ALWAYS_INLINE _Pragma("inline=forced")
1700
+ #else
1701
+ #define HEDLEY_ALWAYS_INLINE HEDLEY_INLINE
1702
+ #endif
1703
+
1704
+ #if defined(HEDLEY_NEVER_INLINE)
1705
+ #undef HEDLEY_NEVER_INLINE
1706
+ #endif
1707
+ #if HEDLEY_HAS_ATTRIBUTE(noinline) || HEDLEY_GCC_VERSION_CHECK(4, 0, 0) || \
1708
+ HEDLEY_INTEL_VERSION_CHECK(13, 0, 0) || \
1709
+ HEDLEY_SUNPRO_VERSION_CHECK(5, 11, 0) || \
1710
+ HEDLEY_ARM_VERSION_CHECK(4, 1, 0) || \
1711
+ HEDLEY_IBM_VERSION_CHECK(10, 1, 0) || \
1712
+ HEDLEY_TI_VERSION_CHECK(15, 12, 0) || \
1713
+ (HEDLEY_TI_ARMCL_VERSION_CHECK(4, 8, 0) && \
1714
+ defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1715
+ HEDLEY_TI_ARMCL_VERSION_CHECK(5, 2, 0) || \
1716
+ (HEDLEY_TI_CL2000_VERSION_CHECK(6, 0, 0) && \
1717
+ defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1718
+ HEDLEY_TI_CL2000_VERSION_CHECK(6, 4, 0) || \
1719
+ (HEDLEY_TI_CL430_VERSION_CHECK(4, 0, 0) && \
1720
+ defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1721
+ HEDLEY_TI_CL430_VERSION_CHECK(4, 3, 0) || \
1722
+ (HEDLEY_TI_CL6X_VERSION_CHECK(7, 2, 0) && \
1723
+ defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1724
+ HEDLEY_TI_CL6X_VERSION_CHECK(7, 5, 0) || \
1725
+ HEDLEY_TI_CL7X_VERSION_CHECK(1, 2, 0) || \
1726
+ HEDLEY_TI_CLPRU_VERSION_CHECK(2, 1, 0)
1727
+ #define HEDLEY_NEVER_INLINE __attribute__((__noinline__))
1728
+ #elif HEDLEY_MSVC_VERSION_CHECK(13, 10, 0) || \
1729
+ HEDLEY_INTEL_CL_VERSION_CHECK(2021, 1, 0)
1730
+ #define HEDLEY_NEVER_INLINE __declspec(noinline)
1731
+ #elif HEDLEY_PGI_VERSION_CHECK(10, 2, 0)
1732
+ #define HEDLEY_NEVER_INLINE _Pragma("noinline")
1733
+ #elif HEDLEY_TI_CL6X_VERSION_CHECK(6, 0, 0) && defined(__cplusplus)
1734
+ #define HEDLEY_NEVER_INLINE _Pragma("FUNC_CANNOT_INLINE;")
1735
+ #elif HEDLEY_IAR_VERSION_CHECK(8, 0, 0)
1736
+ #define HEDLEY_NEVER_INLINE _Pragma("inline=never")
1737
+ #elif HEDLEY_COMPCERT_VERSION_CHECK(3, 2, 0)
1738
+ #define HEDLEY_NEVER_INLINE __attribute((noinline))
1739
+ #elif HEDLEY_PELLES_VERSION_CHECK(9, 0, 0)
1740
+ #define HEDLEY_NEVER_INLINE __declspec(noinline)
1741
+ #else
1742
+ #define HEDLEY_NEVER_INLINE
1743
+ #endif
1744
+
1745
+ #if defined(HEDLEY_PRIVATE)
1746
+ #undef HEDLEY_PRIVATE
1747
+ #endif
1748
+ #if defined(HEDLEY_PUBLIC)
1749
+ #undef HEDLEY_PUBLIC
1750
+ #endif
1751
+ #if defined(HEDLEY_IMPORT)
1752
+ #undef HEDLEY_IMPORT
1753
+ #endif
1754
+ #if defined(_WIN32) || defined(__CYGWIN__)
1755
+ #define HEDLEY_PRIVATE
1756
+ #define HEDLEY_PUBLIC __declspec(dllexport)
1757
+ #define HEDLEY_IMPORT __declspec(dllimport)
1758
+ #else
1759
+ #if HEDLEY_HAS_ATTRIBUTE(visibility) || HEDLEY_GCC_VERSION_CHECK(3, 3, 0) || \
1760
+ HEDLEY_SUNPRO_VERSION_CHECK(5, 11, 0) || \
1761
+ HEDLEY_INTEL_VERSION_CHECK(13, 0, 0) || \
1762
+ HEDLEY_ARM_VERSION_CHECK(4, 1, 0) || \
1763
+ HEDLEY_IBM_VERSION_CHECK(13, 1, 0) || \
1764
+ (defined(__TI_EABI__) && ((HEDLEY_TI_CL6X_VERSION_CHECK(7, 2, 0) && \
1765
+ defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \
1766
+ HEDLEY_TI_CL6X_VERSION_CHECK(7, 5, 0)))
1767
+ #define HEDLEY_PRIVATE __attribute__((__visibility__("hidden")))
1768
+ #define HEDLEY_PUBLIC __attribute__((__visibility__("default")))
1769
+ #else
1770
+ #define HEDLEY_PRIVATE
1771
+ #define HEDLEY_PUBLIC
1772
+ #endif
1773
+ #define HEDLEY_IMPORT extern
1774
+ #endif
1775
+
1776
+ #if defined(HEDLEY_NO_THROW)
1777
+ #undef HEDLEY_NO_THROW
1778
+ #endif
1779
+ #if HEDLEY_HAS_ATTRIBUTE(nothrow) || HEDLEY_GCC_VERSION_CHECK(3, 3, 0) || \
1780
+ HEDLEY_INTEL_VERSION_CHECK(13, 0, 0)
1781
+ #define HEDLEY_NO_THROW __attribute__((__nothrow__))
1782
+ #elif HEDLEY_MSVC_VERSION_CHECK(13, 1, 0) || \
1783
+ HEDLEY_INTEL_CL_VERSION_CHECK(2021, 1, 0) || \
1784
+ HEDLEY_ARM_VERSION_CHECK(4, 1, 0)
1785
+ #define HEDLEY_NO_THROW __declspec(nothrow)
1786
+ #else
1787
+ #define HEDLEY_NO_THROW
1788
+ #endif
1789
+
1790
+ #if defined(HEDLEY_FALL_THROUGH)
1791
+ #undef HEDLEY_FALL_THROUGH
1792
+ #endif
1793
+ #if HEDLEY_HAS_ATTRIBUTE(fallthrough) || HEDLEY_GCC_VERSION_CHECK(7, 0, 0)
1794
+ #define HEDLEY_FALL_THROUGH __attribute__((__fallthrough__))
1795
+ #elif HEDLEY_HAS_CPP_ATTRIBUTE_NS(clang, fallthrough)
1796
+ #define HEDLEY_FALL_THROUGH \
1797
+ HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[clang::fallthrough]])
1798
+ #elif HEDLEY_HAS_CPP_ATTRIBUTE(fallthrough)
1799
+ #define HEDLEY_FALL_THROUGH \
1800
+ HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[fallthrough]])
1801
+ #elif defined(__fallthrough) /* SAL */
1802
+ #define HEDLEY_FALL_THROUGH __fallthrough
1803
+ #else
1804
+ #define HEDLEY_FALL_THROUGH
1805
+ #endif
1806
+
1807
+ #if defined(HEDLEY_RETURNS_NON_NULL)
1808
+ #undef HEDLEY_RETURNS_NON_NULL
1809
+ #endif
1810
+ #if HEDLEY_HAS_ATTRIBUTE(returns_nonnull) || HEDLEY_GCC_VERSION_CHECK(4, 9, 0)
1811
+ #define HEDLEY_RETURNS_NON_NULL __attribute__((__returns_nonnull__))
1812
+ #elif defined(_Ret_notnull_) /* SAL */
1813
+ #define HEDLEY_RETURNS_NON_NULL _Ret_notnull_
1814
+ #else
1815
+ #define HEDLEY_RETURNS_NON_NULL
1816
+ #endif
1817
+
1818
+ #if defined(HEDLEY_ARRAY_PARAM)
1819
+ #undef HEDLEY_ARRAY_PARAM
1820
+ #endif
1821
+ #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && \
1822
+ !defined(__STDC_NO_VLA__) && !defined(__cplusplus) && \
1823
+ !defined(HEDLEY_PGI_VERSION) && !defined(HEDLEY_TINYC_VERSION)
1824
+ #define HEDLEY_ARRAY_PARAM(name) (name)
1825
+ #else
1826
+ #define HEDLEY_ARRAY_PARAM(name)
1827
+ #endif
1828
+
1829
+ #if defined(HEDLEY_IS_CONSTANT)
1830
+ #undef HEDLEY_IS_CONSTANT
1831
+ #endif
1832
+ #if defined(HEDLEY_REQUIRE_CONSTEXPR)
1833
+ #undef HEDLEY_REQUIRE_CONSTEXPR
1834
+ #endif
1835
+ /* HEDLEY_IS_CONSTEXPR_ is for
1836
+ HEDLEY INTERNAL USE ONLY. API subject to change without notice. */
1837
+ #if defined(HEDLEY_IS_CONSTEXPR_)
1838
+ #undef HEDLEY_IS_CONSTEXPR_
1839
+ #endif
1840
+ #if HEDLEY_HAS_BUILTIN(__builtin_constant_p) || \
1841
+ HEDLEY_GCC_VERSION_CHECK(3, 4, 0) || \
1842
+ HEDLEY_INTEL_VERSION_CHECK(13, 0, 0) || \
1843
+ HEDLEY_TINYC_VERSION_CHECK(0, 9, 19) || \
1844
+ HEDLEY_ARM_VERSION_CHECK(4, 1, 0) || \
1845
+ HEDLEY_IBM_VERSION_CHECK(13, 1, 0) || \
1846
+ HEDLEY_TI_CL6X_VERSION_CHECK(6, 1, 0) || \
1847
+ (HEDLEY_SUNPRO_VERSION_CHECK(5, 10, 0) && !defined(__cplusplus)) || \
1848
+ HEDLEY_CRAY_VERSION_CHECK(8, 1, 0)
1849
+ #define HEDLEY_IS_CONSTANT(expr) __builtin_constant_p(expr)
1850
+ #endif
1851
+ #if !defined(__cplusplus)
1852
+ #if HEDLEY_HAS_BUILTIN(__builtin_types_compatible_p) || \
1853
+ HEDLEY_GCC_VERSION_CHECK(3, 4, 0) || \
1854
+ HEDLEY_INTEL_VERSION_CHECK(13, 0, 0) || \
1855
+ HEDLEY_IBM_VERSION_CHECK(13, 1, 0) || \
1856
+ HEDLEY_CRAY_VERSION_CHECK(8, 1, 0) || \
1857
+ HEDLEY_ARM_VERSION_CHECK(5, 4, 0) || \
1858
+ HEDLEY_TINYC_VERSION_CHECK(0, 9, 24)
1859
+ #if defined(__INTPTR_TYPE__)
1860
+ #define HEDLEY_IS_CONSTEXPR_(expr) \
1861
+ __builtin_types_compatible_p( \
1862
+ __typeof__((1 ? (void *)((__INTPTR_TYPE__)((expr)*0)) \
1863
+ : (int *)0)), \
1864
+ int *)
1865
+ #else
1866
+ #include <stdint.h>
1867
+ #define HEDLEY_IS_CONSTEXPR_(expr) \
1868
+ __builtin_types_compatible_p( \
1869
+ __typeof__((1 ? (void *)((intptr_t)((expr)*0)) : (int *)0)), \
1870
+ int *)
1871
+ #endif
1872
+ #elif (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) && \
1873
+ !defined(HEDLEY_SUNPRO_VERSION) && !defined(HEDLEY_PGI_VERSION) && \
1874
+ !defined(HEDLEY_IAR_VERSION)) || \
1875
+ HEDLEY_HAS_EXTENSION(c_generic_selections) || \
1876
+ HEDLEY_GCC_VERSION_CHECK(4, 9, 0) || \
1877
+ HEDLEY_INTEL_VERSION_CHECK(17, 0, 0) || \
1878
+ HEDLEY_IBM_VERSION_CHECK(12, 1, 0) || \
1879
+ HEDLEY_ARM_VERSION_CHECK(5, 3, 0)
1880
+ #if defined(__INTPTR_TYPE__)
1881
+ #define HEDLEY_IS_CONSTEXPR_(expr) \
1882
+ _Generic((1 ? (void *)((__INTPTR_TYPE__)((expr)*0)) : (int *)0), \
1883
+ int * : 1, void * : 0)
1884
+ #else
1885
+ #include <stdint.h>
1886
+ #define HEDLEY_IS_CONSTEXPR_(expr) \
1887
+ _Generic((1 ? (void *)((intptr_t)*0) : (int *)0), int * : 1, void * : 0)
1888
+ #endif
1889
+ #elif defined(HEDLEY_GCC_VERSION) || defined(HEDLEY_INTEL_VERSION) || \
1890
+ defined(HEDLEY_TINYC_VERSION) || defined(HEDLEY_TI_ARMCL_VERSION) || \
1891
+ HEDLEY_TI_CL430_VERSION_CHECK(18, 12, 0) || \
1892
+ defined(HEDLEY_TI_CL2000_VERSION) || \
1893
+ defined(HEDLEY_TI_CL6X_VERSION) || defined(HEDLEY_TI_CL7X_VERSION) || \
1894
+ defined(HEDLEY_TI_CLPRU_VERSION) || defined(__clang__)
1895
+ #define HEDLEY_IS_CONSTEXPR_(expr) \
1896
+ (sizeof(void) != sizeof(*(1 ? ((void *)((expr)*0L)) : ((struct { \
1897
+ char v[sizeof(void) * 2]; \
1898
+ } *)1))))
1899
+ #endif
1900
+ #endif
1901
+ #if defined(HEDLEY_IS_CONSTEXPR_)
1902
+ #if !defined(HEDLEY_IS_CONSTANT)
1903
+ #define HEDLEY_IS_CONSTANT(expr) HEDLEY_IS_CONSTEXPR_(expr)
1904
+ #endif
1905
+ #define HEDLEY_REQUIRE_CONSTEXPR(expr) \
1906
+ (HEDLEY_IS_CONSTEXPR_(expr) ? (expr) : (-1))
1907
+ #else
1908
+ #if !defined(HEDLEY_IS_CONSTANT)
1909
+ #define HEDLEY_IS_CONSTANT(expr) (0)
1910
+ #endif
1911
+ #define HEDLEY_REQUIRE_CONSTEXPR(expr) (expr)
1912
+ #endif
1913
+
1914
+ #if defined(HEDLEY_BEGIN_C_DECLS)
1915
+ #undef HEDLEY_BEGIN_C_DECLS
1916
+ #endif
1917
+ #if defined(HEDLEY_END_C_DECLS)
1918
+ #undef HEDLEY_END_C_DECLS
1919
+ #endif
1920
+ #if defined(HEDLEY_C_DECL)
1921
+ #undef HEDLEY_C_DECL
1922
+ #endif
1923
+ #if defined(__cplusplus)
1924
+ #define HEDLEY_BEGIN_C_DECLS extern "C" {
1925
+ #define HEDLEY_END_C_DECLS }
1926
+ #define HEDLEY_C_DECL extern "C"
1927
+ #else
1928
+ #define HEDLEY_BEGIN_C_DECLS
1929
+ #define HEDLEY_END_C_DECLS
1930
+ #define HEDLEY_C_DECL
1931
+ #endif
1932
+
1933
+ #if defined(HEDLEY_STATIC_ASSERT)
1934
+ #undef HEDLEY_STATIC_ASSERT
1935
+ #endif
1936
+ #if !defined(__cplusplus) && \
1937
+ ((defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L)) || \
1938
+ (HEDLEY_HAS_FEATURE(c_static_assert) && \
1939
+ !defined(HEDLEY_INTEL_CL_VERSION)) || \
1940
+ HEDLEY_GCC_VERSION_CHECK(6, 0, 0) || \
1941
+ HEDLEY_INTEL_VERSION_CHECK(13, 0, 0) || defined(_Static_assert))
1942
+ #define HEDLEY_STATIC_ASSERT(expr, message) _Static_assert(expr, message)
1943
+ #elif (defined(__cplusplus) && (__cplusplus >= 201103L)) || \
1944
+ HEDLEY_MSVC_VERSION_CHECK(16, 0, 0) || \
1945
+ HEDLEY_INTEL_CL_VERSION_CHECK(2021, 1, 0)
1946
+ #define HEDLEY_STATIC_ASSERT(expr, message) \
1947
+ HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_( \
1948
+ static_assert(expr, message))
1949
+ #else
1950
+ #define HEDLEY_STATIC_ASSERT(expr, message)
1951
+ #endif
1952
+
1953
+ #if defined(HEDLEY_NULL)
1954
+ #undef HEDLEY_NULL
1955
+ #endif
1956
+ #if defined(__cplusplus)
1957
+ #if __cplusplus >= 201103L
1958
+ #define HEDLEY_NULL HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(nullptr)
1959
+ #elif defined(NULL)
1960
+ #define HEDLEY_NULL NULL
1961
+ #else
1962
+ #define HEDLEY_NULL HEDLEY_STATIC_CAST(void *, 0)
1963
+ #endif
1964
+ #elif defined(NULL)
1965
+ #define HEDLEY_NULL NULL
1966
+ #else
1967
+ #define HEDLEY_NULL ((void *)0)
1968
+ #endif
1969
+
1970
+ #if defined(HEDLEY_MESSAGE)
1971
+ #undef HEDLEY_MESSAGE
1972
+ #endif
1973
+ #if HEDLEY_HAS_WARNING("-Wunknown-pragmas")
1974
+ #define HEDLEY_MESSAGE(msg) \
1975
+ HEDLEY_DIAGNOSTIC_PUSH \
1976
+ HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS \
1977
+ HEDLEY_PRAGMA(message msg) \
1978
+ HEDLEY_DIAGNOSTIC_POP
1979
+ #elif HEDLEY_GCC_VERSION_CHECK(4, 4, 0) || HEDLEY_INTEL_VERSION_CHECK(13, 0, 0)
1980
+ #define HEDLEY_MESSAGE(msg) HEDLEY_PRAGMA(message msg)
1981
+ #elif HEDLEY_CRAY_VERSION_CHECK(5, 0, 0)
1982
+ #define HEDLEY_MESSAGE(msg) HEDLEY_PRAGMA(_CRI message msg)
1983
+ #elif HEDLEY_IAR_VERSION_CHECK(8, 0, 0)
1984
+ #define HEDLEY_MESSAGE(msg) HEDLEY_PRAGMA(message(msg))
1985
+ #elif HEDLEY_PELLES_VERSION_CHECK(2, 0, 0)
1986
+ #define HEDLEY_MESSAGE(msg) HEDLEY_PRAGMA(message(msg))
1987
+ #else
1988
+ #define HEDLEY_MESSAGE(msg)
1989
+ #endif
1990
+
1991
+ #if defined(HEDLEY_WARNING)
1992
+ #undef HEDLEY_WARNING
1993
+ #endif
1994
+ #if HEDLEY_HAS_WARNING("-Wunknown-pragmas")
1995
+ #define HEDLEY_WARNING(msg) \
1996
+ HEDLEY_DIAGNOSTIC_PUSH \
1997
+ HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS \
1998
+ HEDLEY_PRAGMA(clang warning msg) \
1999
+ HEDLEY_DIAGNOSTIC_POP
2000
+ #elif HEDLEY_GCC_VERSION_CHECK(4, 8, 0) || \
2001
+ HEDLEY_PGI_VERSION_CHECK(18, 4, 0) || \
2002
+ HEDLEY_INTEL_VERSION_CHECK(13, 0, 0)
2003
+ #define HEDLEY_WARNING(msg) HEDLEY_PRAGMA(GCC warning msg)
2004
+ #elif HEDLEY_MSVC_VERSION_CHECK(15, 0, 0) || \
2005
+ HEDLEY_INTEL_CL_VERSION_CHECK(2021, 1, 0)
2006
+ #define HEDLEY_WARNING(msg) HEDLEY_PRAGMA(message(msg))
2007
+ #else
2008
+ #define HEDLEY_WARNING(msg) HEDLEY_MESSAGE(msg)
2009
+ #endif
2010
+
2011
+ #if defined(HEDLEY_REQUIRE)
2012
+ #undef HEDLEY_REQUIRE
2013
+ #endif
2014
+ #if defined(HEDLEY_REQUIRE_MSG)
2015
+ #undef HEDLEY_REQUIRE_MSG
2016
+ #endif
2017
+ #if HEDLEY_HAS_ATTRIBUTE(diagnose_if)
2018
+ #if HEDLEY_HAS_WARNING("-Wgcc-compat")
2019
+ #define HEDLEY_REQUIRE(expr) \
2020
+ HEDLEY_DIAGNOSTIC_PUSH \
2021
+ _Pragma("clang diagnostic ignored \"-Wgcc-compat\"") \
2022
+ __attribute__((diagnose_if(!(expr), #expr, "error"))) \
2023
+ HEDLEY_DIAGNOSTIC_POP
2024
+ #define HEDLEY_REQUIRE_MSG(expr, msg) \
2025
+ HEDLEY_DIAGNOSTIC_PUSH \
2026
+ _Pragma("clang diagnostic ignored \"-Wgcc-compat\"") \
2027
+ __attribute__((diagnose_if(!(expr), msg, "error"))) \
2028
+ HEDLEY_DIAGNOSTIC_POP
2029
+ #else
2030
+ #define HEDLEY_REQUIRE(expr) \
2031
+ __attribute__((diagnose_if(!(expr), #expr, "error")))
2032
+ #define HEDLEY_REQUIRE_MSG(expr, msg) \
2033
+ __attribute__((diagnose_if(!(expr), msg, "error")))
2034
+ #endif
2035
+ #else
2036
+ #define HEDLEY_REQUIRE(expr)
2037
+ #define HEDLEY_REQUIRE_MSG(expr, msg)
2038
+ #endif
2039
+
2040
+ #if defined(HEDLEY_FLAGS)
2041
+ #undef HEDLEY_FLAGS
2042
+ #endif
2043
+ #if HEDLEY_HAS_ATTRIBUTE(flag_enum)
2044
+ #define HEDLEY_FLAGS __attribute__((__flag_enum__))
2045
+ #else
2046
+ #define HEDLEY_FLAGS
2047
+ #endif
2048
+
2049
+ #if defined(HEDLEY_FLAGS_CAST)
2050
+ #undef HEDLEY_FLAGS_CAST
2051
+ #endif
2052
+ #if HEDLEY_INTEL_VERSION_CHECK(19, 0, 0)
2053
+ #define HEDLEY_FLAGS_CAST(T, expr) \
2054
+ (__extension__({ \
2055
+ HEDLEY_DIAGNOSTIC_PUSH \
2056
+ _Pragma("warning(disable:188)")((T)(expr)); \
2057
+ HEDLEY_DIAGNOSTIC_POP \
2058
+ }))
2059
+ #else
2060
+ #define HEDLEY_FLAGS_CAST(T, expr) HEDLEY_STATIC_CAST(T, expr)
2061
+ #endif
2062
+
2063
+ #if defined(HEDLEY_EMPTY_BASES)
2064
+ #undef HEDLEY_EMPTY_BASES
2065
+ #endif
2066
+ #if (HEDLEY_MSVC_VERSION_CHECK(19, 0, 23918) && \
2067
+ !HEDLEY_MSVC_VERSION_CHECK(20, 0, 0)) || \
2068
+ HEDLEY_INTEL_CL_VERSION_CHECK(2021, 1, 0)
2069
+ #define HEDLEY_EMPTY_BASES __declspec(empty_bases)
2070
+ #else
2071
+ #define HEDLEY_EMPTY_BASES
2072
+ #endif
2073
+
2074
+ /* Remaining macros are deprecated. */
2075
+
2076
+ #if defined(HEDLEY_GCC_NOT_CLANG_VERSION_CHECK)
2077
+ #undef HEDLEY_GCC_NOT_CLANG_VERSION_CHECK
2078
+ #endif
2079
+ #if defined(__clang__)
2080
+ #define HEDLEY_GCC_NOT_CLANG_VERSION_CHECK(major, minor, patch) (0)
2081
+ #else
2082
+ #define HEDLEY_GCC_NOT_CLANG_VERSION_CHECK(major, minor, patch) \
2083
+ HEDLEY_GCC_VERSION_CHECK(major, minor, patch)
2084
+ #endif
2085
+
2086
+ #if defined(HEDLEY_CLANG_HAS_ATTRIBUTE)
2087
+ #undef HEDLEY_CLANG_HAS_ATTRIBUTE
2088
+ #endif
2089
+ #define HEDLEY_CLANG_HAS_ATTRIBUTE(attribute) HEDLEY_HAS_ATTRIBUTE(attribute)
2090
+
2091
+ #if defined(HEDLEY_CLANG_HAS_CPP_ATTRIBUTE)
2092
+ #undef HEDLEY_CLANG_HAS_CPP_ATTRIBUTE
2093
+ #endif
2094
+ #define HEDLEY_CLANG_HAS_CPP_ATTRIBUTE(attribute) \
2095
+ HEDLEY_HAS_CPP_ATTRIBUTE(attribute)
2096
+
2097
+ #if defined(HEDLEY_CLANG_HAS_BUILTIN)
2098
+ #undef HEDLEY_CLANG_HAS_BUILTIN
2099
+ #endif
2100
+ #define HEDLEY_CLANG_HAS_BUILTIN(builtin) HEDLEY_HAS_BUILTIN(builtin)
2101
+
2102
+ #if defined(HEDLEY_CLANG_HAS_FEATURE)
2103
+ #undef HEDLEY_CLANG_HAS_FEATURE
2104
+ #endif
2105
+ #define HEDLEY_CLANG_HAS_FEATURE(feature) HEDLEY_HAS_FEATURE(feature)
2106
+
2107
+ #if defined(HEDLEY_CLANG_HAS_EXTENSION)
2108
+ #undef HEDLEY_CLANG_HAS_EXTENSION
2109
+ #endif
2110
+ #define HEDLEY_CLANG_HAS_EXTENSION(extension) HEDLEY_HAS_EXTENSION(extension)
2111
+
2112
+ #if defined(HEDLEY_CLANG_HAS_DECLSPEC_DECLSPEC_ATTRIBUTE)
2113
+ #undef HEDLEY_CLANG_HAS_DECLSPEC_DECLSPEC_ATTRIBUTE
2114
+ #endif
2115
+ #define HEDLEY_CLANG_HAS_DECLSPEC_ATTRIBUTE(attribute) \
2116
+ HEDLEY_HAS_DECLSPEC_ATTRIBUTE(attribute)
2117
+
2118
+ #if defined(HEDLEY_CLANG_HAS_WARNING)
2119
+ #undef HEDLEY_CLANG_HAS_WARNING
2120
+ #endif
2121
+ #define HEDLEY_CLANG_HAS_WARNING(warning) HEDLEY_HAS_WARNING(warning)
2122
+
2123
+ #endif /* !defined(HEDLEY_VERSION) || (HEDLEY_VERSION < X) */