diff options
-rw-r--r-- | include/ruby/defines.h | 4 | ||||
-rw-r--r-- | tool/m4/ruby_check_printf_prefix.m4 | 4 | ||||
-rw-r--r-- | tool/m4/ruby_mingw32.m4 | 1 |
3 files changed, 5 insertions, 4 deletions
diff --git a/include/ruby/defines.h b/include/ruby/defines.h index f5fd5bfcef..b7409a3e6c 100644 --- a/include/ruby/defines.h +++ b/include/ruby/defines.h @@ -90,9 +90,9 @@ extern "C" { #endif /* __GNUC__ >= 3 */ #ifdef __GNUC__ -#ifdef __MINGW32__ +#if defined __MINGW_PRINTF_FORMAT #define PRINTF_ARGS(decl, string_index, first_to_check) \ - decl __attribute__((format(gnu_printf, string_index, first_to_check))) + decl __attribute__((format(__MINGW_PRINTF_FORMAT, string_index, first_to_check))) #else #define PRINTF_ARGS(decl, string_index, first_to_check) \ decl __attribute__((format(printf, string_index, first_to_check))) diff --git a/tool/m4/ruby_check_printf_prefix.m4 b/tool/m4/ruby_check_printf_prefix.m4 index eab5dbeac6..9007c18c0a 100644 --- a/tool/m4/ruby_check_printf_prefix.m4 +++ b/tool/m4/ruby_check_printf_prefix.m4 @@ -8,9 +8,9 @@ AC_CACHE_CHECK([for printf prefix for $1], [rb_cv_pri_prefix_]AS_TR_SH($1),[ [@%:@include <stdio.h> @%:@include <stddef.h> @%:@ifdef __GNUC__ - @%:@ifdef __MINGW32__ + @%:@if defined __MINGW_PRINTF_FORMAT @%:@define PRINTF_ARGS(decl, string_index, first_to_check) \ - decl __attribute__((format(gnu_printf, string_index, first_to_check))) + decl __attribute__((format(__MINGW_PRINTF_FORMAT, string_index, first_to_check))) @%:@else @%:@define PRINTF_ARGS(decl, string_index, first_to_check) \ decl __attribute__((format(printf, string_index, first_to_check))) diff --git a/tool/m4/ruby_mingw32.m4 b/tool/m4/ruby_mingw32.m4 index 57b83f26ee..f44fe5575c 100644 --- a/tool/m4/ruby_mingw32.m4 +++ b/tool/m4/ruby_mingw32.m4 @@ -12,6 +12,7 @@ rm -f conftest*]) AS_IF([test "$rb_cv_mingw32" = yes], [ target_os="mingw32" : ${ac_tool_prefix:="`expr "$CC" : ['\(.*-\)g\?cc[^/]*$']`"} + AC_DEFINE(__USE_MINGW_ANSI_STDIO, 1) dnl for gnu_printf ]) ]) AS_CASE(["$target_os"], [mingw*msvc], [ |