changeset 28604:d4d8a3c89e6d

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
author Jun Wu <quark@fb.com>
date Sun, 20 Mar 2016 15:25:25 -0700
parents f467073cd798
children baa073200ba2
files contrib/chg/util.h
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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_;