4 #if !defined _CRT_SECURE_NO_WARNINGS && defined(_MSC_VER)
5 #define _CRT_SECURE_NO_WARNINGS /* NOLINT */
6 #endif /* _CRT_SECURE_NO_WARNINGS */
11 #pragma warning(disable : 4127)
12 #pragma warning(disable : 4820)
14 #if defined(__cplusplus) && (__cplusplus > 201100L)
15 #include <type_traits>
16 #endif /* __cplusplus */
17 #if A_PREREQ_GNUC(2, 95) || __has_warning("-Winline")
18 #pragma GCC diagnostic ignored "-Winline"
20 #if A_PREREQ_GNUC(2, 95) || __has_warning("-Wpadded")
21 #pragma GCC diagnostic ignored "-Wpadded"
23 #if A_PREREQ_GNUC(4, 6) || __has_warning("-Wdouble-promotion")
24 #if defined(A_REAL_TYPE) && (A_REAL_TYPE + 0 == A_REAL_SINGLE)
25 #pragma GCC diagnostic ignored "-Wdouble-promotion"
26 #endif /* A_REAL_TYPE + 0 == 0x04 */
27 #endif /* -Wdouble-promotion */
29 #if A_REAL_TYPE + 0 == A_REAL_SINGLE
30 #define strtonum(string, endptr) strtof(string, endptr)
31 #elif A_REAL_TYPE + 0 == A_REAL_DOUBLE
32 #define strtonum(string, endptr) strtod(string, endptr)
33 #elif A_REAL_TYPE + 0 == A_REAL_EXTEND
34 #define strtonum(string, endptr) strtold(string, endptr)
35 #endif /* A_REAL_TYPE */
37 #define TEST_IS1(expression, message) \
41 (void)fprintf(stderr, "%s:%i:%s\n", __FILE__, __LINE__, message); \
45 #define TEST_IS0(expression, message) \
49 (void)fprintf(stderr, "%s:%i:%s\n", __FILE__, __LINE__, message); \
53 #define TEST_BUG(expression) TEST_IS1(expression, #expression)
56 #if defined(__cplusplus)
58 #endif /* __cplusplus */
59 int MAIN(_c
)(int argc
, char *argv
[]);
60 int MAIN(_x
)(int argc
, char *argv
[]);
61 int main_init(int argc
, char *argv
[], int arg1
);
62 int debug(char const *fmt
, ...) A_FORMAT(printf
, 1, 2);
63 #if defined(__cplusplus)
65 #endif /* __cplusplus */
66 #if !defined __cplusplus
67 static void main_exit(void);
68 int main_init(int argc
, char *argv
[], int arg1
)
70 static FILE *out
= A_NULL
;
71 if (!out
&& argc
> arg1
)
73 out
= freopen(argv
[arg1
], "wb", stdout
);
74 if (out
) { arg1
= atexit(main_exit
); }
78 int main(int argc
, char *argv
[])
82 status
+= MAIN(_x
)(argc
, argv
);
84 status
+= MAIN(_c
)(argc
, argv
);
87 int debug(char const *fmt
, ...)
91 static void main_exit(void)
93 if (fclose(stdout
)) {}
96 #else /* !__cplusplus */
98 #endif /* __cplusplus */
99 #if defined(HAS_CXX) == \
102 #endif /* __cplusplus */
105 #endif /* test/test.h */