diff options
Diffstat (limited to 'src/localconsts.h')
-rw-r--r-- | src/localconsts.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/localconsts.h b/src/localconsts.h index a120ed9d7..6d922ab09 100644 --- a/src/localconsts.h +++ b/src/localconsts.h @@ -171,6 +171,32 @@ #define gnu_printf printf #endif // __clang__ + +#ifdef __GNUC__ + #ifdef __OpenBSD__ + #define A_FORMAT_PRINTF(fmtIndex, firstArgIndex) \ + __attribute__((__format__(printf, (fmtIndex), (firstArgIndex)))) + #else // __OpenBSD__ + + #ifdef BAD_CILKPLUS + // This one is 0-indexed? + #define A_FORMAT_PRINTF(fmtIndex, firstArgIndex) \ + __attribute__((__format__(gnu_printf, \ + ((fmtIndex) - 1), \ + ((firstArgIndex)-1) \ + ))) + #else // BAD_CILKPLUS + #define A_FORMAT_PRINTF(fmtIndex, firstArgIndex) \ + __attribute__((__format__(gnu_printf, \ + (fmtIndex), \ + (firstArgIndex) \ + ))) + #endif // BAD_CILKPLUS + + #endif // __OpenBSD__ +#endif // __GNUC__ + + #ifdef ADVGCC #define const2 const |