[ruby/prism] [Compatibility] Improve printf format
For better compatibility, this patch suggests using __MINGW_PRINTF_FORMAT that GCC provides for MINGW environment. https://github.com/ruby/prism/commit/a3a792b64f
This commit is contained in:
parent
6c1e8029d0
commit
ce544f8dbd
@ -49,7 +49,11 @@
|
|||||||
* compiler-agnostic way.
|
* compiler-agnostic way.
|
||||||
*/
|
*/
|
||||||
#if defined(__GNUC__)
|
#if defined(__GNUC__)
|
||||||
|
# if defined(__MINGW_PRINTF_FORMAT)
|
||||||
|
# define PRISM_ATTRIBUTE_FORMAT(string_index, argument_index) __attribute__((format(__MINGW_PRINTF_FORMAT, string_index, argument_index)))
|
||||||
|
# else
|
||||||
# define PRISM_ATTRIBUTE_FORMAT(string_index, argument_index) __attribute__((format(printf, string_index, argument_index)))
|
# define PRISM_ATTRIBUTE_FORMAT(string_index, argument_index) __attribute__((format(printf, string_index, argument_index)))
|
||||||
|
# endif
|
||||||
#elif defined(__clang__)
|
#elif defined(__clang__)
|
||||||
# define PRISM_ATTRIBUTE_FORMAT(string_index, argument_index) __attribute__((__format__(__printf__, string_index, argument_index)))
|
# define PRISM_ATTRIBUTE_FORMAT(string_index, argument_index) __attribute__((__format__(__printf__, string_index, argument_index)))
|
||||||
#else
|
#else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user