Loading...
--- Libc/Libc-1583.60.2/include/stdlib.h
+++ Libc/Libc-1353.11.2/include/stdlib.h
@@ -128,6 +128,11 @@
&& defined(_USE_EXTENDED_LOCALES_) && !defined(MB_CUR_MAX_L)
#define MB_CUR_MAX_L(x) (___mb_cur_max_l(x))
#endif
+//Begin-Libc
+#include "libc_private.h"
+/* f must be a literal string */
+#define LIBC_ABORT(f,...) abort_report_np("%s:%s:%u: " f, __FILE__, __func__, __LINE__, ## __VA_ARGS__)
+//End-Libc
#ifndef UNIFDEF_DRIVERKIT
#include <malloc/_malloc.h>
@@ -200,7 +205,13 @@
#ifndef LIBC_ALIAS_SYSTEM
//End-Libc
-__swift_unavailable("Use posix_spawn APIs or NSTask instead. (On iOS, process spawning is unavailable.)")
+#if TARGET_OS_EMBEDDED
+#define __swift_unavailable_on(osx_msg, ios_msg) __swift_unavailable(ios_msg)
+#else
+#define __swift_unavailable_on(osx_msg, ios_msg) __swift_unavailable(osx_msg)
+#endif
+
+__swift_unavailable_on("Use posix_spawn APIs or NSTask instead.", "Process spawning is unavailable")
__API_AVAILABLE(macos(10.0)) __IOS_PROHIBITED
__WATCHOS_PROHIBITED __TVOS_PROHIBITED
int system(const char *) __DARWIN_ALIAS_C(system);
@@ -210,6 +221,7 @@
#endif /* !LIBC_ALIAS_SYSTEM */
//End-Libc
+#undef __swift_unavailable_on
#endif /* UNIFDEF_DRIVERKIT */
size_t wcstombs(char * __restrict, const wchar_t * __restrict, size_t);
@@ -235,9 +247,6 @@
char *l64a(long);
void lcong48(unsigned short[7]);
long lrand48(void) __swift_unavailable("Use arc4random instead.");
-#if !defined(_POSIX_C_SOURCE)
-__deprecated_msg("This function is provided for compatibility reasons only. Due to security concerns inherent in the design of mktemp(3), it is highly recommended that you use mkstemp(3) instead.")
-#endif
char *mktemp(char *);
int mkstemp(char *);
long mrand48(void) __swift_unavailable("Use arc4random instead.");
@@ -328,7 +337,6 @@
#endif /* __DARWIN_UNIX03 */
#endif /* !_ANSI_SOURCE */
#endif /* UNIFDEF_DRIVERKIT */
-__END_DECLS
#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
#include <machine/types.h>
@@ -338,7 +346,6 @@
#endif /* UNIFDEF_DRIVERKIT */
#include <_types/_uint32_t.h>
-__BEGIN_DECLS
uint32_t arc4random(void);
#ifndef UNIFDEF_DRIVERKIT
void arc4random_addrandom(unsigned char * /*dat*/, int /*datlen*/)
@@ -355,17 +362,8 @@
#ifndef UNIFDEF_DRIVERKIT
int atexit_b(void (^ _Nonnull)(void)) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2);
#endif /* UNIFDEF_DRIVERKIT */
-
-#ifdef __BLOCKS__
-#if __has_attribute(noescape)
-#define __bsearch_noescape __attribute__((__noescape__))
-#else
-#define __bsearch_noescape
-#endif
-#endif /* __BLOCKS__ */
void *bsearch_b(const void *__key, const void *__base, size_t __nel,
- size_t __width, int (^ _Nonnull __compar)(const void *, const void *) __bsearch_noescape)
- __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2);
+ size_t __width, int (^ _Nonnull __compar)(const void *, const void *)) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2);
#endif /* __BLOCKS__ */
#ifndef UNIFDEF_DRIVERKIT
@@ -443,9 +441,6 @@
void sranddev(void);
void srandomdev(void);
void *reallocf(void *__ptr, size_t __size) __alloc_size(2);
-long long
- strtonum(const char *__numstr, long long __minval, long long __maxval, const char **__errstrp)
- __API_AVAILABLE(macos(10.16), ios(14.0), tvos(14.0), watchos(7.0));
#endif /* UNIFDEF_DRIVERKIT */
#if !__DARWIN_NO_LONG_LONG
long long
@@ -457,10 +452,8 @@
extern char *suboptarg; /* getsubopt(3) external variable */
/* valloc is now declared in _malloc.h */
#endif /* UNIFDEF_DRIVERKIT */
-__END_DECLS
#endif /* !_ANSI_SOURCE && !_POSIX_SOURCE */
-__BEGIN_DECLS
/* Poison the following routines if -fshort-wchar is set */
#if !defined(__cplusplus) && defined(__WCHAR_MAX__) && __WCHAR_MAX__ <= 0xffffU
#pragma GCC poison mbstowcs mbtowc wcstombs wctomb