summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2011-06-07 23:47:32 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2011-06-08 17:45:42 -0700
commit137418c63d01d5db0dcaed257d7a26865efa53ae (patch)
tree89d4d7ead38eba025ec35d527d1f5f67394b9126
parenta2877e92bd9f9c1532b5cd12cc484ff3cdbc6a0a (diff)
Replace repeated checks for gcc with _X_ATTRIBUTE_PRINTF from xproto
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
-rw-r--r--utils.h63
1 files changed, 9 insertions, 54 deletions
diff --git a/utils.h b/utils.h
index 65e37c8..61a5987 100644
--- a/utils.h
+++ b/utils.h
@@ -115,12 +115,7 @@ extern Boolean uSetErrorFile(char * /* name */
extern void
uInformation(const char * /* s */ , ...
- )
-#if defined(__GNUC__) && \
- ((__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 6)))
- __attribute__ ((format(printf, 1, 2)))
-#endif
- ;
+ ) _X_ATTRIBUTE_PRINTF(1, 2);
#define ACTION6 uAction
#define ACTION5 uAction
@@ -131,12 +126,7 @@ uInformation(const char * /* s */ , ...
#define ACTION uAction
extern void uAction(const char * /* s */ , ...
- )
-#if defined(__GNUC__) && \
- ((__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 6)))
- __attribute__ ((format(printf, 1, 2)))
-#endif
- ;
+ ) _X_ATTRIBUTE_PRINTF(1, 2);
#define WARN6 uWarning
#define WARN5 uWarning
@@ -147,12 +137,7 @@ uInformation(const char * /* s */ , ...
#define WARN uWarning
extern void uWarning(const char * /* s */ , ...
- )
-#if defined(__GNUC__) && \
- ((__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 6)))
- __attribute__ ((format(printf, 1, 2)))
-#endif
- ;
+ ) _X_ATTRIBUTE_PRINTF(1, 2);
#define ERROR6 uError
#define ERROR5 uError
@@ -163,12 +148,7 @@ uInformation(const char * /* s */ , ...
#define ERROR uError
extern void uError(const char * /* s */ , ...
- )
-#if defined(__GNUC__) && \
- ((__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 6)))
- __attribute__ ((format(printf, 1, 2)))
-#endif
- ;
+ ) _X_ATTRIBUTE_PRINTF(1, 2);
#define FATAL6 uFatalError
#define FATAL5 uFatalError
@@ -179,12 +159,7 @@ uInformation(const char * /* s */ , ...
#define FATAL uFatalError
extern void uFatalError(const char * /* s */ , ...
- )
-#if defined(__GNUC__) && \
- ((__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 6)))
- __attribute__ ((format(printf, 1, 2)))
-#endif
- ;
+ ) _X_ATTRIBUTE_PRINTF(1, 2);
/* WSGO stands for "Weird Stuff Going On" */
#define WSGO6 uInternalError
@@ -196,12 +171,7 @@ uInformation(const char * /* s */ , ...
#define WSGO uInternalError
extern void uInternalError(const char * /* s */ , ...
- )
-#if defined(__GNUC__) && \
- ((__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 6)))
- __attribute__ ((format(printf, 1, 2)))
-#endif
- ;
+ ) _X_ATTRIBUTE_PRINTF(1, 2);
extern void uSetPreErrorMessage(char * /* msg */
);
@@ -262,21 +232,11 @@ extern
unsigned int DEBUG_VAR;
extern void uDebug(char * /* s */ , ...
- )
-#if defined(__GNUC__) && \
- ((__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 6)))
- __attribute__ ((format(printf, 1, 2)))
-#endif
- ;
+ ) _X_ATTRIBUTE_PRINTF(1, 2);
extern void uDebugNOI( /* no indent */
char * /* s */ , ...
- )
-#if defined(__GNUC__) && \
- ((__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 6)))
- __attribute__ ((format(printf, 1, 2)))
-#endif
- ;
+ ) _X_ATTRIBUTE_PRINTF(1, 2);
extern Boolean uSetDebugFile(char *name);
@@ -316,12 +276,7 @@ extern
extern Boolean uSetEntryFile(char *name);
extern void uEntry(int /* l */ ,
char * /* s */ , ...
- )
-#if defined(__GNUC__) && \
- ((__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 6)))
- __attribute__ ((format(printf, 2, 3)))
-#endif
- ;
+ ) _X_ATTRIBUTE_PRINTF(2, 3);
extern void uExit(int l, char *rtVal);
#ifdef ENTRY_TRACKING_ON