Fix the printf attribute for MingW

This commit is contained in:
Andrea Mazzoleni 2015-02-16 18:42:52 +01:00
parent 14c8307ed4
commit fba7cdcbe2
2 changed files with 18 additions and 5 deletions

View file

@ -32,6 +32,19 @@
#include <windows.h>
#endif
/**
* Specify the format attribute for printf.
*/
#ifdef __MINGW32__
#ifdef __USE_MINGW_ANSI_STDIO
#define attribute_printf gnu_printf /* GNU format */
#else
#define attribute_printf ms_printf /* MSVCRT format */
#endif
#else
#define attribute_printf printf /* GNU format is the default one */
#endif
/**
* Compiler extension
*/