Fix memset_s() compilation errors under macOS with some SDKs

Define __STDC_WANT_LIB_EXT1__ as early as possible to ensure that it's
defined before string.h is included by some other header without it.

Closes #19334.
This commit is contained in:
Vadim Zeitlin
2021-12-03 15:23:26 +01:00
parent 30fceb1d92
commit 149db36bc8

View File

@@ -18,6 +18,10 @@
// for compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
// Define this as soon as possible and before string.h is included to get
// memset_s() declaration from it if available.
#define __STDC_WANT_LIB_EXT1__ 1
#include "wx/utils.h"
#if !defined(HAVE_SETENV) && defined(HAVE_PUTENV)
@@ -113,8 +117,6 @@
#define _LANGUAGE_C_PLUS_PLUS 1
#endif // SGI hack
#define __STDC_WANT_LIB_EXT1__ 1 // for memset_s() in <string.h>
#include <stdarg.h>
#include <dirent.h>
#include <string.h>