Enable __USE_MINGW_ANSI_STDIO for C99 and C++11 when not using UCRT

C99 and C++11 standards requires printf ll modifier for long long type but
it does not work in WinXP system msvcrt.dll. It requires at least library
msvcr80.dll.

So when gcc is invoked with --std=c99 (or new) or --std=c++11 (or new) ansi
stdio macro needs to be enabled for printf ll modifier support.

It is already enabled for _ISOC99_SOURCE but apparently new version of gcc
set only __STDC_VERSION__ and __cplusplus numeric macros to version of
C/C++ standard. So enable __USE_MINGW_ANSI_STDIO based on them.

Also GNU version of printf supports ll modifier in C mode, so enable
__USE_MINGW_ANSI_STDIO also for _GNU_SOURCE C mode (not only C++).

Signed-off-by: Liu Hao <lh_mouse@126.com>
1 file changed