build: enable "secure" CRT headers on MinGW

Some distributions of MinGW, recent builds included, require
`MINGW_HAS_SECURE_API` to be defined in order to expose `_s` variants of
functions, as defined by Annex K of the C standard, in the headers.

Omitting this definition leads to a bunch of compiler warnings clobbering
the build output, as well as possibly incorrect inference of argument and
return types by the compiler.

It needs to be set to `1` as opposed to simply defined as per
https://sourceforge.net/p/mingw-w64/bugs/714/.
This commit is contained in:
Shiz 2019-12-22 21:42:04 +01:00
parent 0d8dd05ceb
commit ad24fe10bb

View File

@ -5,6 +5,7 @@ add_project_arguments(
'-DDIRECTINPUT_VERSION=0x0800', '-DDIRECTINPUT_VERSION=0x0800',
'-DWIN32_LEAN_AND_MEAN', '-DWIN32_LEAN_AND_MEAN',
'-D_WIN32_WINNT=_WIN32_WINNT_WIN7', '-D_WIN32_WINNT=_WIN32_WINNT_WIN7',
'-DMINGW_HAS_SECURE_API=1',
language: 'c', language: 'c',
) )