Skip to content

Commit

Permalink
try mingw printf format fix
Browse files Browse the repository at this point in the history
  • Loading branch information
vszakats committed Dec 14, 2023
1 parent 9fbe3fd commit 2a4a266
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions include/curl/mprintf.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,12 @@ extern "C" {
#if (defined(__GNUC__) || defined(__clang__)) && \
defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && \
!defined(CURL_NO_FMT_CHECKS)
#ifdef __MINGW32__
#define CURL_TEMP_PRINTF(a,b) __attribute__ \
((format(__MINGW_PRINTF_FORMAT, a, b)))
#else
#define CURL_TEMP_PRINTF(a,b) __attribute__ ((format(printf, a, b)))
#endif
#else
#define CURL_TEMP_PRINTF(a,b)
#endif
Expand Down
5 changes: 5 additions & 0 deletions lib/curl_setup.h
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,12 @@
#if (defined(__GNUC__) || defined(__clang__)) && \
defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && \
!defined(CURL_NO_FMT_CHECKS)
#ifdef __MINGW32__
#define CURL_PRINTF(fmt, arg) \
__attribute__((format(__MINGW_PRINTF_FORMAT, fmt, arg)))
#else
#define CURL_PRINTF(fmt, arg) __attribute__((format(__printf__, fmt, arg)))
#endif
#else
#define CURL_PRINTF(fmt, arg)
#endif
Expand Down

0 comments on commit 2a4a266

Please sign in to comment.