diff --git a/src/gpre/int.cpp b/src/gpre/int.cpp index 8f36ec0046..45bd2063a7 100644 --- a/src/gpre/int.cpp +++ b/src/gpre/int.cpp @@ -25,7 +25,7 @@ // //____________________________________________________________ // -// $Id: int.cpp,v 1.9 2003-02-13 09:58:18 dimitr Exp $ +// $Id: int.cpp,v 1.10 2003-02-27 21:34:41 brodsom Exp $ // #include "firebird.h" @@ -63,11 +63,7 @@ static void gen_start(GPRE_REQ, POR, int); static void gen_type(ACT, int); static void gen_variable(ACT, int); static void make_port(POR, int); -#ifdef __GNUC__ -static void printa(int, TEXT *, ...) __attribute__ ((format(printf,2,3))); -#else -static void printa(int, TEXT *, ...); -#endif +static void printa(int, TEXT *, ...) ATTRIBUTE_FORMAT(2,3); static int first_flag = 0; diff --git a/src/include/firebird.h b/src/include/firebird.h index 98ad76f61c..07bbe11cf5 100644 --- a/src/include/firebird.h +++ b/src/include/firebird.h @@ -30,7 +30,7 @@ * John Bellardo * * - * $Id: firebird.h,v 1.8 2003-02-07 14:38:49 kkuznetsov Exp $ + * $Id: firebird.h,v 1.9 2003-02-27 21:34:40 brodsom Exp $ * */ @@ -47,6 +47,15 @@ #define __EXTENSIONS__ #endif +// +// Macro for function attribute definition +// +#if defined(_GNUC_) +#define ATTRIBUTE_FORMAT(a,b) __attribute__ ((format(printf,a,b))) +#else +#define ATTRIBUTE_FORMAT(a,b) +#endif + #ifdef __cplusplus #include "fb_exception.h" #endif diff --git a/src/jrd/gds.cpp b/src/jrd/gds.cpp index 7bbeb9b62b..9655eb79c7 100644 --- a/src/jrd/gds.cpp +++ b/src/jrd/gds.cpp @@ -366,13 +366,8 @@ void GDS_breakpoint(int); #endif -#ifdef __GNUC__ -static void blr_error(CTL, TEXT *, ...) __attribute__ ((format(printf,2,3))); -static void blr_format(CTL, const char *, ...) __attribute__ ((format(printf,2,3))); -#else -static void blr_error(CTL, TEXT *, ...); -static void blr_format(CTL, const char *, ...); -#endif +static void blr_error(CTL, TEXT *, ...) ATTRIBUTE_FORMAT(2,3); +static void blr_format(CTL, const char *, ...) ATTRIBUTE_FORMAT(2,3); static void blr_indent(CTL, SSHORT); static void blr_print_blr(CTL, UCHAR); static SCHAR blr_print_byte(CTL);