apple / swift-corelibs-foundation

The Foundation Project, providing core utilities, internationalization, and OS independence
swift.org
Apache License 2.0
5.23k stars 1.12k forks source link

🍒 [5.10] Check for strlcpy/strlcat #4949

Closed etcwilde closed 1 month ago

etcwilde commented 2 months ago

Some newer builds of glibc have strlcpy and strlcat defined, resulting in build failures on newer Linux distros. Rather than try to hard-code whether or not each version of each platform has strlcat and strlcpy, this patch has CMake check to see if it's available after including string.h. If they are, then we should not redefine them.

This is a targeted change pulling the fix from the patch set merged in 5a1db791ab824e29dc45ce08f729d3541f0517d0.

etcwilde commented 2 months ago

@swift-ci please test

etcwilde commented 2 months ago

@swift-ci please clean test Linux Platform

etcwilde commented 2 months ago

@swift-ci please test

etcwilde commented 2 months ago

TARGET_OS_MAC is always defined. It might be 0 or 1, but #ifndef doesn't work.... Bah!

etcwilde commented 2 months ago

@swift-ci please test Windows