Blob Blame History Raw
diff --color -Naur swift-corelibs-foundation-orig/CoreFoundation/Base.subproj/CoreFoundation_Prefix.h swift-corelibs-foundation/CoreFoundation/Base.subproj/CoreFoundation_Prefix.h
--- swift-corelibs-foundation-orig/CoreFoundation/Base.subproj/CoreFoundation_Prefix.h	2023-07-06 10:02:48.000000000 -0500
+++ swift-corelibs-foundation/CoreFoundation/Base.subproj/CoreFoundation_Prefix.h	2023-08-16 12:53:42.332226574 -0500
@@ -189,7 +189,7 @@
 #define CF_RETAIN_BALANCED_ELSEWHERE(obj, identified_location) do { } while (0)
 #endif
 
-#if (TARGET_OS_LINUX && !TARGET_OS_ANDROID && !TARGET_OS_CYGWIN) || TARGET_OS_WIN32
+#if (TARGET_OS_LINUX && !TARGET_OS_ANDROID && !TARGET_OS_CYGWIN && !ALREADY_HAVE_STRL_FUNCS) || TARGET_OS_WIN32
 CF_INLINE size_t
 strlcpy(char * dst, const char * src, size_t maxlen) {
     const size_t srclen = strlen(src);
diff --color -Naur swift-corelibs-foundation-orig/CoreFoundation/CMakeLists.txt swift-corelibs-foundation/CoreFoundation/CMakeLists.txt
--- swift-corelibs-foundation-orig/CoreFoundation/CMakeLists.txt	2023-07-06 10:02:48.000000000 -0500
+++ swift-corelibs-foundation/CoreFoundation/CMakeLists.txt	2023-08-16 12:53:44.851386844 -0500
@@ -80,6 +80,11 @@
         add_compile_definitions($<$<COMPILE_LANGUAGE:C>:HAVE_SCHED_GETAFFINITY>)
       endif()
     endif()
+    # XYZZY
+    check_symbol_exists(strlcpy "string.h" HAVE_NEW_GLIBC)
+    if(HAVE_NEW_GLIBC)
+      add_compile_definitions($<$<COMPILE_LANGUAGE:C>:ALREADY_HAVE_STRL_FUNCS>)
+    endif()
   endif()
 elseif(CMAKE_SYSTEM_NAME STREQUAL Windows)
   # NOTE(compnerd) we only support building with the dynamic CRT as using the