comparison th_util.h @ 746:a557d1b2a356

Move TH_ATTR_PRINTF_FMT macro definition to th_types.h and improve the preprocessor checks. Apparently newer versions (not sure since which version exactly) seem to work fine with the attribute defined. Enabling for MinGW GCC >= 12 for now, though it may have worked earlier.
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 21 Dec 2022 13:19:02 +0200
parents b415b70254fa
children db1a132c7754
comparison
equal deleted inserted replaced
745:0c90dd46c49f 746:a557d1b2a356
34 #endif 34 #endif
35 35
36 36
37 #ifdef __cplusplus 37 #ifdef __cplusplus
38 extern "C" { 38 extern "C" {
39 #endif
40
41
42 // Kludge, as MinGW64 cross-compiler does not like certain printf() format specifiers
43 #if defined(__MINGW64__)
44 # define TH_ATTR_PRINTF_FMT(xstart, xend)
45 #else
46 # define TH_ATTR_PRINTF_FMT(xstart, xend) __attribute__ ((__format__ (__printf__, (xstart), (xend))))
47 #endif 39 #endif
48 40
49 41
50 // Replacement for assert() 42 // Replacement for assert()
51 #ifdef HAVE_NO_ASSERT 43 #ifdef HAVE_NO_ASSERT