summaryrefslogtreecommitdiff
path: root/base.h
diff options
context:
space:
mode:
Diffstat (limited to 'base.h')
-rw-r--r--base.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/base.h b/base.h
index 2af0820..5fa2b15 100644
--- a/base.h
+++ b/base.h
@@ -111,6 +111,12 @@ typedef unsigned long long ullong;
#define WarnUnusedResult
#endif
+#if __GNUC__
+#define ATTRIBUTE_PRINTF(fmt_idx, arg_idx) __attribute__ ((format(printf, fmt_idx, arg_idx)))
+#else
+#define ATTRIBUTE_PRINTF(fmt_idx, arg_idx)
+#endif
+
#define Status bool WarnUnusedResult // false = error, true = success
#define arr_count(a) (sizeof (a) / sizeof *(a))