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:
888be1df7c6f962725a28a172a5394eec3e228e7 2019-12-22 21:42:04 +01:00
parent e97f6b5d8d
commit 5a57a409a1

View File

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