From 2a3cca7c5671483081779054d8a90a94a6d019d7 Mon Sep 17 00:00:00 2001 From: Glenn Strauss Date: Sun, 10 Oct 2021 14:09:12 -0400 Subject: [PATCH] [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 --- src/ck.h | 5 +++++ src/first.h | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/src/ck.h b/src/ck.h index c8ab4b4e..4389d746 100644 --- a/src/ck.h +++ b/src/ck.h @@ -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 */ diff --git a/src/first.h b/src/first.h index 9f8380f4..defd1989 100644 --- a/src/first.h +++ b/src/first.h @@ -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