changeset 97:83ad94eec98f

don't rely on netbsd cdefs.h
author David A. Holland
date Mon, 10 Jun 2013 23:46:47 -0400
parents 408331be8792
children 51848a7584e0
files utils.h
diffstat 1 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/utils.h	Mon Jun 10 23:33:37 2013 -0400
+++ b/utils.h	Mon Jun 10 23:46:47 2013 -0400
@@ -32,6 +32,13 @@
 
 struct place;
 
+#if defined(__CLANG__) || defined(__GNUC__)
+#define PF(a, b) __attribute__((__format__(__printf__, a, b)))
+#define DEAD __attribute__((__noreturn__))
+#else
+#define PF(a, b)
+#define DEAD
+#endif
 
 #define HOWMANY(arr) (sizeof(arr)/sizeof((arr)[0]))
 
@@ -53,10 +60,10 @@
 bool is_identifier(const char *str);
 
 /* in place.c */
-void complain(const struct place *, const char *fmt, ...) __printflike(2, 3);
+void complain(const struct place *, const char *fmt, ...) PF(2, 3);
 void complain_fail(void);
 bool complain_failed(void);
 
 /* in main.c */
 void freestringlater(char *s);
-__dead void die(void);
+DEAD void die(void);