From 5a57a409a1a01471fb513b99a5f52d3dca23d430 Mon Sep 17 00:00:00 2001 From: 888be1df7c6f962725a28a172a5394eec3e228e7 <888be1df7c6f962725a28a172a5394eec3e228e7@redacted> 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 00ff0be9..dcc94bc8 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', )