[core] earlier macOS need define for errno_t (fixes #3107)

Earlier macOS need _DARWIN_C_SOURCE defined for errno_t from sys/types.h

Alternatively, define __STDC_WANT_LIB_EXT1__ >= 1 before include errno.h

x-ref:
  "error: unknown type name 'errno_t' (macOS 10.13.6)"
  https://redmine.lighttpd.net/issues/3107
personal/stbuehler/tests-path
Glenn Strauss 2021-10-10 14:09:12 -04:00
parent 124543bbe1
commit 2a3cca7c56
2 changed files with 11 additions and 0 deletions

View File

@ -12,6 +12,11 @@
#ifndef __STDC_WANT_LIB_EXT1__ /*(enable C11 Annex K ext1 *_s functions)*/
#define __STDC_WANT_LIB_EXT1__ 1
#endif
#if defined(__APPLE__) && defined(__MACH__)
#ifndef _DARWIN_C_SOURCE
#define _DARWIN_C_SOURCE
#endif
#endif
#include "first.h"
#ifdef __FreeBSD__
#ifndef _RSIZE_T_DEFINED /* expecting __EXT1_VISIBLE 1 and _RSIZE_T_DEFINED */

View File

@ -13,6 +13,12 @@
#define _DEFAULT_SOURCE
#endif
#if defined(__APPLE__) && defined(__MACH__)
#ifndef _DARWIN_C_SOURCE
#define _DARWIN_C_SOURCE
#endif
#endif
#ifndef __STDC_WANT_LIB_EXT1__
#define __STDC_WANT_LIB_EXT1__ 1
#endif