Ne.app NeANT
The Ne.app NeANT User module of the NeANT distribution.
18.cstdint.cpp
Go to the documentation of this file.
1// -*- C++ -*-
2
31enum macros {
32 // these are expected to be hidden by macros #defined in <cstdint>
33 // #included below; references to macros that are not #defined in
34 // the header will silently use these enumerators and prevent
35 // compilation errors that would result otherwise
54
68};
69
70
71#include <rw_driver.h>
72
73#ifndef _RWSTD_NO_EXT_CXX_0X
74
75#include <ansi/cstdint>
76
77
78
80static int rw_opt_no_macros; // for --no-macros
81static int rw_opt_no_types; // for --no-types
82static int rw_opt_no_64_bit; // for --no-64-bit
83
84
87static const char* const
89
90#ifndef INT_LEAST8_MIN
91 "INT_LEAST8_MIN",
92#else
93 "",
94#endif // INT_LEAST8_MIN
95
96#ifndef INT_FAST8_MIN
97 "INT_FAST8_MIN",
98#else
99 "",
100#endif // INT_FAST8_MIN
101
102#ifndef INT_LEAST16_MIN
103 "INT_LEAST16_MIN",
104#else
105 "",
106#endif // INT_LEAST16_MIN
107
108#ifndef INT_FAST16_MIN
109 "INT_FAST16_MIN",
110#else
111 "",
112#endif // INT_FAST16_MIN
113
114
115#ifndef INT_LEAST32_MIN
116 "INT_LEAST32_MIN",
117#else
118 "",
119#endif // INT_LEAST32_MIN
120
121#ifndef INT_FAST32_MIN
122 "INT_FAST32_MIN",
123#else
124 "",
125#endif // INT_FAST32_MIN
126
127
128#ifndef INT_LEAST8_MAX
129 "INT_LEAST8_MAX",
130#else
131 "",
132#endif // INT_LEAST8_MAX
133
134#ifndef UINT_LEAST8_MAX
135 "UINT_LEAST8_MAX",
136#else
137 "",
138#endif // UINT_LEAST8_MAX
139
140#ifndef INT_FAST8_MAX
141 "INT_FAST8_MAX",
142#else
143 "",
144#endif // INT_FAST8_MAX
145
146#ifndef UINT_FAST8_MAX
147 "UINT_FAST8_MAX",
148#else
149 "",
150#endif // UINT_FAST8_MAX
151
152
153#ifndef INT_LEAST16_MAX
154 "INT_LEAST16_MAX",
155#else
156 "",
157#endif // INT_LEAST16_MAX
158
159#ifndef UINT_LEAST16_MAX
160 "UINT_LEAST16_MAX",
161#else
162 "",
163#endif // UINT_LEAST16_MAX
164
165#ifndef INT_FAST16_MAX
166 "INT_FAST16_MAX",
167#else
168 "",
169#endif // INT_FAST16_MAX
170
171#ifndef UINT_FAST16_MAX
172 "UINT_FAST16_MAX",
173#else
174 "",
175#endif // UINT_FAST16_MAX
176
177
178#ifndef INT_LEAST32_MAX
179 "INT_LEAST32_MAX",
180#else
181 "",
182#endif // INT_LEAST32_MAX
183
184#ifndef UINT_LEAST32_MAX
185 "UINT_LEAST32_MAX",
186#else
187 "",
188#endif // UINT_LEAST32_MAX
189
190#ifndef INT_FAST32_MAX
191 "INT_FAST32_MAX",
192#else
193 "",
194#endif // INT_FAST32_MAX
195
196#ifndef UINT_FAST32_MAX
197 "UINT_FAST32_MAX",
198#else
199 "",
200#endif // UINT_FAST32_MAX
201
202#ifndef INTPTR_MAX
203 "INTPTR_MAX",
204#else
205 "",
206#endif // INTPTR_MAX
207
208#ifndef UINTPTR_MAX
209 "UINTPTR_MAX",
210#else
211 "",
212#endif // UINTPTR_MAX
213
214#ifndef PTRDIFF_MIN
215 "PTRDIFF_MIN",
216#else
217 "",
218#endif // PTRDIFF_MIN
219
220#ifndef PTRDIFF_MAX
221 "PTRDIFF_MAX",
222#else
223 "",
224#endif // PTRDIFF_MAX
225
226#ifndef SIZE_MAX
227 "SIZE_MAX",
228#else
229 "",
230#endif // SIZE_MAX
231
232#ifndef WCHAR_MIN
233 "WCHAR_MIN",
234#else
235 "",
236#endif // WCHAR_MIN
237
238#ifndef WCHAR_MAX
239 "WCHAR_MAX",
240#else
241 "",
242#endif // WCHAR_MAX
243
244#ifndef WINT_MIN
245 "WINT_MIN",
246#else
247 "",
248#endif // WINT_MIN
249
250#ifndef WINT_MAX
251 "WINT_MAX",
252#else
253 "",
254#endif // WINT_MAX
255
256#ifndef SIG_ATOMIC_MIN
257 "SIG_ATOMIC_MIN",
258#else
259 "",
260#endif // SIG_ATOMIC_MIN
261
262#ifndef SIG_ATOMIC_MAX
263 "SIG_ATOMIC_MAX",
264#else
265 "",
266#endif // SIG_ATOMIC_MAX
267
268 0
269};
270
271
272static const char* const
273missing_optional_macros[] = {
274
275#ifndef UINT8_MAX
276 "UINT8_MAX",
277#else
278 "",
279#endif // UINT8_MAX
280
281#ifndef UINT16_MAX
282 "UINT16_MAX",
283#else
284 "",
285#endif // UINT16_MAX
286
287#ifndef UINT32_MAX
288 "UINT32_MAX",
289#else
290 "",
291#endif // UINT32_MAX
292
293 0
294};
295
296
297static const char* const
298missing_64_bit_macros[] = {
299
300#ifndef INT_LEAST64_MIN
301 "INT_LEAST64_MIN",
302#else
303 "",
304#endif // INT_LEAST64_MIN
305
306#ifndef INT_FAST64_MIN
307 "INT_FAST64_MIN",
308#else
309 "",
310#endif // INT_FAST64_MIN
311
312#ifndef UINT64_MAX
313 "UINT64_MAX",
314#else
315 "",
316#endif // UINT64_MAX
317
318#ifndef INT_LEAST64_MAX
319 "INT_LEAST64_MAX",
320#else
321 "",
322#endif // INT_LEAST64_MAX
323
324#ifndef UINT_LEAST64_MAX
325 "UINT_LEAST64_MAX",
326#else
327 "",
328#endif // UINT_LEAST64_MAX
329
330#ifndef INT_FAST64_MAX
331 "INT_FAST64_MAX",
332#else
333 "",
334#endif // INT_FAST64_MAX
335
336#ifndef UINT_FAST64_MAX
337 "UINT_FAST64_MAX",
338#else
339 "",
340#endif // UINT_FAST64_MAX
341
342 0
343};
344
345
347#ifndef _RWSTD_NO_NAMESPACE
348
349// check types
350
351#define DEFINE_TYPE(name) \
352 struct name { \
353 int i_; \
354 char dummy_ [256]; \
355 \
356 name (int i = 0): i_ (i) { } \
357 operator int () const volatile { return i_; } \
358 name operator- (int i) const volatile { return i_ - i; } \
359 name operator~ () const volatile { return ~0; } \
360 name operator& (int i) const volatile { return i_ & i; } \
361 bool operator< (int i) const volatile { return i_ < i; } \
362}
363
364
365namespace Fallback {
366
367DEFINE_TYPE (int8_t);
368DEFINE_TYPE (uint8_t);
369DEFINE_TYPE (int_least8_t);
370DEFINE_TYPE (uint_least8_t);
371DEFINE_TYPE (int_fast8_t);
372DEFINE_TYPE (uint_fast8_t);
373
374DEFINE_TYPE (int16_t);
375DEFINE_TYPE (uint16_t);
376DEFINE_TYPE (int_least16_t);
377DEFINE_TYPE (uint_least16_t);
378DEFINE_TYPE (int_fast16_t);
379DEFINE_TYPE (uint_fast16_t);
380
381DEFINE_TYPE (int32_t);
382DEFINE_TYPE (uint32_t);
383DEFINE_TYPE (int_least32_t);
384DEFINE_TYPE (uint_least32_t);
385DEFINE_TYPE (int_fast32_t);
386DEFINE_TYPE (uint_fast32_t);
387
388DEFINE_TYPE (int64_t);
389DEFINE_TYPE (uint64_t);
390DEFINE_TYPE (int_least64_t);
391DEFINE_TYPE (uint_least64_t);
392DEFINE_TYPE (int_fast64_t);
393DEFINE_TYPE (uint_fast64_t);
394
395DEFINE_TYPE (intmax_t);
396DEFINE_TYPE (uintmax_t);
397
398DEFINE_TYPE (intptr_t);
399DEFINE_TYPE (uintptr_t);
400
401} // Namespace Fallback
402
403namespace std {
404
405// define test functions in namespace std to detect the presece
406// or absence of the required types
407
408namespace Nested {
409
410using namespace Fallback;
411
412// each test_xxx_t typedef aliases std::xxx_t if the corresponding
413// type is defined in namespace std, or Fallback::xxx_t otherwise
414
415typedef int8_t test_int8_t;
416typedef uint8_t test_uint8_t;
417typedef int_least8_t test_int_least8_t;
418typedef uint_least8_t test_uint_least8_t;
419typedef int_fast8_t test_int_fast8_t;
420typedef uint_fast8_t test_uint_fast8_t;
421
422typedef int16_t test_int16_t;
423typedef uint16_t test_uint16_t;
424typedef int_least16_t test_int_least16_t;
425typedef uint_least16_t test_uint_least16_t;
426typedef int_fast16_t test_int_fast16_t;
427typedef uint_fast16_t test_uint_fast16_t;
428
429typedef int32_t test_int32_t;
430typedef uint32_t test_uint32_t;
431typedef int_least32_t test_int_least32_t;
432typedef uint_least32_t test_uint_least32_t;
433typedef int_fast32_t test_int_fast32_t;
434typedef uint_fast32_t test_uint_fast32_t;
435
436typedef int64_t test_int64_t;
437typedef uint64_t test_uint64_t;
438typedef int_least64_t test_int_least64_t;
439typedef uint_least64_t test_uint_least64_t;
440typedef int_fast64_t test_int_fast64_t;
441typedef uint_fast64_t test_uint_fast64_t;
442
443typedef intmax_t test_intmax_t;
444typedef uintmax_t test_uintmax_t;
445typedef intptr_t test_intptr_t;
446typedef uintptr_t test_uintptr_t;
447
448} // namespace Nested
449
450} // namespace std
451
452typedef std::Nested::test_int8_t test_int8_t;
453typedef std::Nested::test_uint8_t test_uint8_t;
454typedef std::Nested::test_int_least8_t test_int_least8_t;
455typedef std::Nested::test_uint_least8_t test_uint_least8_t;
456typedef std::Nested::test_int_fast8_t test_int_fast8_t;
457typedef std::Nested::test_uint_fast8_t test_uint_fast8_t;
458
459typedef std::Nested::test_int16_t test_int16_t;
460typedef std::Nested::test_uint16_t test_uint16_t;
461typedef std::Nested::test_int_least16_t test_int_least16_t;
462typedef std::Nested::test_uint_least16_t test_uint_least16_t;
463typedef std::Nested::test_int_fast16_t test_int_fast16_t;
464typedef std::Nested::test_uint_fast16_t test_uint_fast16_t;
465
466typedef std::Nested::test_int32_t test_int32_t;
467typedef std::Nested::test_uint32_t test_uint32_t;
468typedef std::Nested::test_int_least32_t test_int_least32_t;
469typedef std::Nested::test_uint_least32_t test_uint_least32_t;
470typedef std::Nested::test_int_fast32_t test_int_fast32_t;
471typedef std::Nested::test_uint_fast32_t test_uint_fast32_t;
472
473typedef std::Nested::test_int64_t test_int64_t;
474typedef std::Nested::test_uint64_t test_uint64_t;
475typedef std::Nested::test_int_least64_t test_int_least64_t;
476typedef std::Nested::test_uint_least64_t test_uint_least64_t;
477typedef std::Nested::test_int_fast64_t test_int_fast64_t;
478typedef std::Nested::test_uint_fast64_t test_uint_fast64_t;
479
480typedef std::Nested::test_intmax_t test_intmax_t;
481typedef std::Nested::test_uintmax_t test_uintmax_t;
482typedef std::Nested::test_intptr_t test_intptr_t;
483typedef std::Nested::test_uintptr_t test_uintptr_t;
484
485
487template <class intT>
488void test_bits (int line, // line number
489 intT testval, // tested value (for macros)
490 int expect, // expected number of bits
491 bool exact, // exactly (or at least)
492 const char *type_name, // name of type
493 const char *macro_name = 0, // name of macro
494 const char *valstr = 0) // value (for message)
495{
496 static volatile intT zero = intT (0);
497 static volatile intT one = intT (1);
498 static volatile intT minus_one = intT (zero - one);
499 static volatile intT all_bits_set = intT (~zero);
500
501 const bool is_signed = minus_one < zero;
502
503 const unsigned maxbits = sizeof (intT) * _RWSTD_CHAR_BIT;
504
505 int nbits = 0;
506
507 intT maximum = one;
508 intT minimum = is_signed ? minus_one : one;
509
510 // count the number of bits
511 for (unsigned i = 0; i != maxbits; ++i) {
512
513 if (all_bits_set & (intT (1) << i))
514 ++nbits;
515 else
516 break;
517
518 maximum = intT (maximum * 2);
519 minimum = intT (maximum * 2);
520 }
521
522 if (macro_name) {
523 // verify macro value
524
525 if (is_signed) {
526 if (zero < testval) {
527 rw_assert (maximum <= testval, 0, line,
528 "%s >= %s", macro_name, valstr);
529 }
530 else {
531 rw_assert (testval <= minimum, 0, line,
532 "%s <= %s", macro_name, valstr);
533 }
534 }
535 else {
536 rw_assert (maximum <= testval, 0, line,
537 "%s >= %s", macro_name, valstr);
538 }
539 }
540 else {
541 if (expect < 0) {
542 expect = -expect;
543
544 // verify that the type is signed
545 rw_assert (minus_one < zero, 0, line,
546 "%s must be a signed type", type_name);
547 }
548 else {
549 // verify that the type is unsigned
550 rw_assert (zero < minus_one, 0, line,
551 "%s must be an unsigned type", type_name);
552 }
553
554 // verify that the type is exactly/at least as wide as expected
555 const bool success = exact ? expect == nbits : expect <= nbits;
556
557 if (64 != expect || !rw_opt_no_64_bit)
558 rw_assert (success, 0, 0,
559 "%s expected width %{?}exactly%{:}at least%{;} "
560 "%d bits, got %d", type_name, exact, expect, nbits);
561 }
562}
563
564
566static void
567test_types ()
568{
569#define TEST_REQUIRED_TYPE(name, bits, exact) \
570 do { \
571 rw_info (0, 0, __LINE__, "std::%s (required)", # name); \
572 const bool type_defined = \
573 sizeof (test_ ## name) != sizeof (Fallback::name); \
574 rw_assert (type_defined, 0, __LINE__, \
575 "required type %s not defined in namespace " \
576 "std", #name); \
577 if (type_defined) \
578 test_bits (__LINE__, test_ ## name (0), \
579 bits, exact, #name); \
580 } while (0)
581
582#define TEST_OPTIONAL_TYPE(name, bits, exact) \
583 do { \
584 rw_info (0, 0, __LINE__, "std::%s (optional)", # name); \
585 const bool type_defined = \
586 sizeof (test_ ## name) != sizeof (Fallback::name); \
587 rw_warn (type_defined, 0, __LINE__, \
588 "optional type %s not defined in namespace " \
589 "std", #name); \
590 if (type_defined) \
591 test_bits (__LINE__, test_ ## name (0), \
592 bits, exact, #name); \
593 } while (0)
594
595 TEST_OPTIONAL_TYPE (int8_t, -8, true);
596 TEST_OPTIONAL_TYPE (uint8_t, 8, true);
597 TEST_OPTIONAL_TYPE (int16_t, -16, true);
598 TEST_OPTIONAL_TYPE (uint16_t, 16, true);
599 TEST_OPTIONAL_TYPE (int32_t, -32, true);
600 TEST_OPTIONAL_TYPE (uint32_t, 32, true);
601
602 TEST_REQUIRED_TYPE (int_least8_t, -8, false);
603 TEST_REQUIRED_TYPE (uint_least8_t, 8, false);
604 TEST_REQUIRED_TYPE (int_fast8_t, -8, false);
605 TEST_REQUIRED_TYPE (uint_fast8_t, 8, false);
606
607 TEST_REQUIRED_TYPE (int_least16_t, -16, false);
608 TEST_REQUIRED_TYPE (uint_least16_t, 16, false);
609 TEST_REQUIRED_TYPE (int_fast16_t, -16, false);
610 TEST_REQUIRED_TYPE (uint_fast16_t, 16, false);
611
612 TEST_REQUIRED_TYPE (int_least32_t, -32, false);
613 TEST_REQUIRED_TYPE (uint_least32_t, 32, false);
614 TEST_REQUIRED_TYPE (int_fast32_t, -32, false);
615 TEST_REQUIRED_TYPE (uint_fast32_t, 32, false);
616
617 TEST_REQUIRED_TYPE (intmax_t, -64, false);
618 TEST_REQUIRED_TYPE (uintmax_t, 64, false);
619 TEST_REQUIRED_TYPE (intptr_t, -16, false);
620 TEST_REQUIRED_TYPE (uintptr_t, 16, false);
621
622 if (rw_opt_no_64_bit) {
623 rw_note (0, 0, 0, "tests of 64-bit types disabled");
624 }
625 else {
626 TEST_OPTIONAL_TYPE (int64_t, -64, true);
627 TEST_OPTIONAL_TYPE (uint64_t, 64, true);
628
629 TEST_REQUIRED_TYPE (int_least64_t, -64, false);
630 TEST_REQUIRED_TYPE (uint_least64_t, 64, false);
631 TEST_REQUIRED_TYPE (int_fast64_t, -64, false);
632 TEST_REQUIRED_TYPE (uint_fast64_t, 64, false);
633 }
634}
635
636#else // if defined (_RWSTD_NO_NAMESPACE)
637
638static void
639test_types ()
640{
641 rw_note (0, 0, 0, "_RWSTD_NO_NAMESPACE defined, cannot test");
642}
643
644#endif // _RWSTD_NO_NAMESPACE
645
646
648static void
649test_macros ()
650{
651 for (unsigned i = 0; missing_macros [i]; ++i) {
652 rw_assert ('\0' == missing_macros [i][0], 0, __LINE__,
653 "required macro %s not defined",
654 missing_macros [i]);
655 }
656
657#define TEST_MACRO(T, macro, bits, exact, valstr) \
658 test_bits (__LINE__, test_ ## T (macro), bits, exact, #T, #macro, valstr)
659
660 TEST_MACRO (int_least8_t, INT_LEAST8_MIN, -8, true, "-127");
661 TEST_MACRO (int_least8_t, INT_LEAST8_MAX, -8, true, "+127");
662 TEST_MACRO (uint_least8_t, UINT_LEAST8_MAX, 8, true, "256");
663
664 TEST_MACRO (int_fast8_t, INT_FAST8_MIN, -8, true, "-127");
665 TEST_MACRO (int_fast8_t, INT_FAST8_MAX, -8, true, "+127");
666 TEST_MACRO (uint_fast8_t, UINT_FAST8_MAX, 8, true, "256");
667
668 TEST_MACRO (int_least16_t, INT_LEAST16_MIN, -16, true, "-32767");
669 TEST_MACRO (int_least16_t, INT_LEAST16_MAX, -16, true, "+32767");
670 TEST_MACRO (uint_least16_t, UINT_LEAST16_MAX, 16, true, "65535");
671
672 TEST_MACRO (int_fast16_t, INT_FAST16_MIN, -16, true, "-32767");
673 TEST_MACRO (int_fast16_t, INT_FAST16_MAX, -16, true, "+32767");
674 TEST_MACRO (uint_fast16_t, UINT_FAST16_MAX, 16, true, "65535");
675
676 TEST_MACRO (int_least32_t, INT_LEAST32_MIN, -32, true, "-2147483647");
677 TEST_MACRO (int_least32_t, INT_LEAST32_MAX, -32, true, "+2147483647");
678 TEST_MACRO (uint_least32_t, UINT_LEAST32_MAX, 32, true, "4294967295");
679
680 TEST_MACRO (int_fast32_t, INT_FAST32_MIN, -32, true, "-2147483647");
681 TEST_MACRO (int_fast32_t, INT_FAST32_MAX, -32, true, "+2147483647");
682 TEST_MACRO (uint_fast32_t, UINT_FAST32_MAX, 32, true, "4294967295");
683
684#define TEST_MACRO_NO_TYPE(macro, bits, exact, valstr) \
685 test_bits (__LINE__, macro, bits, exact, "", #macro, valstr)
686
687 TEST_MACRO_NO_TYPE (PTRDIFF_MIN, 16, false, "-65535");
688 TEST_MACRO_NO_TYPE (PTRDIFF_MAX, 16, false, "+65535");
689
690 TEST_MACRO_NO_TYPE (SIZE_MAX, 16, false, "+65535");
691
692 TEST_MACRO_NO_TYPE (SIG_ATOMIC_MIN, 8, false, "-127");
693 TEST_MACRO_NO_TYPE (SIG_ATOMIC_MAX, 8, false, "+127");
694
695 TEST_MACRO_NO_TYPE (WCHAR_MIN, 8, false, "-127");
696 TEST_MACRO_NO_TYPE (WCHAR_MAX, 8, false, "+127");
697
698 TEST_MACRO_NO_TYPE (WINT_MIN, 16, false, "-32767");
699 TEST_MACRO_NO_TYPE (WINT_MAX, 16, false, "+32768");
700
701
702 for (unsigned i = 0; missing_optional_macros [i]; ++i) {
703 rw_warn ('\0' == missing_optional_macros [i][0], 0, __LINE__,
704 "optional macro %s not defined",
705 missing_optional_macros [i]);
706 }
707
708 TEST_MACRO (int8_t, INT8_MIN, -8, true, "-128");
709 TEST_MACRO (int8_t, INT8_MAX, -8, true, "127");
710 TEST_MACRO (uint8_t, UINT8_MAX, 8, true, "256");
711
712 TEST_MACRO (int16_t, INT16_MIN, -16, true, "-32768");
713 TEST_MACRO (int16_t, INT16_MAX, -16, true, "32767");
714 TEST_MACRO (uint16_t, UINT16_MAX, 16, true, "65535");
715
716 TEST_MACRO (int32_t, INT32_MIN, -32, true, "-2147483648");
717 TEST_MACRO (int32_t, INT32_MAX, -32, true, "2147483647");
718 TEST_MACRO (uint32_t, UINT32_MAX, 32, true, "4294967295");
719
720 if (rw_opt_no_64_bit) {
721 rw_note (0, 0, 0, "tests of 64-bit macros disabled");
722 }
723 else {
724 for (unsigned i = 0; missing_64_bit_macros [i]; ++i) {
725 rw_assert ('\0' == missing_64_bit_macros [i][0], 0, __LINE__,
726 "required macro %s not defined",
727 missing_64_bit_macros [i]);
728 }
729
730 TEST_MACRO (int64_t, INT64_MIN, -64, true, "?");
731 TEST_MACRO (int64_t, INT64_MAX, -64, true, "?");
732 TEST_MACRO (uint64_t, UINT64_MAX, 64, true, "?");
733
734 TEST_MACRO (int_least64_t, INT_LEAST64_MIN, -64, true, "?");
735 TEST_MACRO (int_least64_t, INT_LEAST64_MAX, -64, true, "?");
736 TEST_MACRO (uint_least64_t, UINT_LEAST64_MAX, 64, true, "?");
737
738 TEST_MACRO (int_fast64_t, INT_FAST64_MIN, -64, true, "?");
739 TEST_MACRO (int_fast64_t, INT_FAST64_MAX, -64, true, "?");
740 TEST_MACRO (uint_fast64_t, UINT_FAST64_MAX, 64, true, "?");
741 }
742}
743
744
746static int
747run_test (int, char*[])
748{
749 test_types ();
750
751 test_macros ();
752
753 return 0;
754}
755
756
758int main (int argc, char *argv[])
759{
760 return rw_test (argc, argv, __FILE__,
761 "cstdint",
762 0 /* no comment */,
763 run_test,
764 "|-no-macros# "
765 "|-no-types# "
766 "|-no-64-bit#",
767 &rw_opt_no_macros,
768 &rw_opt_no_types,
769 &rw_opt_no_64_bit);
770}
771
772#else // _RWSTD_NO_CXX_0X
773
774static int
775run_test (int, char*[])
776{
777 rw_warn (0, 0, __LINE__,
778 "test disabled because _RWSTD_NO_EXT_CXX_0X is defined");
779 return 0;
780}
781
782int main (int argc, char *argv[])
783{
784 return rw_test (argc, argv, __FILE__,
785 "cstdint",
786 0 /* no comment */,
787 run_test,
788 0);
789}
790
791#endif // _RWSTD_NO_CXX_0X
#define i
Definition 17.names.cpp:126
#define line
Definition 17.names.cpp:490
std::Nested::test_uint64_t test_uint64_t
std::Nested::test_int_fast64_t test_int_fast64_t
std::Nested::test_intptr_t test_intptr_t
#define TEST_REQUIRED_TYPE(name, bits, exact)
std::Nested::test_int_least16_t test_int_least16_t
std::Nested::test_int_least32_t test_int_least32_t
std::Nested::test_uint_least16_t test_uint_least16_t
std::Nested::test_intmax_t test_intmax_t
std::Nested::test_uint_least64_t test_uint_least64_t
#define DEFINE_TYPE(name)
std::Nested::test_uint16_t test_uint16_t
std::Nested::test_uint8_t test_uint8_t
std::Nested::test_uint_fast8_t test_uint_fast8_t
std::Nested::test_uint_fast16_t test_uint_fast16_t
std::Nested::test_uint32_t test_uint32_t
std::Nested::test_int_fast8_t test_int_fast8_t
std::Nested::test_uintmax_t test_uintmax_t
macros
@ INT_LEAST64_MAX
@ UINT32_MAX
@ UINT_FAST8_MAX
@ INT16_MIN
@ INT_LEAST8_MIN
@ UINT_LEAST8_MAX
@ INT_FAST8_MIN
@ INT_FAST32_MIN
@ UINT8_MIN
@ UINT16_MAX
@ INT_FAST64_MAX
@ UINT_FAST16_MIN
@ INT_LEAST32_MIN
@ UINT8_MAX
@ INT_FAST16_MAX
@ SIG_ATOMIC_MIN
@ UINT_LEAST32_MIN
@ UINT_LEAST64_MAX
@ UINT_LEAST64_MIN
@ WCHAR_MAX
@ INTPTR_MAX
@ SIG_ATOMIC_MAX
@ UINT_LEAST8_MIN
@ INT_FAST64_MIN
@ UINT_FAST8_MIN
@ PTRDIFF_MIN
@ INT_FAST16_MIN
@ INT16_MAX
@ WINT_MIN
@ INT_LEAST32_MAX
@ INT64_MIN
@ INT_FAST8_MAX
@ UINT_LEAST16_MIN
@ INT_LEAST16_MAX
@ INT8_MIN
@ UINT_LEAST32_MAX
@ UINT_FAST32_MIN
@ PTRDIFF_MAX
@ INT32_MIN
@ INT32_MAX
@ UINT32_MIN
@ WCHAR_MIN
@ INT8_MAX
@ UINT16_MIN
@ UINT_FAST16_MAX
@ INT_LEAST16_MIN
@ UINTPTR_MAX
@ UINT64_MIN
@ INT64_MAX
@ UINT_FAST64_MIN
@ INT_LEAST64_MIN
@ UINT64_MAX
@ SIZE_MAX
@ INT_FAST32_MAX
@ UINT_FAST64_MAX
@ INT_LEAST8_MAX
@ UINT_FAST32_MAX
@ UINT_LEAST16_MAX
@ WINT_MAX
#define TEST_MACRO_NO_TYPE(macro, bits, exact, valstr)
std::Nested::test_int_least8_t test_int_least8_t
std::Nested::test_int_fast16_t test_int_fast16_t
std::Nested::test_int8_t test_int8_t
#define TEST_OPTIONAL_TYPE(name, bits, exact)
std::Nested::test_int64_t test_int64_t
std::Nested::test_uint_least32_t test_uint_least32_t
std::Nested::test_int32_t test_int32_t
std::Nested::test_uintptr_t test_uintptr_t
std::Nested::test_int_fast32_t test_int_fast32_t
std::Nested::test_int_least64_t test_int_least64_t
std::Nested::test_uint_least8_t test_uint_least8_t
std::Nested::test_uint_fast32_t test_uint_fast32_t
void test_bits(int line, intT testval, int expect, bool exact, const char *type_name, const char *macro_name=0, const char *valstr=0)
std::Nested::test_uint_fast64_t test_uint_fast64_t
#define TEST_MACRO(T, macro, bits, exact, valstr)
std::Nested::test_int16_t test_int16_t
const char *const missing_macros[]
Definition 21.cwchar.cpp:98
void test_types(Vector *, T *, Allocator)
void run_test(const ForwardIterator &dummy, T *, Predicate *pred)
const char * type_name()
#define main
volatile int one
Definition LIMITS.cpp:61
volatile int zero
Definition LIMITS.cpp:60
Definition json.h:5363
_TEST_EXPORT int rw_test(int argc, char *argv[], const char *filename, const char *clause, const char *comment, int(*testfun)(int, char **), const char *optspec,...)
_TEST_EXPORT int rw_note(int, const char *, int, const char *,...)
Definition driver.cpp:1664
_TEST_EXPORT int rw_assert(int, const char *, int, const char *,...)
Definition driver.cpp:1630
_TEST_EXPORT int rw_warn(int, const char *, int, const char *,...)
Definition driver.cpp:1647