Libc: Merge TARGET_OS_EMBEDDED patches

Both patches implement the same fix so they'll probably have to be
removed at the same time. This avoids one of them being left behind.

authored by

toonn and committed by
Jonathan Ringer
e33c11a5 19678c4e

+48 -60
+47
pkgs/os-specific/darwin/apple-source-releases/Libc/0001-Define-TARGET_OS_EMBEDDED-in-std-lib-io-if-not-defin.patch
··· 1 + From 187d0e8847d080790b22724352e51de50d214dd8 Mon Sep 17 00:00:00 2001 2 + From: toonn <toonn@toonn.io> 3 + Date: Tue, 27 Jul 2021 15:12:14 +0200 4 + Subject: [PATCH] Define TARGET_OS_EMBEDDED in std{lib,io} if not defined 5 + 6 + Originally attempted including `TargetConditionals.h` but this had 7 + knock-on effects, for example, breaking the zlib build because of 8 + `TARGET_OS_MAC` getting defined. 9 + 10 + This should be the lowest impact solution and corresponds to the default 11 + behavior IIUC. 12 + --- 13 + include/stdio.h | 3 +++ 14 + include/stdlib.h | 3 +++ 15 + 2 files changed, 6 insertions(+) 16 + 17 + diff --git a/include/stdio.h b/include/stdio.h 18 + index d0cf7a5..487496e 100644 19 + --- a/include/stdio.h 20 + +++ b/include/stdio.h 21 + @@ -351,6 +351,9 @@ __END_DECLS 22 + /* Additional functionality provided by: 23 + * POSIX.2-1992 C Language Binding Option 24 + */ 25 + +#ifndef TARGET_OS_EMBEDDED 26 + +# define TARGET_OS_EMBEDDED 0 27 + +#endif 28 + #if TARGET_OS_EMBEDDED 29 + #define __swift_unavailable_on(osx_msg, ios_msg) __swift_unavailable(ios_msg) 30 + #else 31 + diff --git a/include/stdlib.h b/include/stdlib.h 32 + index c04d3a7..0b454ba 100644 33 + --- a/include/stdlib.h 34 + +++ b/include/stdlib.h 35 + @@ -183,6 +183,9 @@ unsigned long long 36 + #ifndef LIBC_ALIAS_SYSTEM 37 + //End-Libc 38 + 39 + +#ifndef TARGET_OS_EMBEDDED 40 + +# define TARGET_OS_EMBEDDED 0 41 + +#endif 42 + #if TARGET_OS_EMBEDDED 43 + #define __swift_unavailable_on(osx_msg, ios_msg) __swift_unavailable(ios_msg) 44 + #else 45 + -- 46 + 2.17.2 (Apple Git-113) 47 +
-32
pkgs/os-specific/darwin/apple-source-releases/Libc/0001-Define-TARGET_OS_EMBEDDED-in-stdlib-if-not-defined.patch
··· 1 - From c0ab867bb7888401957539b0348902028a2be6e0 Mon Sep 17 00:00:00 2001 2 - From: toonn <toonn@toonn.io> 3 - Date: Tue, 27 Jul 2021 15:12:14 +0200 4 - Subject: [PATCH] Define TARGET_OS_EMBEDDED in stdlib if not defined 5 - 6 - Originally attempted including `TargetConditionals.h` but this had 7 - knock-on effects, for example, breaking the zlib build because of 8 - `TARGET_OS_MAC` getting defined. 9 - 10 - This should be the lowest impact solution and corresponds to the default 11 - behavior IIUC. 12 - --- 13 - include/stdlib.h | 3 +++ 14 - 1 file changed, 3 insertions(+) 15 - 16 - diff --git a/include/stdlib.h b/include/stdlib.h 17 - index c04d3a7..0b454ba 100644 18 - --- a/include/stdlib.h 19 - +++ b/include/stdlib.h 20 - @@ -183,6 +183,9 @@ unsigned long long 21 - #ifndef LIBC_ALIAS_SYSTEM 22 - //End-Libc 23 - 24 - +#ifndef TARGET_OS_EMBEDDED 25 - +# define TARGET_OS_EMBEDDED 0 26 - +#endif 27 - #if TARGET_OS_EMBEDDED 28 - #define __swift_unavailable_on(osx_msg, ios_msg) __swift_unavailable(ios_msg) 29 - #else 30 - -- 31 - 2.17.2 (Apple Git-113) 32 -
-26
pkgs/os-specific/darwin/apple-source-releases/Libc/0002-Define-TARGET_OS_EMBEDDED-in-stdio-if-not-defined.patch
··· 1 - From 26a721ca68bb06cb815c49f4ac28bb9de8bb2cba Mon Sep 17 00:00:00 2001 2 - From: toonn <toonn@toonn.io> 3 - Date: Tue, 27 Jul 2021 20:03:40 +0200 4 - Subject: [PATCH 2/2] Define TARGET_OS_EMBEDDED in stdio if not defined 5 - 6 - --- 7 - include/stdio.h | 3 +++ 8 - 1 file changed, 3 insertions(+) 9 - 10 - diff --git a/include/stdio.h b/include/stdio.h 11 - index d0cf7a5..487496e 100644 12 - --- a/include/stdio.h 13 - +++ b/include/stdio.h 14 - @@ -351,6 +351,9 @@ __END_DECLS 15 - /* Additional functionality provided by: 16 - * POSIX.2-1992 C Language Binding Option 17 - */ 18 - +#ifndef TARGET_OS_EMBEDDED 19 - +# define TARGET_OS_EMBEDDED 0 20 - +#endif 21 - #if TARGET_OS_EMBEDDED 22 - #define __swift_unavailable_on(osx_msg, ios_msg) __swift_unavailable(ios_msg) 23 - #else 24 - -- 25 - 2.17.2 (Apple Git-113) 26 -
+1 -2
pkgs/os-specific/darwin/apple-source-releases/Libc/default.nix
··· 4 4 nativeBuildInputs = [ ed unifdef ]; 5 5 6 6 patches = [ 7 - ./0001-Define-TARGET_OS_EMBEDDED-in-stdlib-if-not-defined.patch 8 - ./0002-Define-TARGET_OS_EMBEDDED-in-stdio-if-not-defined.patch 7 + ./0001-Define-TARGET_OS_EMBEDDED-in-std-lib-io-if-not-defin.patch 9 8 ]; 10 9 11 10 # TODO: asl.h actually comes from syslog project now