Skip to content

Commit

Permalink
Add Foundation patches
Browse files Browse the repository at this point in the history
  • Loading branch information
colemancda committed Apr 5, 2024
1 parent 9a65e28 commit 5c01dc7
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 171 deletions.
39 changes: 39 additions & 0 deletions patches/foundation/001-Foundation-strlcpy.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
diff --git a/CoreFoundation/Base.subproj/CoreFoundation_Prefix.h b/CoreFoundation/Base.subproj/CoreFoundation_Prefix.h
index bf6f203b..cc9dabd5 100644
--- a/CoreFoundation/Base.subproj/CoreFoundation_Prefix.h
+++ b/CoreFoundation/Base.subproj/CoreFoundation_Prefix.h
@@ -189,34 +189,6 @@ static dispatch_queue_t __ ## PREFIX ## Queue(void) { \
#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
-CF_INLINE size_t
-strlcpy(char * dst, const char * src, size_t maxlen) {
- const size_t srclen = strlen(src);
- if (srclen < maxlen) {
- memcpy(dst, src, srclen+1);
- } else if (maxlen != 0) {
- memcpy(dst, src, maxlen-1);
- dst[maxlen-1] = '\0';
- }
- return srclen;
-}
-
-CF_INLINE size_t
-strlcat(char * dst, const char * src, size_t maxlen) {
- const size_t srclen = strlen(src);
- const size_t dstlen = strnlen(dst, maxlen);
- if (dstlen == maxlen) return maxlen+srclen;
- if (srclen < maxlen-dstlen) {
- memcpy(dst+dstlen, src, srclen+1);
- } else {
- memcpy(dst+dstlen, src, maxlen-dstlen-1);
- dst[maxlen-1] = '\0';
- }
- return dstlen + srclen;
-}
-#endif
-
#if TARGET_OS_WIN32
// Compatibility with boolean.h
#if defined(__x86_64__)
17 changes: 0 additions & 17 deletions patches/sourcekit-lsp/001-sourcekit-lsp-build-script-helper.patch

This file was deleted.

79 changes: 0 additions & 79 deletions patches/swift/001-swift-float16.patch

This file was deleted.

22 changes: 0 additions & 22 deletions patches/swift/002-swift-include-swift-AST-Expr.h.patch

This file was deleted.

13 changes: 0 additions & 13 deletions patches/swift/003-swift-include-swift-Basic-BridgingUtils.h.patch

This file was deleted.

15 changes: 0 additions & 15 deletions patches/swift/004-swift-targets.patch

This file was deleted.

25 changes: 0 additions & 25 deletions patches/swiftpm/001-swiftpm-bootstrap.patch

This file was deleted.

0 comments on commit 5c01dc7

Please sign in to comment.