X-Git-Url: http://git.efficios.com/?p=argpar.git;a=blobdiff_plain;f=argpar%2Fargpar.c;h=13f66812894037b669924eb4446fd3f5472e464b;hp=b8b7c6307d82ead3741bffe4bfc003282981aee3;hb=1ae22b5e8335dfe14b805404a16b90817f1a99e1;hpb=92ecd98e487729d7ec268a986390b624fc394feb diff --git a/argpar/argpar.c b/argpar/argpar.c index b8b7c63..13f6681 100644 --- a/argpar/argpar.c +++ b/argpar/argpar.c @@ -35,7 +35,13 @@ #define ARGPAR_ASSERT(_cond) assert(_cond) -static +#ifdef __MINGW_PRINTF_FORMAT +# define ARGPAR_PRINTF_FORMAT __MINGW_PRINTF_FORMAT +#else +# define ARGPAR_PRINTF_FORMAT printf +#endif + +static __attribute__((format(ARGPAR_PRINTF_FORMAT, 1, 0))) char *argpar_vasprintf(const char *fmt, va_list args) { int len1, len2; @@ -65,7 +71,7 @@ end: } -static +static __attribute__((format(ARGPAR_PRINTF_FORMAT, 1, 2))) char *argpar_asprintf(const char *fmt, ...) { va_list args; @@ -78,7 +84,7 @@ char *argpar_asprintf(const char *fmt, ...) return str; } -static +static __attribute__((format(ARGPAR_PRINTF_FORMAT, 2, 3))) bool argpar_string_append_printf(char **str, const char *fmt, ...) { char *new_str = NULL;