chg: define PRINTF_FORMAT_ for non gnu C compiler
authorJun Wu <quark@fb.com>
Sun, 20 Mar 2016 15:25:25 -0700
changeset 28604 d4d8a3c89e6d
parent 28603 f467073cd798
child 28605 baa073200ba2
chg: define PRINTF_FORMAT_ for non gnu C compiler Before this patch, if __GNUC__ is not defined, PRINTF_FORMAT_ will not be defined and will cause compilation error. This patch solves the issue by making sure PRINTF_FORMAT_ is defined. It allows chg to be compiled with tcc (http://bellard.org/tcc/) by: tcc -o chg *.c
contrib/chg/util.h
--- a/contrib/chg/util.h	Sun Mar 20 15:11:34 2016 -0700
+++ b/contrib/chg/util.h	Sun Mar 20 15:25:25 2016 -0700
@@ -12,6 +12,8 @@
 
 #ifdef __GNUC__
 #define PRINTF_FORMAT_ __attribute__((format(printf, 1, 2)))
+#else
+#define PRINTF_FORMAT_
 #endif
 
 void abortmsg(const char *fmt, ...) PRINTF_FORMAT_;