iutest  1.17.99.14
iutest_stdlib_defs.hpp
[詳解]
1 //======================================================================
2 //-----------------------------------------------------------------------
13 //-----------------------------------------------------------------------
14 //======================================================================
15 #ifndef INCG_IRIS_IUTEST_STDLIB_DEFS_HPP_9C62C097_E5FB_49EE_9329_811F32C846A2_
16 #define INCG_IRIS_IUTEST_STDLIB_DEFS_HPP_9C62C097_E5FB_49EE_9329_811F32C846A2_
17 
18 //======================================================================
19 // include
20 // IWYU pragma: begin_exports
21 #include "iutest_compiler.hpp"
22 #define __STDC_FORMAT_MACROS 1
23 #include <inttypes.h>
24 
25 #if defined(IUTEST_USE_GTEST) && defined(__STRICT_ANSI__)
26 # undef __STRICT_ANSI__
27 # include <string.h>
28 # include <stdlib.h>
29 # include <cstdio>
30 # define __STRICT_ANSI__
31 #endif
32 #if !defined(_MSC_VER)
33 # include <stdint.h>
34 #endif
35 #include <cstdlib>
36 #include <cstddef>
37 #include <limits>
38 #include <complex>
39 
40 // <version> header
41 #if !defined(IUTEST_HAS_CXX_HDR_VERSION)
42 # if defined(__has_include)
43 # if __has_include(<version>)
44 # define IUTEST_HAS_CXX_HDR_VERSION 1
45 # endif
46 # endif
47 #endif
48 
49 #if !defined(IUTEST_HAS_CXX_HDR_VERSION)
50 # define IUTEST_HAS_CXX_HDR_VERSION 0
51 #endif
52 
53 #if IUTEST_HAS_CXX_HDR_VERSION
54 #include <version>
55 #endif
56 // IWYU pragma: end_exports
57 
58 //======================================================================
59 // define
60 #if defined(__GLIBCPP__) || defined(__GLIBCXX__)
61 
62 // libstdc++
63 #if defined(__clang__)
64 # if __has_include(<experimental/memory_resource>)
65 # define IUTEST_LIBSTDCXX_VERSION 60100
66 # elif __has_include(<experimental/any>)
67 # define IUTEST_LIBSTDCXX_VERSION 50100
68 # elif __has_include(<shared_mutex>)
69 # define IUTEST_LIBSTDCXX_VERSION 40900
70 # elif __has_include(<ext/cmath>)
71 # define IUTEST_LIBSTDCXX_VERSION 40800
72 # elif __has_include(<scoped_allocator>)
73 # define IUTEST_LIBSTDCXX_VERSION 40700
74 # elif __has_include(<typeindex>)
75 # define IUTEST_LIBSTDCXX_VERSION 40600
76 # elif __has_include(<future>)
77 # define IUTEST_LIBSTDCXX_VERSION 40500
78 # elif __has_include(<ratio>)
79 # define IUTEST_LIBSTDCXX_VERSION 40400
80 # elif __has_include(<array>)
81 # define IUTEST_LIBSTDCXX_VERSION 40300
82 # endif
83 #elif defined(__GNUC__)
84 # define IUTEST_LIBSTDCXX_VERSION (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__)
85 #endif
86 
87 #if IUTEST_HAS_CXX11
88 # if IUTEST_LIBSTDCXX_VERSION >= 60100
89 # if !defined(IUTEST_HAS_STD_INVOKE) && IUTEST_HAS_CXX1Z
90 # define IUTEST_HAS_STD_INVOKE 1
91 # endif
92 # endif
93 # if IUTEST_LIBSTDCXX_VERSION >= 50100
94 # if !defined(IUTEST_HAS_CXX_HDR_CODECVT)
95 # define IUTEST_HAS_CXX_HDR_CODECVT 1
96 # endif
97 # endif
98 # if IUTEST_LIBSTDCXX_VERSION >= 40900
99 # if !defined(IUTEST_HAS_CXX_HDR_REGEX)
100 # define IUTEST_HAS_CXX_HDR_REGEX 1
101 # endif
102 # endif
103 # if IUTEST_LIBSTDCXX_VERSION >= 40700
104 # if !defined(IUTEST_HAS_STD_EMPLACE)
105 # define IUTEST_HAS_STD_EMPLACE 1
106 # endif
107 # if !defined(IUTEST_HAS_CXX_HDR_CHRONO)
108 # define IUTEST_HAS_CXX_HDR_CHRONO 1
109 # endif
110 # endif
111 # if IUTEST_LIBSTDCXX_VERSION >= 40600
112 # if !defined(IUTEST_HAS_STD_BEGIN_END)
113 # define IUTEST_HAS_STD_BEGIN_END 1
114 # endif
115 # endif
116 # if IUTEST_LIBSTDCXX_VERSION >= 40500
117 # if !defined(IUTEST_HAS_STD_DECLVAL)
118 # define IUTEST_HAS_STD_DECLVAL 1
119 # endif
120 # if !defined(IUTEST_HAS_CXX_HDR_RANDOM)
121 # define IUTEST_HAS_CXX_HDR_RANDOM 1
122 # endif
123 # if !defined(IUTEST_HAS_CXX_HDR_CSTDINT)
124 # define IUTEST_HAS_CXX_HDR_CSTDINT 1
125 # endif
126 # endif
127 # if IUTEST_LIBSTDCXX_VERSION >= 40300
128 # if !defined(IUTEST_HAS_CXX_HDR_ARRAY)
129 # define IUTEST_HAS_CXX_HDR_ARRAY 1
130 # endif
131 # if !defined(IUTEST_HAS_STD_TUPLE)
132 # define IUTEST_HAS_STD_TUPLE 1
133 # endif
134 # endif
135 # if defined(_GLIBCXX_HAVE_QUICK_EXIT) && defined(_GLIBCXX_HAVE_AT_QUICK_EXIT)
136 # if !defined(IUTEST_HAS_STD_QUICK_EXIT)
137 # define IUTEST_HAS_STD_QUICK_EXIT 1
138 # endif
139 # endif
140 # if defined(__has_include)
141 # if !defined(IUTEST_HAS_CXX_HDR_CUCHAR) && __has_include( <cuchar> )
142 # if defined(_GLIBCXX_USE_C11_UCHAR_CXX11) && _GLIBCXX_USE_C11_UCHAR_CXX11
143 # define IUTEST_HAS_CXX_HDR_CUCHAR 1
144 # endif
145 # endif
146 # endif
147 #endif
148 
149 #if !defined(IUTEST_HAS_STD_TUPLE)
150 # if (!defined(__CUDACC__) && !defined(__ARMCC_VERSION) && (IUTEST_LIBSTDCXX_VERSION >= 40000))
151 # if !defined(IUTEST_HAS_TR1_TUPLE)
152 # define IUTEST_HAS_TR1_TUPLE 1
153 # endif
154 # endif
155 #endif
156 
157 #if !defined(IUTEST_HAS_HDR_CXXABI)
158 # if defined(__has_include)
159 # if __has_include( <cxxabi.h> )
160 # define IUTEST_HAS_HDR_CXXABI 1
161 # endif
162 # else
163 # define IUTEST_HAS_HDR_CXXABI 1
164 # endif
165 #endif
166 
167 #if defined(__GNUC__) && !defined(__clang__)
168 // GCC 8.x requires linking with -lstdc++fs. (iutest not support)
169 # if (__GNUC__ < 9)
170 # define IUTEST_HAS_CXX_HDR_FILESYSTEM 0
171 # endif
172 #endif
173 
174 #elif defined(_LIBCPP_VERSION)
175 
176 // libc++
177 #if IUTEST_HAS_CXX11
178 # if !defined(IUTEST_HAS_STD_BEGIN_END)
179 # define IUTEST_HAS_STD_BEGIN_END 1
180 # endif
181 # if !defined(IUTEST_HAS_STD_DECLVAL)
182 # define IUTEST_HAS_STD_DECLVAL 1
183 # endif
184 # if !defined(IUTEST_HAS_STD_EMPLACE)
185 # define IUTEST_HAS_STD_EMPLACE 1
186 # endif
187 # if !defined(IUTEST_HAS_CXX_HDR_CHRONO)
188 # define IUTEST_HAS_CXX_HDR_CHRONO 1
189 # endif
190 # if !defined(IUTEST_HAS_CXX_HDR_REGEX)
191 # define IUTEST_HAS_CXX_HDR_REGEX 1
192 # endif
193 # if !defined(IUTEST_HAS_CXX_HDR_RANDOM)
194 # define IUTEST_HAS_CXX_HDR_RANDOM 1
195 # endif
196 # if !defined(IUTEST_HAS_CXX_HDR_CODECVT)
197 # define IUTEST_HAS_CXX_HDR_CODECVT 1
198 # endif
199 # if !defined(IUTEST_HAS_CXX_HDR_CSTDINT)
200 # define IUTEST_HAS_CXX_HDR_CSTDINT 1
201 # endif
202 # if !defined(IUTEST_HAS_CXX_HDR_ARRAY)
203 # define IUTEST_HAS_CXX_HDR_ARRAY 1
204 # endif
205 # if !defined(IUTEST_HAS_STD_QUICK_EXIT) && defined(_LIBCPP_HAS_QUICK_EXIT)
206 # if defined(__APPLE__)
207 # define IUTEST_HAS_STD_QUICK_EXIT 0 // xcode clang
208 # else
209 # define IUTEST_HAS_STD_QUICK_EXIT 1
210 # endif
211 # endif
212 # if defined(__has_include)
213 # if !defined(IUTEST_HAS_CXX_HDR_CUCHAR) && __has_include( <cuchar> )
214 # define IUTEST_HAS_CXX_HDR_CUCHAR 1
215 # endif
216 # if !defined(IUTEST_HAS_STD_TUPLE) && __has_include( <tuple> )
217 # define IUTEST_HAS_STD_TUPLE 1
218 # endif
219 # endif
220 #endif
221 
222 #if _LIBCPP_VERSION < 9000
223 # define IUTEST_HAS_CXX_HDR_FILESYSTEM 0
224 #endif
225 #if _LIBCPP_VERSION >= 3700
226 # if !defined(IUTEST_HAS_STD_INVOKE) && IUTEST_HAS_CXX1Z
227 # define IUTEST_HAS_STD_INVOKE 1
228 # endif
229 #endif
230 #if _LIBCPP_VERSION >= 1001
231 # if !defined(IUTEST_HAS_STD_BEGIN_END)
232 # define IUTEST_HAS_STD_BEGIN_END 1
233 # endif
234 #endif
235 
236 #if defined(__has_include)
237 # if !defined(IUTEST_HAS_STD_TUPLE) && !defined(IUTEST_HAS_TR1_TUPLE) && __has_include( <tr1/tuple> )
238 # define IUTEST_HAS_TR1_TUPLE 1
239 # endif
240 # if !defined(IUTEST_HAS_HDR_CXXABI) && __has_include( <cxxabi.h> )
241 # define IUTEST_HAS_HDR_CXXABI 1
242 # endif
243 #endif
244 
245 #elif defined(_MSC_VER) && defined(_MSC_FULL_VER)
246 
247 // Visual C++
248 
249 #if _MSC_VER >= 1600
250 # if !defined(IUTEST_HAS_CXX_HDR_ARRAY)
251 # define IUTEST_HAS_CXX_HDR_ARRAY 1
252 # endif
253 #endif
254 
255 #if _MSC_VER >= 1700
256 # if !defined(IUTEST_HAS_STD_BEGIN_END)
257 # define IUTEST_HAS_STD_BEGIN_END 1
258 # endif
259 # if !defined(IUTEST_HAS_STD_DECLVAL)
260 # define IUTEST_HAS_STD_DECLVAL IUTEST_HAS_DECLTYPE
261 # endif
262 # if !defined(IUTEST_HAS_STD_EMPLACE)
263 # define IUTEST_HAS_STD_EMPLACE 1
264 # endif
265 # if !defined(IUTEST_HAS_CXX_HDR_REGEX)
266 # define IUTEST_HAS_CXX_HDR_REGEX 1
267 # endif
268 # if !defined(IUTEST_HAS_CXX_HDR_RANDOM)
269 # define IUTEST_HAS_CXX_HDR_RANDOM 1
270 # endif
271 # if !defined(IUTEST_HAS_CXX_HDR_CODECVT)
272 # define IUTEST_HAS_CXX_HDR_CODECVT 1
273 # endif
274 # if !defined(IUTEST_HAS_CXX_HDR_CSTDINT)
275 # define IUTEST_HAS_CXX_HDR_CSTDINT 1
276 # endif
277 # if !defined(IUTEST_HAS_CXX_HDR_CHRONO) && _MSC_FULL_VER != 190023725
278 # define IUTEST_HAS_CXX_HDR_CHRONO 1
279 # endif
280 #endif
281 
282 #if _MSC_VER >= 1900
283 # if !defined(IUTEST_HAS_STD_QUICK_EXIT)
284 # define IUTEST_HAS_STD_QUICK_EXIT 1
285 # endif
286 # if !defined(IUTEST_HAS_CXX_HDR_CUCHAR)
287 # define IUTEST_HAS_CXX_HDR_CUCHAR 1
288 # endif
289 #endif
290 
291 #if _MSC_VER >= 1916
292 # if !defined(IUTEST_HAS_CXX_HDR_CHARCONV) && IUTEST_HAS_CXX17
293 # define IUTEST_HAS_CXX_HDR_CHARCONV 1
294 # endif
295 #endif
296 
297 // tuple
298 #if (_MSC_VER > 1700) || (_MSC_VER == 1700 && _VARIADIC_MAX >= 9)
299 # if !defined(IUTEST_HAS_STD_TUPLE)
300 # define IUTEST_HAS_STD_TUPLE 1
301 # endif
302 #elif (_MSC_VER >= 1500) && (_MSC_VER < 1700) && (_MSC_FULL_VER > 150021022)
303 # if !defined(IUTEST_HAS_TR1_TUPLE)
304 # define IUTEST_HAS_TR1_TUPLE 1
305 # endif
306 #endif
307 
308 #elif defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)
309 
310 // stlport
311 
312 #endif
313 
314 #if IUTEST_HAS_CXX1Z
315 
316 // c++1z feature
317 
318 #if defined(__has_include)
319 
320 #if !defined(IUTEST_HAS_CXX_HDR_ANY)
321 # if __has_include(<any>)
322 # define IUTEST_HAS_CXX_HDR_ANY 1
323 # endif
324 #endif
325 
326 #if !defined(IUTEST_HAS_CXX_HDR_CHARCONV)
327 # if __has_include(<charconv>)
328 # define IUTEST_HAS_CXX_HDR_CHARCONV 1
329 # endif
330 #endif
331 
332 // apple(xcode) clang
333 #if defined(__MAC_OS_X_VERSION_MIN_REQUIRED)
334 # if !IUTEST_HAS_CXX17
335 # define IUTEST_HAS_CXX_HDR_FILESYSTEM 0
336 # endif
337 # if __MAC_OS_X_VERSION_MIN_REQUIRED < 101500
338 # define IUTEST_HAS_CXX_HDR_FILESYSTEM 0
339 # endif
340 #endif
341 
342 #if !defined(IUTEST_HAS_CXX_HDR_FILESYSTEM)
343 # if __has_include(<filesystem>)
344 # define IUTEST_HAS_CXX_HDR_FILESYSTEM 1
345 # endif
346 #endif
347 
348 #if !defined(IUTEST_HAS_CXX_HDR_OPTIONAL)
349 # if __has_include(<optional>)
350 # define IUTEST_HAS_CXX_HDR_OPTIONAL 1
351 # endif
352 #endif
353 
354 #if !defined(IUTEST_HAS_CXX_HDR_STRING_VIEW)
355 # if __has_include(<string_view>)
356 # define IUTEST_HAS_CXX_HDR_STRING_VIEW 1
357 # endif
358 #endif
359 
360 #endif
361 
362 #endif
363 
364 #if IUTEST_HAS_CXX17
365 
366 // c++17 feature
367 
368 #if !defined(IUTEST_HAS_CXX_HDR_VARIANT)
369 # if IUTEST_HAS_VARIADIC_TEMPLATES && defined(__has_include)
370 # if defined(__clang__) && (IUTEST_CLANG_MAJOR < 3 || (IUTEST_CLANG_MAJOR == 3 && IUTEST_CLANG_MINOR < 6))
371 # define IUTEST_HAS_CXX_HDR_VARIANT 0 // clang 3.5 + variant is not worked
372 # elif __has_include(<variant>)
373 # define IUTEST_HAS_CXX_HDR_VARIANT 1
374 # endif
375 # endif
376 #endif
377 
378 #if defined(IUTEST_HAS_CXX_HDR_CODECVT) && IUTEST_HAS_CXX_HDR_CODECVT
379 // IUTEST_PRAGMA_MESSAGE("iutest use codecvt, but codecvt was deprecated. If you do not want to use this, define IUTEST_HAS_CXX_HDR_CODECVT 0")
380 #endif
381 
382 #endif
383 
384 #if defined(__has_include)
385 # if defined(IUTEST_HAS_CXX_HDR_CODECVT) && IUTEST_HAS_CXX_HDR_CODECVT
386 # if !__has_include( <codecvt> )
387 # undef IUTEST_HAS_CXX_HDR_CODECVT
388 # endif
389 # endif
390 #endif
391 
392 #if !defined(IUTEST_HAS_HDR_UNISTD)
393 # if defined(__has_include)
394 # if __has_include(<unistd.h>)
395 # define IUTEST_HAS_HDR_UNISTD 1
396 # endif
397 # endif
398 #endif
399 
400 #if !defined(IUTEST_HAS_HDR_UNISTD)
401 # if defined(IUTEST_OS_LINUX) || defined(IUTEST_OS_CYGWIN) \
402  || defined(IUTEST_OS_MAC) || defined(IUTEST_OS_IOS) \
403  || defined(IUTEST_OS_FREEBSD) \
404  || defined(__arm__)
405 # define IUTEST_HAS_HDR_UNISTD 1
406 # endif
407 #endif
408 
409 // defaults for include
411 #if !defined(IUTEST_HAS_CXX_HDR_ANY)
412 # define IUTEST_HAS_CXX_HDR_ANY 0
413 #endif
415 #if !defined(IUTEST_HAS_CXX_HDR_ARRAY)
416 # define IUTEST_HAS_CXX_HDR_ARRAY 0
417 #endif
419 #if !defined(IUTEST_HAS_CXX_HDR_CHARCONV)
420 # define IUTEST_HAS_CXX_HDR_CHARCONV 0
421 #endif
423 #if !defined(IUTEST_HAS_CXX_HDR_CHRONO)
424 # define IUTEST_HAS_CXX_HDR_CHRONO 0
425 #endif
431 #if !defined(IUTEST_HAS_CXX_HDR_CODECVT)
432 # define IUTEST_HAS_CXX_HDR_CODECVT 0
433 #endif
435 #if !defined(IUTEST_HAS_CXX_HDR_CSTDINT)
436 # define IUTEST_HAS_CXX_HDR_CSTDINT 0
437 #endif
439 #if !defined(IUTEST_HAS_CXX_HDR_CUCHAR)
440 # define IUTEST_HAS_CXX_HDR_CUCHAR 0
441 #endif
443 #if !defined(IUTEST_HAS_CXX_HDR_FILESYSTEM)
444 # define IUTEST_HAS_CXX_HDR_FILESYSTEM 0
445 #endif
447 #if !defined(IUTEST_HAS_CXX_HDR_OPTIONAL)
448 # define IUTEST_HAS_CXX_HDR_OPTIONAL 0
449 #endif
451 #if !defined(IUTEST_HAS_CXX_HDR_RANDOM)
452 # define IUTEST_HAS_CXX_HDR_RANDOM 0
453 #endif
455 #if !defined(IUTEST_HAS_CXX_HDR_REGEX)
456 # define IUTEST_HAS_CXX_HDR_REGEX 0
457 #endif
459 #if !defined(IUTEST_HAS_CXX_HDR_STRING_VIEW)
460 # define IUTEST_HAS_CXX_HDR_STRING_VIEW 0
461 #endif
463 #if !defined(IUTEST_HAS_CXX_HDR_VARIANT)
464 # define IUTEST_HAS_CXX_HDR_VARIANT 0
465 #endif
467 #if !defined(IUTEST_HAS_HDR_CXXABI)
468 # define IUTEST_HAS_HDR_CXXABI 0
469 #endif
471 #if !defined(IUTEST_HAS_HDR_UNISTD)
472 # define IUTEST_HAS_HDR_UNISTD 0
473 #endif
474 
475 #if !defined(IUTEST_HAS_STD_FILESYSTEM)
476 # if defined(ANDROID) || defined(__ANDROID__) || defined(__ARM_EABI__)
477 # define IUTEST_HAS_STD_FILESYSTEM 0
478 # elif defined(__INTEL_COMPILER)
479 # define IUTEST_HAS_STD_FILESYSTEM 0
480 # elif IUTEST_HAS_CXX_HDR_FILESYSTEM && defined(__cpp_lib_filesystem) && __cpp_lib_filesystem >= 201703
481 # if !defined(__cpp_lib_experimental_filesystem)
482 # define IUTEST_HAS_STD_FILESYSTEM 1
483 # endif
484 # endif
485 #endif
486 
487 #if !defined(IUTEST_HAS_STD_TO_CHARS)
488 # if IUTEST_HAS_CXX_HDR_CHARCONV && defined(__cpp_lib_to_chars) && __cpp_lib_to_chars >= 201611
489 # define IUTEST_HAS_STD_TO_CHARS 1
490 # endif
491 #endif
492 
493 // defaults for feature
494 
496 #if !defined(IUTEST_HAS_STD_BEGIN_END)
497 # define IUTEST_HAS_STD_BEGIN_END 0
498 #endif
500 #if !defined(IUTEST_HAS_STD_DECLVAL)
501 # define IUTEST_HAS_STD_DECLVAL 0
502 #endif
504 #if !defined(IUTEST_HAS_STD_EMPLACE)
505 # define IUTEST_HAS_STD_EMPLACE 0
506 #endif
508 #if !defined(IUTEST_HAS_STD_FILESYSTEM)
509 # define IUTEST_HAS_STD_FILESYSTEM 0
510 #endif
512 #if !defined(IUTEST_HAS_STD_INVOKE)
513 # define IUTEST_HAS_STD_INVOKE 0
514 #endif
516 #if !defined(IUTEST_HAS_STD_QUICK_EXIT)
517 # define IUTEST_HAS_STD_QUICK_EXIT 0
518 #endif
520 #if !defined(IUTEST_HAS_STD_TO_CHARS)
521 # define IUTEST_HAS_STD_TO_CHARS 0
522 #endif
523 
525 #if !defined(IUTEST_USE_EXTERNAL_TR1_TUPLE)
526 # define IUTEST_USE_EXTERNAL_TR1_TUPLE 0
527 #endif
529 #ifndef IUTEST_USE_EXTERNAL_STD_TUPLE
530 # define IUTEST_USE_EXTERNAL_STD_TUPLE 0
531 #endif
533 #if !defined(IUTEST_HAS_STD_TUPLE)
534 # define IUTEST_HAS_STD_TUPLE 0
535 #endif
537 #if !defined(IUTEST_HAS_TR1_TUPLE)
538 # define IUTEST_HAS_TR1_TUPLE 0
539 #endif
541 #if IUTEST_HAS_STD_TUPLE || IUTEST_HAS_TR1_TUPLE || IUTEST_USE_EXTERNAL_TR1_TUPLE || IUTEST_USE_EXTERNAL_STD_TUPLE
542 # if !defined(IUTEST_HAS_TUPLE)
543 # define IUTEST_HAS_TUPLE 1
544 # endif
545 #else
546 # if defined(IUTEST_HAS_TUPLE)
547 # undef IUTEST_HAS_TUPLE
548 # endif
549 # define IUTEST_HAS_TUPLE 0
550 #endif
551 #if !defined(IUTEST_HAS_VARIADIC_TUPLES) && IUTEST_HAS_VARIADIC_TEMPLATES && IUTEST_HAS_TUPLE && IUTEST_HAS_STD_TUPLE
552 # if defined(__clang__)
553 # if (IUTEST_CLANG_MAJOR > 3 || (IUTEST_CLANG_MAJOR == 3 && IUTEST_CLANG_MINOR > 7))
554 # define IUTEST_HAS_VARIADIC_TUPLES 1
555 # endif
556 # else
557 # define IUTEST_HAS_VARIADIC_TUPLES 1
558 # endif
559 #endif
560 #if !defined(IUTEST_HAS_VARIADIC_TUPLES)
561 # define IUTEST_HAS_VARIADIC_TUPLES 0
562 #endif
563 
565 #if !defined(IUTEST_HAS_STD_STR_TO_VALUE)
566 # if IUTEST_HAS_CXX11
567 # if defined(IUTEST_OS_WINDOWS_MINGW)
568 # if defined(__MINGW64__) && (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)))
569 # define IUTEST_HAS_STD_STR_TO_VALUE 1
570 # endif
571 # else
572 # define IUTEST_HAS_STD_STR_TO_VALUE 1
573 # endif
574 # endif
575 #endif
576 
577 #if !defined(IUTEST_HAS_STD_STR_TO_VALUE)
578 # define IUTEST_HAS_STD_STR_TO_VALUE 0
579 #endif
580 
582 #if !defined(IUTEST_HAS_HDR_SYSTIME)
583 # if defined(IUTEST_OS_WINDOWS) && !defined(IUTEST_OS_WINDOWS_MINGW) && !defined(IUTEST_OS_WINDOWS_WINE)
584 # define IUTEST_HAS_HDR_SYSTIME 0
585 # endif
586 #endif
587 
588 #if !defined(IUTEST_HAS_HDR_SYSTIME)
589 # define IUTEST_HAS_HDR_SYSTIME 1
590 #endif
591 
592 // socklen_t
593 #if defined(IUTEST_OS_WINDOWS_WINE)
594 # define __socklen_t_defined
595 #endif
596 
598 #if !defined(IUTEST_HAS_STRINGSTREAM)
599 # if !defined(_STLP_NO_IOSTREAMS)
600 # define IUTEST_HAS_STRINGSTREAM 1
601 # endif
602 #endif
603 
604 #if !defined(IUTEST_HAS_STRINGSTREAM)
605 # define IUTEST_HAS_STRINGSTREAM 0
606 #endif
607 
608 
614 #if !defined(IUTEST_HAS_STRSTREAM)
615 # define IUTEST_HAS_STRSTREAM 0
616 #endif
617 
619 #if !defined(IUTEST_HAS_IOMANIP)
620 # if IUTEST_HAS_STRINGSTREAM || IUTEST_HAS_STRSTREAM
621 # define IUTEST_HAS_IOMANIP 1
622 # endif
623 #endif
624 
625 #if !defined(IUTEST_HAS_IOMANIP)
626 # define IUTEST_HAS_IOMANIP 0
627 #endif
628 
629 
631 #if !defined(IUTEST_HAS_INVALID_PARAMETER_HANDLER)
632 # if IUTEST_HAS_EXCEPTIONS && (defined(_MSC_VER) && (_MSC_VER >= 1400)) && !defined(IUTEST_OS_WINDOWS_MOBILE)
633 # define IUTEST_HAS_INVALID_PARAMETER_HANDLER 1
634 # endif
635 #endif
636 
637 #if !defined(IUTEST_HAS_INVALID_PARAMETER_HANDLER)
638 # define IUTEST_HAS_INVALID_PARAMETER_HANDLER 0
639 #endif
640 
642 #if !defined(IUTEST_HAS_LARGEFILE_API)
643 # if defined(__LARGEFILE_VISIBLE) && __LARGEFILE_VISIBLE
644 # define IUTEST_HAS_LARGEFILE_API 1
645 # elif defined(__POSIX_VISIBLE) && __POSIX_VISIBLE >= 200112
646 # define IUTEST_HAS_LARGEFILE_API 1
647 # else
648 # define IUTEST_HAS_LARGEFILE_API 0
649 # endif
650 #endif
651 
652 
654 #if !defined(IUTEST_HAS_FOPEN)
655 # define IUTEST_HAS_FOPEN 1
656 #endif
657 
658 
660 #if !defined(IUTEST_HAS_FILE_STAT)
661 # if !defined(IUTEST_OS_WINDOWS_MOBILE)
662 # define IUTEST_HAS_FILE_STAT 1
663 # endif
664 #endif
665 
666 #if !defined(IUTEST_HAS_FILE_STAT)
667 # define IUTEST_HAS_FILE_STAT 0
668 #endif
669 
671 #if !defined(IUTEST_HAS_FILENO)
672 # if defined(__POSIX_VISIBLE) && __POSIX_VISIBLE == 0
673 # define IUTEST_HAS_FILENO 0
674 # elif defined(IUTEST_OS_WINDOWS_MINGW) && defined(__STRICT_ANSI__)
675 # define IUTEST_HAS_FILENO 0
676 # elif !defined(IUTEST_OS_WINDOWS_MOBILE)
677 # define IUTEST_HAS_FILENO 1
678 # endif
679 #endif
680 
681 #if !defined(IUTEST_HAS_FILENO)
682 # define IUTEST_HAS_FILENO 0
683 #endif
684 
686 #if !defined(IUTEST_HAS_FD_DUP)
687 # if IUTEST_HAS_HDR_UNISTD && !defined(__arm__)
688 # define IUTEST_HAS_FD_DUP 1
689 # endif
690 #endif
691 
692 #if !defined(IUTEST_HAS_FD_DUP)
693 # define IUTEST_HAS_FD_DUP 0
694 #endif
695 
697 #if !defined(IUTEST_HAS_FD_OPEN)
698 # if IUTEST_HAS_HDR_UNISTD
699 # if defined(__arm__)
700 # define IUTEST_HAS_FD_OPEN 0
701 # elif defined(IUTEST_OS_CYGWIN)
702 # if !defined(__STRICT_ANSI__)
703 # define IUTEST_HAS_FD_OPEN 1
704 # endif
705 # elif defined(IUTEST_OS_WINDOWS_MINGW) && !defined(__MINGW64__)
706 # define IUTEST_HAS_FD_OPEN 0
707 # else
708 # define IUTEST_HAS_FD_OPEN 1
709 # endif
710 # endif
711 #endif
712 
713 #if !defined(IUTEST_HAS_FD_OPEN)
714 # define IUTEST_HAS_FD_OPEN 0
715 #endif
716 
718 #if !defined(IUTEST_HAS_MKSTEMP)
719 # if defined(HAVE_MKSTEMP)
720 # define IUTEST_HAS_MKSTEMP HAVE_MKSTEMP
721 # elif defined(__arm__)
722 # if !defined(_REENT_ONLY) \
723  && ( (defined(__MISC_VISIBLE) && __MISC_VISIBLE) \
724  || (defined(__POSIX_VISIBLE) && __POSIX_VISIBLE >= 200112) \
725  || (defined(__XSI_VISIBLE) && __XSI_VISIBLE >= 4) \
726  )
727 # define IUTEST_HAS_MKSTEMP 1
728 # endif
729 # elif defined(IUTEST_OS_CYGWIN)
730 # if !defined(__STRICT_ANSI__)
731 # define IUTEST_HAS_MKSTEMP 1
732 # endif
733 # elif defined(IUTEST_OS_WINDOWS_MINGW) && !defined(__MINGW64__)
734 # define IUTEST_HAS_MKSTEMP 0
735 # elif IUTEST_HAS_HDR_UNISTD
736 # define IUTEST_HAS_MKSTEMP 1
737 # endif
738 #endif
739 
740 #if !defined(IUTEST_HAS_MKSTEMP)
741 # define IUTEST_HAS_MKSTEMP 0
742 #endif
743 
745 #if !defined(IUPRzu)
746 # if defined(_MSC_VER) && (_MSC_VER < 1900)
747 # define IUPRzu "Iu"
748 # elif defined(IUTEST_OS_WINDOWS_MINGW)
749 # if !defined(__STRICT_ANSI__)
750 # if defined(__MINGW64__)
751 # define IUPRzu PRIu64
752 # elif defined(__MINGW32__)
753 # define IUPRzu PRIu32
754 # endif
755 # endif
756 # endif
757 #endif
758 
759 #if !defined(IUPRzu)
760 # define IUPRzu "zu"
761 #endif
762 
763 #if !defined(iu_va_copy)
764 # if defined(va_copy)
765 # define iu_va_copy va_copy
766 # elif defined(__GNUC__) || defined(__clang__)
767 # define iu_va_copy(dest, src) __builtin_va_copy(dest, src)
768 # else
769 # define iu_va_copy(dest, src) (dest = src)
770 # endif
771 #endif
772 
773 //======================================================================
774 // include
775 // IWYU pragma: begin_exports
776 #include <iterator>
777 
778 #if IUTEST_HAS_CXX_HDR_ANY
779 # include <any>
780 #endif
781 #if IUTEST_HAS_CXX_HDR_CSTDINT
782 # include <cstdint>
783 #endif
784 #if IUTEST_HAS_CXX_HDR_FILESYSTEM && IUTEST_HAS_STD_FILESYSTEM
785 # include <filesystem>
786 #endif
787 #if IUTEST_HAS_CXX_HDR_OPTIONAL
788 # include <optional>
789 #endif
790 #if IUTEST_HAS_CXX_HDR_VARIANT
791 # include <variant>
792 #endif
793 #if IUTEST_HAS_CXX_HDR_CHARCONV
794 # include <charconv>
795 #endif
796 // IWYU pragma: end_exports
797 
798 #endif // INCG_IRIS_IUTEST_STDLIB_DEFS_HPP_9C62C097_E5FB_49EE_9329_811F32C846A2_
iris unit test compiler 依存の吸収 ファイル