Added check for existing strlcpy/strlcat on Linux #4811
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The GNU C Library version 2.38 introduced
strlcat()
andstrlcpy()
for the first time (https://lists.gnu.org/archive/html/info-gnu/2023-07/msg00010.html). Because these functions are defined inCoreFoundation/Base.subproj/CoreFoundation_Prefix.h
there is a compile error in that theCF_INLINE
expands to includestatic
, which the glibc versions do not. Even if the function signatures were the same, there would be link errors due to multiple definitions found of the same functions.This patch adds an additional check in the CMakeFiles.txt file under the Linux section for the functions and, if found, defines a flag that prevents the functions from being defined in
CoreFoundation/Base.subproj/CoreFoundation_Prefix.h
.