From a804b3851ddd0bef1f95814b417b56676e62a6dd Mon Sep 17 00:00:00 2001 From: soloturn Date: Mon, 19 Jul 2021 09:29:44 +0200 Subject: [PATCH 1/2] asprintf exists on linux asprintf exists on linux for quite a while, 2015 at least. do use it. (cherry picked from commit 865bc7031288fe7873aad310310641997b73ca0c) --- CoreFoundation/Base.subproj/CFPlatform.c | 2 +- CoreFoundation/Base.subproj/CoreFoundation_Prefix.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CoreFoundation/Base.subproj/CFPlatform.c b/CoreFoundation/Base.subproj/CFPlatform.c index e54aab368a..76f79be7ce 100644 --- a/CoreFoundation/Base.subproj/CFPlatform.c +++ b/CoreFoundation/Base.subproj/CFPlatform.c @@ -1510,7 +1510,7 @@ void _CF_dispatch_once(dispatch_once_t *predicate, void (^block)(void)) { #pragma mark - #pragma mark Windows and Linux Helpers -#if TARGET_OS_WIN32 || TARGET_OS_LINUX +#if TARGET_OS_WIN32 #include diff --git a/CoreFoundation/Base.subproj/CoreFoundation_Prefix.h b/CoreFoundation/Base.subproj/CoreFoundation_Prefix.h index 956b5b0524..8951de9ec7 100644 --- a/CoreFoundation/Base.subproj/CoreFoundation_Prefix.h +++ b/CoreFoundation/Base.subproj/CoreFoundation_Prefix.h @@ -448,7 +448,7 @@ CF_INLINE int popcountll(long long x) { #define CF_TEST_PRIVATE CF_PRIVATE #endif -#if TARGET_OS_LINUX || TARGET_OS_WIN32 +#if TARGET_OS_WIN32 #include From e9582e12dbbd2975b8fb6ff611030b0d133cab09 Mon Sep 17 00:00:00 2001 From: Evan Wilde Date: Fri, 8 Jul 2022 14:06:50 -0700 Subject: [PATCH 2/2] asprintf is defined when _GNU_SOURCE is set Not all layers of the c library have asprintf defined, however, it is available when `_GNU_SOURCE` is set. (cherry picked from commit 96ddfc08a4ddb45eaa704714da04fc026024831f) --- CoreFoundation/Base.subproj/CFPlatform.c | 2 +- CoreFoundation/Base.subproj/CoreFoundation_Prefix.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CoreFoundation/Base.subproj/CFPlatform.c b/CoreFoundation/Base.subproj/CFPlatform.c index 76f79be7ce..c2ce76e800 100644 --- a/CoreFoundation/Base.subproj/CFPlatform.c +++ b/CoreFoundation/Base.subproj/CFPlatform.c @@ -1510,7 +1510,7 @@ void _CF_dispatch_once(dispatch_once_t *predicate, void (^block)(void)) { #pragma mark - #pragma mark Windows and Linux Helpers -#if TARGET_OS_WIN32 +#if TARGET_OS_WIN32 || (TARGET_OS_LINUX && !defined(_GNU_SOURCE)) #include diff --git a/CoreFoundation/Base.subproj/CoreFoundation_Prefix.h b/CoreFoundation/Base.subproj/CoreFoundation_Prefix.h index 8951de9ec7..bf6f203b5f 100644 --- a/CoreFoundation/Base.subproj/CoreFoundation_Prefix.h +++ b/CoreFoundation/Base.subproj/CoreFoundation_Prefix.h @@ -448,7 +448,7 @@ CF_INLINE int popcountll(long long x) { #define CF_TEST_PRIVATE CF_PRIVATE #endif -#if TARGET_OS_WIN32 +#if TARGET_OS_WIN32 || (TARGET_OS_LINUX && !defined(_GNU_SOURCE)) #include