From ad24fe10bb5222dc42454ba212d47efe70f0b497 Mon Sep 17 00:00:00 2001 From: Shiz Date: Sun, 22 Dec 2019 21:42:04 +0100 Subject: [PATCH] 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/. --- meson.build | 1 + 1 file changed, 1 insertion(+) diff --git a/meson.build b/meson.build index 00ff0be..dcc94bc 100644 --- a/meson.build +++ b/meson.build @@ -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', )