macos: vendored libc: bump to SDK 15.1
This commit is contained in:
committed by
Alex Rønne Petersen
parent
130f7c2ed8
commit
a68119f8f1
2
lib/libc/darwin/SDKSettings.json
vendored
2
lib/libc/darwin/SDKSettings.json
vendored
@@ -1 +1 @@
|
||||
{"MinimalDisplayName":"14.0"}
|
||||
{"MinimalDisplayName":"15.1"}
|
||||
|
||||
1578
lib/libc/darwin/libSystem.tbd
vendored
1578
lib/libc/darwin/libSystem.tbd
vendored
File diff suppressed because it is too large
Load Diff
38
lib/libc/include/any-macos-any/AssertMacros.h
vendored
38
lib/libc/include/any-macos-any/AssertMacros.h
vendored
@@ -218,18 +218,32 @@
|
||||
#ifdef KERNEL
|
||||
#include <libkern/libkern.h>
|
||||
#define DEBUG_ASSERT_MESSAGE(name, assertion, label, message, file, line, value) \
|
||||
printf( "AssertMacros: %s, %s file: %s, line: %d, value: %ld\n", assertion, (message!=0) ? message : "", file, line, (long) (value));
|
||||
printf( "AssertMacros: %s, %s file: %s, line: %d, value: %lld\n", assertion, (message!=0) ? message : "", file, line, (long long) (value));
|
||||
#elif TARGET_OS_DRIVERKIT
|
||||
#include <os/log.h>
|
||||
#define DEBUG_ASSERT_MESSAGE(name, assertion, label, message, file, line, value) \
|
||||
os_log(OS_LOG_DEFAULT, "AssertMacros: %s, %s file: %s, line: %d, value: %ld\n", assertion, (message!=0) ? message : "", file, line, (long) (value));
|
||||
os_log(OS_LOG_DEFAULT, "AssertMacros: %s, %s file: %s, line: %d, value: %lld\n", assertion, (message!=0) ? message : "", file, line, (long long) (value));
|
||||
#else
|
||||
#include <stdio.h>
|
||||
#define DEBUG_ASSERT_MESSAGE(name, assertion, label, message, file, line, value) \
|
||||
fprintf(stderr, "AssertMacros: %s, %s file: %s, line: %d, value: %ld\n", assertion, (message!=0) ? message : "", file, line, (long) (value));
|
||||
fprintf(stderr, "AssertMacros: %s, %s file: %s, line: %d, value: %lld\n", assertion, (message!=0) ? message : "", file, line, (long long) (value));
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* DEBUG_ASSERT_FORCE_64_BIT_ERROR_CODE
|
||||
*
|
||||
* Summary:
|
||||
* By default the errorCode passed to DEBUG_ASSERT_MESSAGE will be the system word
|
||||
* length. If DEBUG_ASSERT_FORCE_64_BIT_ERROR_CODE is set then it will be changed
|
||||
* to a 64 bit integer, even on 32 bit platforms.
|
||||
*/
|
||||
#ifndef DEBUG_ASSERT_FORCE_64_BIT_ERROR_CODE
|
||||
#define DEBUG_ASSERT_ERROR_TYPE long
|
||||
#else
|
||||
#define DEBUG_ASSERT_ERROR_TYPE long long
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -361,7 +375,7 @@
|
||||
#define __Check_noErr(errorCode) \
|
||||
do \
|
||||
{ \
|
||||
long evalOnceErrorCode = (errorCode); \
|
||||
DEBUG_ASSERT_ERROR_TYPE evalOnceErrorCode = (errorCode); \
|
||||
if ( __builtin_expect(0 != evalOnceErrorCode, 0) ) \
|
||||
{ \
|
||||
DEBUG_ASSERT_MESSAGE( \
|
||||
@@ -397,7 +411,7 @@
|
||||
#define __Check_noErr_String(errorCode, message) \
|
||||
do \
|
||||
{ \
|
||||
long evalOnceErrorCode = (errorCode); \
|
||||
DEBUG_ASSERT_ERROR_TYPE evalOnceErrorCode = (errorCode); \
|
||||
if ( __builtin_expect(0 != evalOnceErrorCode, 0) ) \
|
||||
{ \
|
||||
DEBUG_ASSERT_MESSAGE( \
|
||||
@@ -523,7 +537,7 @@
|
||||
#define __Verify_noErr(errorCode) \
|
||||
do \
|
||||
{ \
|
||||
long evalOnceErrorCode = (errorCode); \
|
||||
DEBUG_ASSERT_ERROR_TYPE evalOnceErrorCode = (errorCode); \
|
||||
if ( __builtin_expect(0 != evalOnceErrorCode, 0) ) \
|
||||
{ \
|
||||
DEBUG_ASSERT_MESSAGE( \
|
||||
@@ -565,7 +579,7 @@
|
||||
#define __Verify_noErr_String(errorCode, message) \
|
||||
do \
|
||||
{ \
|
||||
long evalOnceErrorCode = (errorCode); \
|
||||
DEBUG_ASSERT_ERROR_TYPE evalOnceErrorCode = (errorCode); \
|
||||
if ( __builtin_expect(0 != evalOnceErrorCode, 0) ) \
|
||||
{ \
|
||||
DEBUG_ASSERT_MESSAGE( \
|
||||
@@ -605,7 +619,7 @@
|
||||
#else
|
||||
#define __Verify_noErr_Action(errorCode, action) \
|
||||
do { \
|
||||
long evalOnceErrorCode = (errorCode); \
|
||||
DEBUG_ASSERT_ERROR_TYPE evalOnceErrorCode = (errorCode); \
|
||||
if ( __builtin_expect(0 != evalOnceErrorCode, 0) ) { \
|
||||
DEBUG_ASSERT_MESSAGE( \
|
||||
DEBUG_ASSERT_COMPONENT_NAME_STRING, \
|
||||
@@ -970,7 +984,7 @@
|
||||
#define __Require_noErr(errorCode, exceptionLabel) \
|
||||
do \
|
||||
{ \
|
||||
long evalOnceErrorCode = (errorCode); \
|
||||
DEBUG_ASSERT_ERROR_TYPE evalOnceErrorCode = (errorCode); \
|
||||
if ( __builtin_expect(0 != evalOnceErrorCode, 0) ) \
|
||||
{ \
|
||||
DEBUG_ASSERT_MESSAGE( \
|
||||
@@ -1022,7 +1036,7 @@
|
||||
#define __Require_noErr_Action(errorCode, exceptionLabel, action) \
|
||||
do \
|
||||
{ \
|
||||
long evalOnceErrorCode = (errorCode); \
|
||||
DEBUG_ASSERT_ERROR_TYPE evalOnceErrorCode = (errorCode); \
|
||||
if ( __builtin_expect(0 != evalOnceErrorCode, 0) ) \
|
||||
{ \
|
||||
DEBUG_ASSERT_MESSAGE( \
|
||||
@@ -1131,7 +1145,7 @@
|
||||
#define __Require_noErr_String(errorCode, exceptionLabel, message) \
|
||||
do \
|
||||
{ \
|
||||
long evalOnceErrorCode = (errorCode); \
|
||||
DEBUG_ASSERT_ERROR_TYPE evalOnceErrorCode = (errorCode); \
|
||||
if ( __builtin_expect(0 != evalOnceErrorCode, 0) ) \
|
||||
{ \
|
||||
DEBUG_ASSERT_MESSAGE( \
|
||||
@@ -1186,7 +1200,7 @@
|
||||
#define __Require_noErr_Action_String(errorCode, exceptionLabel, action, message) \
|
||||
do \
|
||||
{ \
|
||||
long evalOnceErrorCode = (errorCode); \
|
||||
DEBUG_ASSERT_ERROR_TYPE evalOnceErrorCode = (errorCode); \
|
||||
if ( __builtin_expect(0 != evalOnceErrorCode, 0) ) \
|
||||
{ \
|
||||
DEBUG_ASSERT_MESSAGE( \
|
||||
|
||||
41
lib/libc/include/any-macos-any/Availability.h
vendored
41
lib/libc/include/any-macos-any/Availability.h
vendored
@@ -159,13 +159,26 @@
|
||||
#define __API_TO_BE_DEPRECATED_DRIVERKIT 100000
|
||||
#endif
|
||||
|
||||
#ifndef __API_TO_BE_DEPRECATED_XROS
|
||||
#define __API_TO_BE_DEPRECATED_XROS 100000
|
||||
#ifndef __API_TO_BE_DEPRECATED_VISIONOS
|
||||
#define __API_TO_BE_DEPRECATED_VISIONOS 100000
|
||||
#endif
|
||||
|
||||
#ifndef __API_TO_BE_DEPRECATED_EXCLAVEKIT
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#ifndef __OPEN_SOURCE__
|
||||
|
||||
#endif /* __OPEN_SOURCE__ */
|
||||
|
||||
#include <AvailabilityVersions.h>
|
||||
#include <AvailabilityInternal.h>
|
||||
#include <AvailabilityInternalLegacy.h>
|
||||
#if __has_include(<AvailabilityInternalPrivate.h>)
|
||||
#include <AvailabilityInternalPrivate.h>
|
||||
#endif
|
||||
|
||||
#ifdef __IPHONE_OS_VERSION_MIN_REQUIRED
|
||||
#define __OSX_AVAILABLE_STARTING(_osx, _ios) __AVAILABILITY_INTERNAL##_ios
|
||||
@@ -419,9 +432,9 @@
|
||||
* __API_AVAILABLE(macos(10.4), ios(8.0), watchos(2.0), tvos(10.0))
|
||||
* __API_AVAILABLE(driverkit(19.0))
|
||||
*/
|
||||
#define __API_AVAILABLE(...) __API_AVAILABLE_GET_MACRO(__VA_ARGS__,__API_AVAILABLE7,__API_AVAILABLE6,__API_AVAILABLE5,__API_AVAILABLE4,__API_AVAILABLE3,__API_AVAILABLE2,__API_AVAILABLE1,__API_AVAILABLE0,0)(__VA_ARGS__)
|
||||
#define __API_AVAILABLE(...) __API_AVAILABLE_GET_MACRO(__VA_ARGS__,__API_AVAILABLE8,__API_AVAILABLE7,__API_AVAILABLE6,__API_AVAILABLE5,__API_AVAILABLE4,__API_AVAILABLE3,__API_AVAILABLE2,__API_AVAILABLE1,__API_AVAILABLE0,0)(__VA_ARGS__)
|
||||
|
||||
#define __API_AVAILABLE_BEGIN(...) _Pragma("clang attribute push") __API_AVAILABLE_BEGIN_GET_MACRO(__VA_ARGS__,__API_AVAILABLE_BEGIN7,__API_AVAILABLE_BEGIN6,__API_AVAILABLE_BEGIN5,__API_AVAILABLE_BEGIN4,__API_AVAILABLE_BEGIN3,__API_AVAILABLE_BEGIN2,__API_AVAILABLE_BEGIN1,__API_AVAILABLE_BEGIN0,0)(__VA_ARGS__)
|
||||
#define __API_AVAILABLE_BEGIN(...) _Pragma("clang attribute push") __API_AVAILABLE_BEGIN_GET_MACRO(__VA_ARGS__,__API_AVAILABLE_BEGIN8,__API_AVAILABLE_BEGIN7,__API_AVAILABLE_BEGIN6,__API_AVAILABLE_BEGIN5,__API_AVAILABLE_BEGIN4,__API_AVAILABLE_BEGIN3,__API_AVAILABLE_BEGIN2,__API_AVAILABLE_BEGIN1,__API_AVAILABLE_BEGIN0,0)(__VA_ARGS__)
|
||||
#define __API_AVAILABLE_END _Pragma("clang attribute pop")
|
||||
|
||||
/*
|
||||
@@ -440,13 +453,13 @@
|
||||
* __API_DEPRECATED_WITH_REPLACEMENT("-setName:", tvos(10.0, 10.4), ios(9.0, 10.0))
|
||||
* __API_DEPRECATED_WITH_REPLACEMENT("SomeClassName", macos(10.4, 10.6), watchos(2.0, 3.0))
|
||||
*/
|
||||
#define __API_DEPRECATED(...) __API_DEPRECATED_MSG_GET_MACRO(__VA_ARGS__,__API_DEPRECATED_MSG7,__API_DEPRECATED_MSG6,__API_DEPRECATED_MSG5,__API_DEPRECATED_MSG4,__API_DEPRECATED_MSG3,__API_DEPRECATED_MSG2,__API_DEPRECATED_MSG1,__API_DEPRECATED_MSG0,0,0)(__VA_ARGS__)
|
||||
#define __API_DEPRECATED_WITH_REPLACEMENT(...) __API_DEPRECATED_REP_GET_MACRO(__VA_ARGS__,__API_DEPRECATED_REP7,__API_DEPRECATED_REP6,__API_DEPRECATED_REP5,__API_DEPRECATED_REP4,__API_DEPRECATED_REP3,__API_DEPRECATED_REP2,__API_DEPRECATED_REP1,__API_DEPRECATED_REP0,0,0)(__VA_ARGS__)
|
||||
#define __API_DEPRECATED(...) __API_DEPRECATED_MSG_GET_MACRO(__VA_ARGS__,__API_DEPRECATED_MSG8,__API_DEPRECATED_MSG7,__API_DEPRECATED_MSG6,__API_DEPRECATED_MSG5,__API_DEPRECATED_MSG4,__API_DEPRECATED_MSG3,__API_DEPRECATED_MSG2,__API_DEPRECATED_MSG1,__API_DEPRECATED_MSG0,0,0)(__VA_ARGS__)
|
||||
#define __API_DEPRECATED_WITH_REPLACEMENT(...) __API_DEPRECATED_REP_GET_MACRO(__VA_ARGS__,__API_DEPRECATED_REP8,__API_DEPRECATED_REP7,__API_DEPRECATED_REP6,__API_DEPRECATED_REP5,__API_DEPRECATED_REP4,__API_DEPRECATED_REP3,__API_DEPRECATED_REP2,__API_DEPRECATED_REP1,__API_DEPRECATED_REP0,0,0)(__VA_ARGS__)
|
||||
|
||||
#define __API_DEPRECATED_BEGIN(...) _Pragma("clang attribute push") __API_DEPRECATED_BEGIN_GET_MACRO(__VA_ARGS__,__API_DEPRECATED_BEGIN7,__API_DEPRECATED_BEGIN6,__API_DEPRECATED_BEGIN5,__API_DEPRECATED_BEGIN4,__API_DEPRECATED_BEGIN3,__API_DEPRECATED_BEGIN2,__API_DEPRECATED_BEGIN1,__API_DEPRECATED_BEGIN0,0,0)(__VA_ARGS__)
|
||||
#define __API_DEPRECATED_BEGIN(...) _Pragma("clang attribute push") __API_DEPRECATED_BEGIN_GET_MACRO(__VA_ARGS__,__API_DEPRECATED_BEGIN8,__API_DEPRECATED_BEGIN7,__API_DEPRECATED_BEGIN6,__API_DEPRECATED_BEGIN5,__API_DEPRECATED_BEGIN4,__API_DEPRECATED_BEGIN3,__API_DEPRECATED_BEGIN2,__API_DEPRECATED_BEGIN1,__API_DEPRECATED_BEGIN0,0,0)(__VA_ARGS__)
|
||||
#define __API_DEPRECATED_END _Pragma("clang attribute pop")
|
||||
|
||||
#define __API_DEPRECATED_WITH_REPLACEMENT_BEGIN(...) _Pragma("clang attribute push") __API_DEPRECATED_WITH_REPLACEMENT_BEGIN_GET_MACRO(__VA_ARGS__,__API_DEPRECATED_WITH_REPLACEMENT_BEGIN7,__API_DEPRECATED_WITH_REPLACEMENT_BEGIN6,__API_DEPRECATED_WITH_REPLACEMENT_BEGIN5,__API_DEPRECATED_WITH_REPLACEMENT_BEGIN4,__API_DEPRECATED_WITH_REPLACEMENT_BEGIN3,__API_DEPRECATED_WITH_REPLACEMENT_BEGIN2,__API_DEPRECATED_WITH_REPLACEMENT_BEGIN1,__API_DEPRECATED_WITH_REPLACEMENT_BEGIN0,0,0)(__VA_ARGS__)
|
||||
#define __API_DEPRECATED_WITH_REPLACEMENT_BEGIN(...) _Pragma("clang attribute push") __API_DEPRECATED_WITH_REPLACEMENT_BEGIN_GET_MACRO(__VA_ARGS__,__API_DEPRECATED_WITH_REPLACEMENT_BEGIN8,__API_DEPRECATED_WITH_REPLACEMENT_BEGIN7,__API_DEPRECATED_WITH_REPLACEMENT_BEGIN6,__API_DEPRECATED_WITH_REPLACEMENT_BEGIN5,__API_DEPRECATED_WITH_REPLACEMENT_BEGIN4,__API_DEPRECATED_WITH_REPLACEMENT_BEGIN3,__API_DEPRECATED_WITH_REPLACEMENT_BEGIN2,__API_DEPRECATED_WITH_REPLACEMENT_BEGIN1,__API_DEPRECATED_WITH_REPLACEMENT_BEGIN0,0,0)(__VA_ARGS__)
|
||||
#define __API_DEPRECATED_WITH_REPLACEMENT_END _Pragma("clang attribute pop")
|
||||
|
||||
/*
|
||||
@@ -457,9 +470,9 @@
|
||||
* __API_UNAVAILABLE(macos)
|
||||
* __API_UNAVAILABLE(watchos, tvos)
|
||||
*/
|
||||
#define __API_UNAVAILABLE(...) __API_UNAVAILABLE_GET_MACRO(__VA_ARGS__,__API_UNAVAILABLE7,__API_UNAVAILABLE6,__API_UNAVAILABLE5,__API_UNAVAILABLE4,__API_UNAVAILABLE3,__API_UNAVAILABLE2,__API_UNAVAILABLE1,__API_UNAVAILABLE0,0)(__VA_ARGS__)
|
||||
#define __API_UNAVAILABLE(...) __API_UNAVAILABLE_GET_MACRO(__VA_ARGS__,__API_UNAVAILABLE8,__API_UNAVAILABLE7,__API_UNAVAILABLE6,__API_UNAVAILABLE5,__API_UNAVAILABLE4,__API_UNAVAILABLE3,__API_UNAVAILABLE2,__API_UNAVAILABLE1,__API_UNAVAILABLE0,0)(__VA_ARGS__)
|
||||
|
||||
#define __API_UNAVAILABLE_BEGIN(...) _Pragma("clang attribute push") __API_UNAVAILABLE_BEGIN_GET_MACRO(__VA_ARGS__,__API_UNAVAILABLE_BEGIN7,__API_UNAVAILABLE_BEGIN6,__API_UNAVAILABLE_BEGIN5,__API_UNAVAILABLE_BEGIN4,__API_UNAVAILABLE_BEGIN3,__API_UNAVAILABLE_BEGIN2,__API_UNAVAILABLE_BEGIN1,__API_UNAVAILABLE_BEGIN0,0)(__VA_ARGS__)
|
||||
#define __API_UNAVAILABLE_BEGIN(...) _Pragma("clang attribute push") __API_UNAVAILABLE_BEGIN_GET_MACRO(__VA_ARGS__,__API_UNAVAILABLE_BEGIN8,__API_UNAVAILABLE_BEGIN7,__API_UNAVAILABLE_BEGIN6,__API_UNAVAILABLE_BEGIN5,__API_UNAVAILABLE_BEGIN4,__API_UNAVAILABLE_BEGIN3,__API_UNAVAILABLE_BEGIN2,__API_UNAVAILABLE_BEGIN1,__API_UNAVAILABLE_BEGIN0,0)(__VA_ARGS__)
|
||||
#define __API_UNAVAILABLE_END _Pragma("clang attribute pop")
|
||||
#endif /* __has_attribute(availability) */
|
||||
#endif /* #if defined(__has_feature) && defined(__has_attribute) */
|
||||
@@ -524,6 +537,14 @@
|
||||
#define __SPI_AVAILABLE(...)
|
||||
#endif
|
||||
|
||||
#ifndef __SPI_AVAILABLE_BEGIN
|
||||
#define __SPI_AVAILABLE_BEGIN(...)
|
||||
#endif
|
||||
|
||||
#ifndef __SPI_AVAILABLE_END
|
||||
#define __SPI_AVAILABLE_END(...)
|
||||
#endif
|
||||
|
||||
#ifndef __SPI_DEPRECATED
|
||||
#define __SPI_DEPRECATED(...)
|
||||
#endif
|
||||
|
||||
@@ -30,19 +30,17 @@
|
||||
#ifndef __AVAILABILITY_INTERNAL__
|
||||
#define __AVAILABILITY_INTERNAL__
|
||||
|
||||
#if __has_include(<AvailabilityInternalPrivate.h>)
|
||||
#include <AvailabilityInternalPrivate.h>
|
||||
#endif
|
||||
#include <AvailabilityVersions.h>
|
||||
|
||||
#ifndef __MAC_OS_X_VERSION_MIN_REQUIRED
|
||||
#if defined(__has_builtin) && __has_builtin(__is_target_os)
|
||||
#if __is_target_os(macos)
|
||||
#define __MAC_OS_X_VERSION_MIN_REQUIRED __ENVIRONMENT_OS_VERSION_MIN_REQUIRED__
|
||||
#define __MAC_OS_X_VERSION_MAX_ALLOWED __MAC_14_0
|
||||
#define __MAC_OS_X_VERSION_MAX_ALLOWED __MAC_15_1
|
||||
#endif
|
||||
#elif __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
|
||||
#define __MAC_OS_X_VERSION_MIN_REQUIRED __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
|
||||
#define __MAC_OS_X_VERSION_MAX_ALLOWED __MAC_14_0
|
||||
#define __MAC_OS_X_VERSION_MAX_ALLOWED __MAC_15_1
|
||||
#endif /* __has_builtin(__is_target_os) && __is_target_os(macos) */
|
||||
#endif /* __MAC_OS_X_VERSION_MIN_REQUIRED */
|
||||
|
||||
@@ -50,11 +48,11 @@
|
||||
#if defined(__has_builtin) && __has_builtin(__is_target_os)
|
||||
#if __is_target_os(ios)
|
||||
#define __IPHONE_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_OS_VERSION_MIN_REQUIRED__
|
||||
#define __IPHONE_OS_VERSION_MAX_ALLOWED __IPHONE_17_0
|
||||
#define __IPHONE_OS_VERSION_MAX_ALLOWED __IPHONE_18_1
|
||||
#endif
|
||||
#elif __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__
|
||||
#define __IPHONE_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__
|
||||
#define __IPHONE_OS_VERSION_MAX_ALLOWED __IPHONE_17_0
|
||||
#define __IPHONE_OS_VERSION_MAX_ALLOWED __IPHONE_18_1
|
||||
#endif /* __has_builtin(__is_target_os) && __is_target_os(ios) */
|
||||
#endif /* __IPHONE_OS_VERSION_MIN_REQUIRED */
|
||||
|
||||
@@ -62,13 +60,13 @@
|
||||
#if defined(__has_builtin) && __has_builtin(__is_target_os)
|
||||
#if __is_target_os(watchos)
|
||||
#define __WATCH_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_OS_VERSION_MIN_REQUIRED__
|
||||
#define __WATCH_OS_VERSION_MAX_ALLOWED __WATCHOS_10_0
|
||||
#define __WATCH_OS_VERSION_MAX_ALLOWED __WATCHOS_11_1
|
||||
/* for compatibility with existing code. New code should use platform specific checks */
|
||||
#define __IPHONE_OS_VERSION_MIN_REQUIRED __IPHONE_9_0
|
||||
#endif
|
||||
#elif __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__
|
||||
#define __WATCH_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__
|
||||
#define __WATCH_OS_VERSION_MAX_ALLOWED __WATCHOS_10_0
|
||||
#define __WATCH_OS_VERSION_MAX_ALLOWED __WATCHOS_11_1
|
||||
/* for compatibility with existing code. New code should use platform specific checks */
|
||||
#define __IPHONE_OS_VERSION_MIN_REQUIRED __IPHONE_9_0
|
||||
#endif /* __has_builtin(__is_target_os) && __is_target_os(watchos) */
|
||||
@@ -78,13 +76,13 @@
|
||||
#if defined(__has_builtin) && __has_builtin(__is_target_os)
|
||||
#if __is_target_os(tvos)
|
||||
#define __TV_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_OS_VERSION_MIN_REQUIRED__
|
||||
#define __TV_OS_VERSION_MAX_ALLOWED __TVOS_17_0
|
||||
#define __TV_OS_VERSION_MAX_ALLOWED __TVOS_18_1
|
||||
/* for compatibility with existing code. New code should use platform specific checks */
|
||||
#define __IPHONE_OS_VERSION_MIN_REQUIRED __IPHONE_9_0
|
||||
#endif
|
||||
#elif __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__
|
||||
#define __TV_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__
|
||||
#define __TV_OS_VERSION_MAX_ALLOWED __TVOS_17_0
|
||||
#define __TV_OS_VERSION_MAX_ALLOWED __TVOS_18_1
|
||||
/* for compatibility with existing code. New code should use platform specific checks */
|
||||
#define __IPHONE_OS_VERSION_MIN_REQUIRED __IPHONE_9_0
|
||||
#endif /* __has_builtin(__is_target_os) && __is_target_os(tvos) */
|
||||
@@ -94,7 +92,7 @@
|
||||
#if defined(__has_builtin) && __has_builtin(__is_target_os)
|
||||
#if __is_target_os(bridgeos)
|
||||
#define __BRIDGE_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_OS_VERSION_MIN_REQUIRED__
|
||||
#define __BRIDGE_OS_VERSION_MAX_ALLOWED __BRIDGEOS_8_0
|
||||
#define __BRIDGE_OS_VERSION_MAX_ALLOWED __BRIDGEOS_9_1
|
||||
/* for compatibility with existing code. New code should use platform specific checks */
|
||||
#define __IPHONE_OS_VERSION_MIN_REQUIRED __IPHONE_11_0
|
||||
#endif
|
||||
@@ -105,22 +103,45 @@
|
||||
#if defined(__has_builtin) && __has_builtin(__is_target_os)
|
||||
#if __is_target_os(driverkit)
|
||||
#define __DRIVERKIT_VERSION_MIN_REQUIRED __ENVIRONMENT_OS_VERSION_MIN_REQUIRED__
|
||||
#define __DRIVERKIT_VERSION_MAX_ALLOWED __DRIVERKIT_23_0
|
||||
#define __DRIVERKIT_VERSION_MAX_ALLOWED __DRIVERKIT_24_1
|
||||
#endif
|
||||
#endif /* __has_builtin(__is_target_os) && __is_target_os(driverkit) */
|
||||
#endif /* __DRIVERKIT_VERSION_MIN_REQUIRED */
|
||||
|
||||
#ifndef __XR_OS_VERSION_MIN_REQUIRED
|
||||
#ifndef __VISION_OS_VERSION_MIN_REQUIRED
|
||||
#if defined(__has_builtin) && __has_builtin(__is_target_os)
|
||||
#if __is_target_os(visionos)
|
||||
#define __VISION_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_OS_VERSION_MIN_REQUIRED__
|
||||
#define __VISION_OS_VERSION_MAX_ALLOWED __VISIONOS_2_1
|
||||
/* for compatibility with existing code. New code should use platform specific checks */
|
||||
#define __IPHONE_OS_VERSION_MIN_REQUIRED __IPHONE_17_1
|
||||
#endif
|
||||
#endif /* __has_builtin(__is_target_os) && __is_target_os(visionos) */
|
||||
#endif /* __VISION_OS_VERSION_MIN_REQUIRED */
|
||||
|
||||
|
||||
//FIXME: Workaround for rdar://116062344
|
||||
#ifndef __VISION_OS_VERSION_MIN_REQUIRED
|
||||
#if defined(__has_builtin) && __has_builtin(__is_target_os)
|
||||
#if __is_target_os(xros)
|
||||
#define __XR_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_OS_VERSION_MIN_REQUIRED__
|
||||
#define __XR_OS_VERSION_MAX_ALLOWED __XROS_1_0
|
||||
#define __VISION_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_OS_VERSION_MIN_REQUIRED__
|
||||
// Hardcoded these since until compiler fix for rdar://116062344 will land
|
||||
#if defined(__VISIONOS_2_0)
|
||||
#define __VISION_OS_VERSION_MAX_ALLOWED __VISIONOS_2_0
|
||||
#elif defined(__VISIONOS_1_1)
|
||||
#define __VISION_OS_VERSION_MAX_ALLOWED __VISIONOS_1_1
|
||||
#elif defined(__VISIONOS_1_0)
|
||||
#define __VISION_OS_VERSION_MAX_ALLOWED __VISIONOS_1_0
|
||||
#endif
|
||||
/* for compatibility with existing code. New code should use platform specific checks */
|
||||
#define __IPHONE_OS_VERSION_MIN_REQUIRED __IPHONE_17_0
|
||||
#define __IPHONE_OS_VERSION_MIN_REQUIRED __IPHONE_17_1
|
||||
#endif
|
||||
#endif /* __has_builtin(__is_target_os) && __is_target_os(xros) */
|
||||
#endif /* __XR_OS_VERSION_MIN_REQUIRED */
|
||||
#endif /* __has_builtin(__is_target_os) && __is_target_os(visionos) */
|
||||
#endif /* __VISION_OS_VERSION_MIN_REQUIRED */
|
||||
|
||||
#ifndef __OPEN_SOURCE__
|
||||
|
||||
#endif /* __OPEN_SOURCE__ */
|
||||
|
||||
#ifdef __IPHONE_OS_VERSION_MIN_REQUIRED
|
||||
/* make sure a default max version is set */
|
||||
@@ -150,43 +171,42 @@
|
||||
#define __AVAILABILITY_INTERNAL_WEAK_IMPORT __attribute__((weak_import))
|
||||
#define __AVAILABILITY_INTERNAL_REGULAR
|
||||
|
||||
#include <AvailabilityInternalLegacy.h>
|
||||
|
||||
#if defined(__has_feature) && defined(__has_attribute)
|
||||
#if __has_attribute(availability)
|
||||
#define __API_AVAILABLE_PLATFORM_macos(x) macos,introduced=x
|
||||
#define __API_UNAVAILABLE_PLATFORM_macos macos,unavailable
|
||||
#define __API_DEPRECATED_PLATFORM_macos(x,y) macos,introduced=x,deprecated=y
|
||||
#define __API_UNAVAILABLE_PLATFORM_macos macos,unavailable
|
||||
#define __API_AVAILABLE_PLATFORM_macosx(x) macos,introduced=x
|
||||
#define __API_UNAVAILABLE_PLATFORM_macosx macos,unavailable
|
||||
#define __API_DEPRECATED_PLATFORM_macosx(x,y) macos,introduced=x,deprecated=y
|
||||
#define __API_UNAVAILABLE_PLATFORM_macosx macos,unavailable
|
||||
#define __API_AVAILABLE_PLATFORM_ios(x) ios,introduced=x
|
||||
#define __API_UNAVAILABLE_PLATFORM_ios ios,unavailable
|
||||
#define __API_DEPRECATED_PLATFORM_ios(x,y) ios,introduced=x,deprecated=y
|
||||
#define __API_UNAVAILABLE_PLATFORM_ios ios,unavailable
|
||||
#define __API_AVAILABLE_PLATFORM_macCatalyst(x) macCatalyst,introduced=x
|
||||
#define __API_UNAVAILABLE_PLATFORM_macCatalyst macCatalyst,unavailable
|
||||
#define __API_DEPRECATED_PLATFORM_macCatalyst(x,y) macCatalyst,introduced=x,deprecated=y
|
||||
#define __API_UNAVAILABLE_PLATFORM_macCatalyst macCatalyst,unavailable
|
||||
#define __API_AVAILABLE_PLATFORM_macCatalyst(x) macCatalyst,introduced=x
|
||||
#define __API_UNAVAILABLE_PLATFORM_macCatalyst macCatalyst,unavailable
|
||||
#define __API_DEPRECATED_PLATFORM_macCatalyst(x,y) macCatalyst,introduced=x,deprecated=y
|
||||
#define __API_UNAVAILABLE_PLATFORM_macCatalyst macCatalyst,unavailable
|
||||
#define __API_AVAILABLE_PLATFORM_watchos(x) watchos,introduced=x
|
||||
#define __API_UNAVAILABLE_PLATFORM_watchos watchos,unavailable
|
||||
#define __API_DEPRECATED_PLATFORM_watchos(x,y) watchos,introduced=x,deprecated=y
|
||||
#define __API_UNAVAILABLE_PLATFORM_watchos watchos,unavailable
|
||||
#define __API_AVAILABLE_PLATFORM_tvos(x) tvos,introduced=x
|
||||
#define __API_UNAVAILABLE_PLATFORM_tvos tvos,unavailable
|
||||
#define __API_DEPRECATED_PLATFORM_tvos(x,y) tvos,introduced=x,deprecated=y
|
||||
#define __API_UNAVAILABLE_PLATFORM_tvos tvos,unavailable
|
||||
|
||||
|
||||
|
||||
#define __API_AVAILABLE_PLATFORM_driverkit(x) driverkit,introduced=x
|
||||
#define __API_UNAVAILABLE_PLATFORM_driverkit driverkit,unavailable
|
||||
#define __API_DEPRECATED_PLATFORM_driverkit(x,y) driverkit,introduced=x,deprecated=y
|
||||
#define __API_AVAILABLE_PLATFORM_xros(x) xros,introduced=x
|
||||
#define __API_UNAVAILABLE_PLATFORM_xros xros,unavailable
|
||||
#define __API_DEPRECATED_PLATFORM_xros(x,y) xros,introduced=x,deprecated=y
|
||||
#define __API_AVAILABLE_PLATFORM_visionos(x) xros,introduced=x
|
||||
#define __API_UNAVAILABLE_PLATFORM_visionos xros,unavailable
|
||||
#define __API_DEPRECATED_PLATFORM_visionos(x,y) xros,introduced=x,deprecated=y
|
||||
#define __API_UNAVAILABLE_PLATFORM_driverkit driverkit,unavailable
|
||||
#define __API_AVAILABLE_PLATFORM_visionos(x) visionos,introduced=x
|
||||
#define __API_DEPRECATED_PLATFORM_visionos(x,y) visionos,introduced=x,deprecated=y
|
||||
#define __API_UNAVAILABLE_PLATFORM_visionos visionos,unavailable
|
||||
#define __API_AVAILABLE_PLATFORM_xros(x) visionos,introduced=x
|
||||
#define __API_DEPRECATED_PLATFORM_xros(x,y) visionos,introduced=x,deprecated=y
|
||||
#define __API_UNAVAILABLE_PLATFORM_xros visionos,unavailable
|
||||
|
||||
#endif /* __has_attribute(availability) */
|
||||
#endif /* defined(__has_feature) && defined(__has_attribute) */
|
||||
|
||||
@@ -218,7 +238,8 @@
|
||||
#define __API_AVAILABLE5(arg0,arg1,arg2,arg3,arg4,arg5) __API_A(arg0) __API_A(arg1) __API_A(arg2) __API_A(arg3) __API_A(arg4) __API_A(arg5)
|
||||
#define __API_AVAILABLE6(arg0,arg1,arg2,arg3,arg4,arg5,arg6) __API_A(arg0) __API_A(arg1) __API_A(arg2) __API_A(arg3) __API_A(arg4) __API_A(arg5) __API_A(arg6)
|
||||
#define __API_AVAILABLE7(arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7) __API_A(arg0) __API_A(arg1) __API_A(arg2) __API_A(arg3) __API_A(arg4) __API_A(arg5) __API_A(arg6) __API_A(arg7)
|
||||
#define __API_AVAILABLE_GET_MACRO(_0,_1,_2,_3,_4,_5,_6,_7,NAME,...) NAME
|
||||
#define __API_AVAILABLE8(arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) __API_A(arg0) __API_A(arg1) __API_A(arg2) __API_A(arg3) __API_A(arg4) __API_A(arg5) __API_A(arg6) __API_A(arg7) __API_A(arg8)
|
||||
#define __API_AVAILABLE_GET_MACRO(_0,_1,_2,_3,_4,_5,_6,_7,_8,NAME,...) NAME
|
||||
|
||||
#define __API_A_BEGIN(x) _Pragma(__API_RANGE_STRINGIFY (clang attribute (__attribute__((availability(__API_AVAILABLE_PLATFORM_##x))), apply_to = __API_APPLY_TO)))
|
||||
|
||||
@@ -230,7 +251,8 @@
|
||||
#define __API_AVAILABLE_BEGIN5(arg0,arg1,arg2,arg3,arg4,arg5) __API_A_BEGIN(arg0) __API_A_BEGIN(arg1) __API_A_BEGIN(arg2) __API_A_BEGIN(arg3) __API_A_BEGIN(arg4) __API_A_BEGIN(arg5)
|
||||
#define __API_AVAILABLE_BEGIN6(arg0,arg1,arg2,arg3,arg4,arg5,arg6) __API_A_BEGIN(arg0) __API_A_BEGIN(arg1) __API_A_BEGIN(arg2) __API_A_BEGIN(arg3) __API_A_BEGIN(arg4) __API_A_BEGIN(arg5) __API_A_BEGIN(arg6)
|
||||
#define __API_AVAILABLE_BEGIN7(arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7) __API_A_BEGIN(arg0) __API_A_BEGIN(arg1) __API_A_BEGIN(arg2) __API_A_BEGIN(arg3) __API_A_BEGIN(arg4) __API_A_BEGIN(arg5) __API_A_BEGIN(arg6) __API_A_BEGIN(arg7)
|
||||
#define __API_AVAILABLE_BEGIN_GET_MACRO(_0,_1,_2,_3,_4,_5,_6,_7,NAME,...) NAME
|
||||
#define __API_AVAILABLE_BEGIN8(arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) __API_A_BEGIN(arg0) __API_A_BEGIN(arg1) __API_A_BEGIN(arg2) __API_A_BEGIN(arg3) __API_A_BEGIN(arg4) __API_A_BEGIN(arg5) __API_A_BEGIN(arg6) __API_A_BEGIN(arg7) __API_A_BEGIN(arg8)
|
||||
#define __API_AVAILABLE_BEGIN_GET_MACRO(_0,_1,_2,_3,_4,_5,_6,_7,_8,NAME,...) NAME
|
||||
|
||||
|
||||
|
||||
@@ -244,7 +266,8 @@
|
||||
#define __API_DEPRECATED_MSG5(msg,arg0,arg1,arg2,arg3,arg4,arg5) __API_D(msg,arg0) __API_D(msg,arg1) __API_D(msg,arg2) __API_D(msg,arg3) __API_D(msg,arg4) __API_D(msg,arg5)
|
||||
#define __API_DEPRECATED_MSG6(msg,arg0,arg1,arg2,arg3,arg4,arg5,arg6) __API_D(msg,arg0) __API_D(msg,arg1) __API_D(msg,arg2) __API_D(msg,arg3) __API_D(msg,arg4) __API_D(msg,arg5) __API_D(msg,arg6)
|
||||
#define __API_DEPRECATED_MSG7(msg,arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7) __API_D(msg,arg0) __API_D(msg,arg1) __API_D(msg,arg2) __API_D(msg,arg3) __API_D(msg,arg4) __API_D(msg,arg5) __API_D(msg,arg6) __API_D(msg,arg7)
|
||||
#define __API_DEPRECATED_MSG_GET_MACRO(_0,_1,_2,_3,_4,_5,_6,_7,_8,NAME,...) NAME
|
||||
#define __API_DEPRECATED_MSG8(msg,arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) __API_D(msg,arg0) __API_D(msg,arg1) __API_D(msg,arg2) __API_D(msg,arg3) __API_D(msg,arg4) __API_D(msg,arg5) __API_D(msg,arg6) __API_D(msg,arg7) __API_D(msg,arg8)
|
||||
#define __API_DEPRECATED_MSG_GET_MACRO(_0,_1,_2,_3,_4,_5,_6,_7,_8,_9,NAME,...) NAME
|
||||
|
||||
#define __API_D_BEGIN(msg, x) _Pragma(__API_RANGE_STRINGIFY (clang attribute (__attribute__((availability(__API_DEPRECATED_PLATFORM_##x,message=msg))), apply_to = __API_APPLY_TO)))
|
||||
|
||||
@@ -256,7 +279,8 @@
|
||||
#define __API_DEPRECATED_BEGIN5(msg,arg0,arg1,arg2,arg3,arg4,arg5) __API_D_BEGIN(msg,arg0) __API_D_BEGIN(msg,arg1) __API_D_BEGIN(msg,arg2) __API_D_BEGIN(msg,arg3) __API_D_BEGIN(msg,arg4) __API_D_BEGIN(msg,arg5)
|
||||
#define __API_DEPRECATED_BEGIN6(msg,arg0,arg1,arg2,arg3,arg4,arg5,arg6) __API_D_BEGIN(msg,arg0) __API_D_BEGIN(msg,arg1) __API_D_BEGIN(msg,arg2) __API_D_BEGIN(msg,arg3) __API_D_BEGIN(msg,arg4) __API_D_BEGIN(msg,arg5) __API_D_BEGIN(msg,arg6)
|
||||
#define __API_DEPRECATED_BEGIN7(msg,arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7) __API_D_BEGIN(msg,arg0) __API_D_BEGIN(msg,arg1) __API_D_BEGIN(msg,arg2) __API_D_BEGIN(msg,arg3) __API_D_BEGIN(msg,arg4) __API_D_BEGIN(msg,arg5) __API_D_BEGIN(msg,arg6) __API_D_BEGIN(msg,arg7)
|
||||
#define __API_DEPRECATED_BEGIN_GET_MACRO(_0,_1,_2,_3,_4,_5,_6,_7,_8,NAME,...) NAME
|
||||
#define __API_DEPRECATED_BEGIN8(msg,arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) __API_D_BEGIN(msg,arg0) __API_D_BEGIN(msg,arg1) __API_D_BEGIN(msg,arg2) __API_D_BEGIN(msg,arg3) __API_D_BEGIN(msg,arg4) __API_D_BEGIN(msg,arg5) __API_D_BEGIN(msg,arg6) __API_D_BEGIN(msg,arg7) __API_D_BEGIN(msg,arg8)
|
||||
#define __API_DEPRECATED_BEGIN_GET_MACRO(_0,_1,_2,_3,_4,_5,_6,_7,_8,_9,NAME,...) NAME
|
||||
|
||||
#if __has_feature(attribute_availability_with_replacement)
|
||||
#define __API_R(rep,x) __attribute__((availability(__API_DEPRECATED_PLATFORM_##x,replacement=rep)))
|
||||
@@ -272,7 +296,8 @@
|
||||
#define __API_DEPRECATED_REP5(msg,arg0,arg1,arg2,arg3,arg4,arg5) __API_R(msg,arg0) __API_R(msg,arg1) __API_R(msg,arg2) __API_R(msg,arg3) __API_R(msg,arg4) __API_R(msg,arg5)
|
||||
#define __API_DEPRECATED_REP6(msg,arg0,arg1,arg2,arg3,arg4,arg5,arg6) __API_R(msg,arg0) __API_R(msg,arg1) __API_R(msg,arg2) __API_R(msg,arg3) __API_R(msg,arg4) __API_R(msg,arg5) __API_R(msg,arg6)
|
||||
#define __API_DEPRECATED_REP7(msg,arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7) __API_R(msg,arg0) __API_R(msg,arg1) __API_R(msg,arg2) __API_R(msg,arg3) __API_R(msg,arg4) __API_R(msg,arg5) __API_R(msg,arg6) __API_R(msg,arg7)
|
||||
#define __API_DEPRECATED_REP_GET_MACRO(_0,_1,_2,_3,_4,_5,_6,_7,_8,NAME,...) NAME
|
||||
#define __API_DEPRECATED_REP8(msg,arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) __API_R(msg,arg0) __API_R(msg,arg1) __API_R(msg,arg2) __API_R(msg,arg3) __API_R(msg,arg4) __API_R(msg,arg5) __API_R(msg,arg6) __API_R(msg,arg7) __API_R(msg,arg8)
|
||||
#define __API_DEPRECATED_REP_GET_MACRO(_0,_1,_2,_3,_4,_5,_6,_7,_8,_9,NAME,...) NAME
|
||||
|
||||
#if __has_feature(attribute_availability_with_replacement)
|
||||
#define __API_R_BEGIN(rep,x) _Pragma(__API_RANGE_STRINGIFY (clang attribute (__attribute__((availability(__API_DEPRECATED_PLATFORM_##x,replacement=rep))), apply_to = __API_APPLY_TO)))
|
||||
@@ -280,15 +305,16 @@
|
||||
#define __API_R_BEGIN(rep,x) _Pragma(__API_RANGE_STRINGIFY (clang attribute (__attribute__((availability(__API_DEPRECATED_PLATFORM_##x))), apply_to = __API_APPLY_TO)))
|
||||
#endif
|
||||
|
||||
#define __API_DEPRECATED_BEGIN_REP0(msg,arg0) __API_R_BEGIN(msg,arg0)
|
||||
#define __API_DEPRECATED_BEGIN_REP1(msg,arg0,arg1) __API_R_BEGIN(msg,arg0) __API_R_BEGIN(msg,arg1)
|
||||
#define __API_DEPRECATED_BEGIN_REP2(msg,arg0,arg1,arg2) __API_R_BEGIN(msg,arg0) __API_R_BEGIN(msg,arg1) __API_R_BEGIN(msg,arg2)
|
||||
#define __API_DEPRECATED_BEGIN_REP3(msg,arg0,arg1,arg2,arg3) __API_R_BEGIN(msg,arg0) __API_R_BEGIN(msg,arg1) __API_R_BEGIN(msg,arg2) __API_R_BEGIN(msg,arg3)
|
||||
#define __API_DEPRECATED_BEGIN_REP4(msg,arg0,arg1,arg2,arg3,arg4) __API_R_BEGIN(msg,arg0) __API_R_BEGIN(msg,arg1) __API_R_BEGIN(msg,arg2) __API_R_BEGIN(msg,arg3) __API_R_BEGIN(msg,arg4)
|
||||
#define __API_DEPRECATED_BEGIN_REP5(msg,arg0,arg1,arg2,arg3,arg4,arg5) __API_R_BEGIN(msg,arg0) __API_R_BEGIN(msg,arg1) __API_R_BEGIN(msg,arg2) __API_R_BEGIN(msg,arg3) __API_R_BEGIN(msg,arg4) __API_R_BEGIN(msg,arg5)
|
||||
#define __API_DEPRECATED_BEGIN_REP6(msg,arg0,arg1,arg2,arg3,arg4,arg5,arg6) __API_R_BEGIN(msg,arg0) __API_R_BEGIN(msg,arg1) __API_R_BEGIN(msg,arg2) __API_R_BEGIN(msg,arg3) __API_R_BEGIN(msg,arg4) __API_R_BEGIN(msg,arg5) __API_R_BEGIN(msg,arg6)
|
||||
#define __API_DEPRECATED_BEGIN_REP7(msg,arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7) __API_R_BEGIN(msg,arg0) __API_R_BEGIN(msg,arg1) __API_R_BEGIN(msg,arg2) __API_R_BEGIN(msg,arg3) __API_R_BEGIN(msg,arg4) __API_R_BEGIN(msg,arg5) __API_R_BEGIN(msg,arg6) __API_R_BEGIN(msg,arg7)
|
||||
#define __API_DEPRECATED_BEGIN_REP_GET_MACRO(_0,_1,_2,_3,_4,_5,_6,_7,_8,NAME,...) NAME
|
||||
#define __API_DEPRECATED_WITH_REPLACEMENT_BEGIN0(msg,arg0) __API_R_BEGIN(msg,arg0)
|
||||
#define __API_DEPRECATED_WITH_REPLACEMENT_BEGIN1(msg,arg0,arg1) __API_R_BEGIN(msg,arg0) __API_R_BEGIN(msg,arg1)
|
||||
#define __API_DEPRECATED_WITH_REPLACEMENT_BEGIN2(msg,arg0,arg1,arg2) __API_R_BEGIN(msg,arg0) __API_R_BEGIN(msg,arg1) __API_R_BEGIN(msg,arg2)
|
||||
#define __API_DEPRECATED_WITH_REPLACEMENT_BEGIN3(msg,arg0,arg1,arg2,arg3) __API_R_BEGIN(msg,arg0) __API_R_BEGIN(msg,arg1) __API_R_BEGIN(msg,arg2) __API_R_BEGIN(msg,arg3)
|
||||
#define __API_DEPRECATED_WITH_REPLACEMENT_BEGIN4(msg,arg0,arg1,arg2,arg3,arg4) __API_R_BEGIN(msg,arg0) __API_R_BEGIN(msg,arg1) __API_R_BEGIN(msg,arg2) __API_R_BEGIN(msg,arg3) __API_R_BEGIN(msg,arg4)
|
||||
#define __API_DEPRECATED_WITH_REPLACEMENT_BEGIN5(msg,arg0,arg1,arg2,arg3,arg4,arg5) __API_R_BEGIN(msg,arg0) __API_R_BEGIN(msg,arg1) __API_R_BEGIN(msg,arg2) __API_R_BEGIN(msg,arg3) __API_R_BEGIN(msg,arg4) __API_R_BEGIN(msg,arg5)
|
||||
#define __API_DEPRECATED_WITH_REPLACEMENT_BEGIN6(msg,arg0,arg1,arg2,arg3,arg4,arg5,arg6) __API_R_BEGIN(msg,arg0) __API_R_BEGIN(msg,arg1) __API_R_BEGIN(msg,arg2) __API_R_BEGIN(msg,arg3) __API_R_BEGIN(msg,arg4) __API_R_BEGIN(msg,arg5) __API_R_BEGIN(msg,arg6)
|
||||
#define __API_DEPRECATED_WITH_REPLACEMENT_BEGIN7(msg,arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7) __API_R_BEGIN(msg,arg0) __API_R_BEGIN(msg,arg1) __API_R_BEGIN(msg,arg2) __API_R_BEGIN(msg,arg3) __API_R_BEGIN(msg,arg4) __API_R_BEGIN(msg,arg5) __API_R_BEGIN(msg,arg6) __API_R_BEGIN(msg,arg7)
|
||||
#define __API_DEPRECATED_WITH_REPLACEMENT_BEGIN8(msg,arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) __API_R_BEGIN(msg,arg0) __API_R_BEGIN(msg,arg1) __API_R_BEGIN(msg,arg2) __API_R_BEGIN(msg,arg3) __API_R_BEGIN(msg,arg4) __API_R_BEGIN(msg,arg5) __API_R_BEGIN(msg,arg6) __API_R_BEGIN(msg,arg7) __API_R_BEGIN(msg,arg8)
|
||||
#define __API_DEPRECATED_WITH_REPLACEMENT_BEGIN_GET_MACRO(_0,_1,_2,_3,_4,_5,_6,_7,_8,_9,NAME,...) NAME
|
||||
|
||||
/*
|
||||
* API Unavailability
|
||||
@@ -309,7 +335,8 @@
|
||||
#define __API_UNAVAILABLE5(arg0,arg1,arg2,arg3,arg4,arg5) __API_U(arg0) __API_U(arg1) __API_U(arg2) __API_U(arg3) __API_U(arg4) __API_U(arg5)
|
||||
#define __API_UNAVAILABLE6(arg0,arg1,arg2,arg3,arg4,arg5,arg6) __API_U(arg0) __API_U(arg1) __API_U(arg2) __API_U(arg3) __API_U(arg4) __API_U(arg5) __API_U(arg6)
|
||||
#define __API_UNAVAILABLE7(arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7) __API_U(arg0) __API_U(arg1) __API_U(arg2) __API_U(arg3) __API_U(arg4) __API_U(arg5) __API_U(arg6) __API_U(arg7)
|
||||
#define __API_UNAVAILABLE_GET_MACRO(_0,_1,_2,_3,_4,_5,_6,_7,NAME,...) NAME
|
||||
#define __API_UNAVAILABLE8(arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) __API_U(arg0) __API_U(arg1) __API_U(arg2) __API_U(arg3) __API_U(arg4) __API_U(arg5) __API_U(arg6) __API_U(arg7) __API_U(arg8)
|
||||
#define __API_UNAVAILABLE_GET_MACRO(_0,_1,_2,_3,_4,_5,_6,_7,_8,NAME,...) NAME
|
||||
|
||||
#define __API_U_BEGIN(x) _Pragma(__API_RANGE_STRINGIFY (clang attribute (__attribute__((availability(__API_UNAVAILABLE_PLATFORM_##x))), apply_to = __API_APPLY_TO)))
|
||||
|
||||
@@ -321,7 +348,8 @@
|
||||
#define __API_UNAVAILABLE_BEGIN5(arg0,arg1,arg2,arg3,arg4,arg5) __API_U_BEGIN(arg0) __API_U_BEGIN(arg1) __API_U_BEGIN(arg2) __API_U_BEGIN(arg3) __API_U_BEGIN(arg4) __API_U_BEGIN(arg5)
|
||||
#define __API_UNAVAILABLE_BEGIN6(arg0,arg1,arg2,arg3,arg4,arg5,arg6) __API_U_BEGIN(arg0) __API_U_BEGIN(arg1) __API_U_BEGIN(arg2) __API_U_BEGIN(arg3) __API_U_BEGIN(arg4) __API_U_BEGIN(arg5) __API_U_BEGIN(arg6)
|
||||
#define __API_UNAVAILABLE_BEGIN7(arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7) __API_U_BEGIN(arg0) __API_U_BEGIN(arg1) __API_U_BEGIN(arg2) __API_U_BEGIN(arg3) __API_U_BEGIN(arg4) __API_U_BEGIN(arg5) __API_U_BEGIN(arg6) __API_U_BEGIN(arg7)
|
||||
#define __API_UNAVAILABLE_BEGIN_GET_MACRO(_0,_1,_2,_3,_4,_5,_6,_7,NAME,...) NAME
|
||||
#define __API_UNAVAILABLE_BEGIN8(arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) __API_U_BEGIN(arg0) __API_U_BEGIN(arg1) __API_U_BEGIN(arg2) __API_U_BEGIN(arg3) __API_U_BEGIN(arg4) __API_U_BEGIN(arg5) __API_U_BEGIN(arg6) __API_U_BEGIN(arg7) __API_U_BEGIN(arg8)
|
||||
#define __API_UNAVAILABLE_BEGIN_GET_MACRO(_0,_1,_2,_3,_4,_5,_6,_7,_8,NAME,...) NAME
|
||||
|
||||
#endif /* __has_attribute(availability) */
|
||||
#endif /* #if defined(__has_feature) && defined(__has_attribute) */
|
||||
@@ -346,12 +374,4 @@
|
||||
#define __swift_compiler_version_at_least(...) 1
|
||||
#endif
|
||||
|
||||
/*
|
||||
* If __SPI_AVAILABLE has not been defined elsewhere, disable it.
|
||||
*/
|
||||
|
||||
#ifndef __SPI_AVAILABLE
|
||||
#define __SPI_AVAILABLE(...)
|
||||
#endif
|
||||
|
||||
#endif /* __AVAILABILITY_INTERNAL__ */
|
||||
|
||||
@@ -31,6 +31,8 @@
|
||||
#ifndef __AVAILABILITY_INTERNAL_LEGACY__
|
||||
#define __AVAILABILITY_INTERNAL_LEGACY__
|
||||
|
||||
#include <AvailabilityInternal.h>
|
||||
|
||||
#if defined(__has_builtin)
|
||||
#if __has_builtin(__is_target_arch)
|
||||
#if __has_builtin(__is_target_vendor)
|
||||
|
||||
@@ -70,13 +70,24 @@
|
||||
#define __MAC_12_3 120300
|
||||
#define __MAC_12_4 120400
|
||||
#define __MAC_12_5 120500
|
||||
#define __MAC_12_6 120600
|
||||
#define __MAC_12_7 120700
|
||||
#define __MAC_13_0 130000
|
||||
#define __MAC_13_1 130100
|
||||
#define __MAC_13_1 130100
|
||||
#define __MAC_13_2 130200
|
||||
#define __MAC_13_3 130300
|
||||
#define __MAC_13_4 130400
|
||||
#define __MAC_13_5 130500
|
||||
#define __MAC_13_6 130600
|
||||
#define __MAC_14_0 140000
|
||||
#define __MAC_14_1 140100
|
||||
#define __MAC_14_2 140200
|
||||
#define __MAC_14_3 140300
|
||||
#define __MAC_14_4 140400
|
||||
#define __MAC_14_5 140500
|
||||
#define __MAC_15_0 150000
|
||||
#define __MAC_15_1 150100
|
||||
/* __MAC__NA is not defined to a value but is used as a token by macros to indicate that the API is unavailable */
|
||||
|
||||
#define __IPHONE_2_0 20000
|
||||
@@ -143,13 +154,24 @@
|
||||
#define __IPHONE_15_4 150400
|
||||
#define __IPHONE_15_5 150500
|
||||
#define __IPHONE_15_6 150600
|
||||
#define __IPHONE_15_7 150700
|
||||
#define __IPHONE_15_8 150800
|
||||
#define __IPHONE_16_0 160000
|
||||
#define __IPHONE_16_1 160100
|
||||
#define __IPHONE_16_2 160200
|
||||
#define __IPHONE_16_3 160300
|
||||
#define __IPHONE_16_4 160400
|
||||
#define __IPHONE_16_5 160500
|
||||
#define __IPHONE_16_6 160600
|
||||
#define __IPHONE_16_7 160700
|
||||
#define __IPHONE_17_0 170000
|
||||
#define __IPHONE_17_1 170100
|
||||
#define __IPHONE_17_2 170200
|
||||
#define __IPHONE_17_3 170300
|
||||
#define __IPHONE_17_4 170400
|
||||
#define __IPHONE_17_5 170500
|
||||
#define __IPHONE_18_0 180000
|
||||
#define __IPHONE_18_1 180100
|
||||
/* __IPHONE__NA is not defined to a value but is used as a token by macros to indicate that the API is unavailable */
|
||||
|
||||
#define __WATCHOS_1_0 10000
|
||||
@@ -185,13 +207,22 @@
|
||||
#define __WATCHOS_8_5 80500
|
||||
#define __WATCHOS_8_6 80600
|
||||
#define __WATCHOS_8_7 80700
|
||||
#define __WATCHOS_8_8 80800
|
||||
#define __WATCHOS_9_0 90000
|
||||
#define __WATCHOS_9_1 90100
|
||||
#define __WATCHOS_9_2 90200
|
||||
#define __WATCHOS_9_3 90300
|
||||
#define __WATCHOS_9_4 90400
|
||||
#define __WATCHOS_9_5 90500
|
||||
#define __WATCHOS_9_6 90600
|
||||
#define __WATCHOS_10_0 100000
|
||||
#define __WATCHOS_10_1 100100
|
||||
#define __WATCHOS_10_2 100200
|
||||
#define __WATCHOS_10_3 100300
|
||||
#define __WATCHOS_10_4 100400
|
||||
#define __WATCHOS_10_5 100500
|
||||
#define __WATCHOS_11_0 110000
|
||||
#define __WATCHOS_11_1 110100
|
||||
/* __WATCHOS__NA is not defined to a value but is used as a token by macros to indicate that the API is unavailable */
|
||||
|
||||
#define __TVOS_9_0 90000
|
||||
@@ -235,7 +266,15 @@
|
||||
#define __TVOS_16_3 160300
|
||||
#define __TVOS_16_4 160400
|
||||
#define __TVOS_16_5 160500
|
||||
#define __TVOS_16_6 160600
|
||||
#define __TVOS_17_0 170000
|
||||
#define __TVOS_17_1 170100
|
||||
#define __TVOS_17_2 170200
|
||||
#define __TVOS_17_3 170300
|
||||
#define __TVOS_17_4 170400
|
||||
#define __TVOS_17_5 170500
|
||||
#define __TVOS_18_0 180000
|
||||
#define __TVOS_18_1 180100
|
||||
/* __TVOS__NA is not defined to a value but is used as a token by macros to indicate that the API is unavailable */
|
||||
|
||||
#define __BRIDGEOS_2_0 20000
|
||||
@@ -258,7 +297,15 @@
|
||||
#define __BRIDGEOS_7_2 70200
|
||||
#define __BRIDGEOS_7_3 70300
|
||||
#define __BRIDGEOS_7_4 70400
|
||||
#define __BRIDGEOS_7_6 70600
|
||||
#define __BRIDGEOS_8_0 80000
|
||||
#define __BRIDGEOS_8_1 80100
|
||||
#define __BRIDGEOS_8_2 80200
|
||||
#define __BRIDGEOS_8_3 80300
|
||||
#define __BRIDGEOS_8_4 80400
|
||||
#define __BRIDGEOS_8_5 80500
|
||||
#define __BRIDGEOS_9_0 90000
|
||||
#define __BRIDGEOS_9_1 90100
|
||||
|
||||
|
||||
#define __DRIVERKIT_19_0 190000
|
||||
@@ -267,13 +314,31 @@
|
||||
#define __DRIVERKIT_22_0 220000
|
||||
#define __DRIVERKIT_22_4 220400
|
||||
#define __DRIVERKIT_22_5 220500
|
||||
#define __DRIVERKIT_22_6 220600
|
||||
#define __DRIVERKIT_23_0 230000
|
||||
#define __DRIVERKIT_23_1 230100
|
||||
#define __DRIVERKIT_23_2 230200
|
||||
#define __DRIVERKIT_23_3 230300
|
||||
#define __DRIVERKIT_23_4 230400
|
||||
#define __DRIVERKIT_23_5 230500
|
||||
#define __DRIVERKIT_24_0 240000
|
||||
#define __DRIVERKIT_24_1 240100
|
||||
/* __DRIVERKIT__NA is not defined to a value but is used as a token by macros to indicate that the API is unavailable */
|
||||
|
||||
#define __XROS_1_0 10000
|
||||
/* __XROS__NA is not defined to a value but is used as a token by macros to indicate that the API is unavailable */
|
||||
#define __VISIONOS_1_0 10000
|
||||
#define __VISIONOS_1_1 10100
|
||||
#define __VISIONOS_1_2 10200
|
||||
#define __VISIONOS_2_0 20000
|
||||
#define __VISIONOS_2_1 20100
|
||||
/* __VISIONOS__NA is not defined to a value but is used as a token by macros to indicate that the API is unavailable */
|
||||
|
||||
|
||||
|
||||
|
||||
#ifndef __OPEN_SOURCE__
|
||||
|
||||
#endif /* __OPEN_SOURCE__ */
|
||||
|
||||
/*
|
||||
* Set up standard Mac OS X versions
|
||||
*/
|
||||
@@ -326,13 +391,24 @@
|
||||
#define MAC_OS_VERSION_12_3 __MAC_12_3
|
||||
#define MAC_OS_VERSION_12_4 __MAC_12_4
|
||||
#define MAC_OS_VERSION_12_5 __MAC_12_5
|
||||
#define MAC_OS_VERSION_12_6 __MAC_12_6
|
||||
#define MAC_OS_VERSION_12_7 __MAC_12_7
|
||||
#define MAC_OS_VERSION_13_0 __MAC_13_0
|
||||
#define MAC_OS_VERSION_13_1 __MAC_13_1
|
||||
#define MAC_OS_VERSION_13_1 __MAC_13_1
|
||||
#define MAC_OS_VERSION_13_2 __MAC_13_2
|
||||
#define MAC_OS_VERSION_13_3 __MAC_13_3
|
||||
#define MAC_OS_VERSION_13_4 __MAC_13_4
|
||||
#define MAC_OS_VERSION_13_5 __MAC_13_5
|
||||
#define MAC_OS_VERSION_13_6 __MAC_13_6
|
||||
#define MAC_OS_VERSION_14_0 __MAC_14_0
|
||||
#define MAC_OS_VERSION_14_1 __MAC_14_1
|
||||
#define MAC_OS_VERSION_14_2 __MAC_14_2
|
||||
#define MAC_OS_VERSION_14_3 __MAC_14_3
|
||||
#define MAC_OS_VERSION_14_4 __MAC_14_4
|
||||
#define MAC_OS_VERSION_14_5 __MAC_14_5
|
||||
#define MAC_OS_VERSION_15_0 __MAC_15_0
|
||||
#define MAC_OS_VERSION_15_1 __MAC_15_1
|
||||
|
||||
#endif /* #if (!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)) || defined(_DARWIN_C_SOURCE) */
|
||||
|
||||
|
||||
16
lib/libc/include/any-macos-any/MacTypes.h
vendored
16
lib/libc/include/any-macos-any/MacTypes.h
vendored
@@ -37,10 +37,12 @@
|
||||
#ifndef __MACTYPES__
|
||||
#define __MACTYPES__
|
||||
|
||||
#ifndef __CONDITIONALMACROS__
|
||||
#if __has_include(<ConditionalMacros.h>)
|
||||
#include <ConditionalMacros.h>
|
||||
#endif
|
||||
|
||||
#include <TargetConditionals.h>
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
@@ -153,7 +155,7 @@ typedef struct UnsignedWide UnsignedWide;
|
||||
|
||||
#endif
|
||||
|
||||
#if TYPE_LONGLONG
|
||||
#if TYPE_LONGLONG || 0
|
||||
/*
|
||||
Note: wide and UnsignedWide must always be structs for source code
|
||||
compatibility. On the other hand UInt64 and SInt64 can be
|
||||
@@ -178,7 +180,7 @@ typedef struct UnsignedWide UnsignedWide;
|
||||
|
||||
typedef wide SInt64;
|
||||
typedef UnsignedWide UInt64;
|
||||
#endif /* TYPE_LONGLONG */
|
||||
#endif
|
||||
|
||||
/********************************************************************************
|
||||
|
||||
@@ -307,6 +309,8 @@ typedef ResType * ResTypePtr;
|
||||
|
||||
*********************************************************************************/
|
||||
typedef unsigned char Boolean;
|
||||
|
||||
#if !0
|
||||
/********************************************************************************
|
||||
|
||||
Function Pointer Types
|
||||
@@ -330,6 +334,8 @@ typedef ProcPtr UniversalProcPtr;
|
||||
|
||||
typedef ProcPtr * ProcHandle;
|
||||
typedef UniversalProcPtr * UniversalProcHandle;
|
||||
#endif
|
||||
|
||||
/********************************************************************************
|
||||
|
||||
RefCon Types
|
||||
@@ -691,6 +697,8 @@ typedef UnsignedWide * UnsignedWidePtr;
|
||||
typedef Float80 extended80;
|
||||
typedef Float96 extended96;
|
||||
typedef SInt8 VHSelect;
|
||||
|
||||
#if !0
|
||||
/*********************************************************************************
|
||||
|
||||
Debugger functions
|
||||
@@ -718,7 +726,7 @@ Debugger(void) __OSX_AVAILABLE_BU
|
||||
*/
|
||||
extern void
|
||||
DebugStr(ConstStr255Param debuggerMsg) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_NA, __IPHONE_NA);
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
* debugstr()
|
||||
|
||||
716
lib/libc/include/any-macos-any/TargetConditionals.h
vendored
716
lib/libc/include/any-macos-any/TargetConditionals.h
vendored
@@ -51,49 +51,56 @@
|
||||
* TARGET_CPU_MIPS - Compiler is generating MIPS instructions
|
||||
* TARGET_CPU_SPARC - Compiler is generating Sparc instructions
|
||||
* TARGET_CPU_ALPHA - Compiler is generating Dec Alpha instructions
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* TARGET_OS_*
|
||||
*
|
||||
* These conditionals specify in which Operating System the generated code will
|
||||
* run. Indention is used to show which conditionals are evolutionary subclasses.
|
||||
*
|
||||
* The MAC/WIN32/UNIX conditionals are mutually exclusive.
|
||||
* The IOS/TV/WATCH conditionals are mutually exclusive.
|
||||
* The IOS/TV/WATCH/VISION conditionals are mutually exclusive.
|
||||
*
|
||||
* TARGET_OS_WIN32 - Generated code will run on WIN32 API
|
||||
* TARGET_OS_WINDOWS - Generated code will run on Windows
|
||||
* TARGET_OS_UNIX - Generated code will run on some Unix (not macOS)
|
||||
* TARGET_OS_LINUX - Generated code will run on Linux
|
||||
* TARGET_OS_MAC - Generated code will run on a variant of macOS
|
||||
* TARGET_OS_OSX - Generated code will run on macOS
|
||||
* TARGET_OS_IPHONE - Generated code will run on a variant of iOS (firmware, devices, simulator)
|
||||
* TARGET_OS_IOS - Generated code will run on iOS
|
||||
* TARGET_OS_MACCATALYST - Generated code will run on macOS
|
||||
* TARGET_OS_TV - Generated code will run on tvOS
|
||||
* TARGET_OS_WATCH - Generated code will run on watchOS
|
||||
* TARGET_OS_VISION - Generated code will run on visionOS
|
||||
* TARGET_OS_BRIDGE - Generated code will run on bridge devices
|
||||
* TARGET_OS_SIMULATOR - Generated code will run on an iOS, tvOS, watchOS, or visionOS simulator
|
||||
* TARGET_OS_DRIVERKIT - Generated code will run on macOS, iOS, tvOS, watchOS, or visionOS
|
||||
*
|
||||
* TARGET_OS_WIN32 - Generated code will run under WIN32 API
|
||||
* TARGET_OS_WINDOWS - Generated code will run under Windows
|
||||
* TARGET_OS_UNIX - Generated code will run under some Unix (not OSX)
|
||||
* TARGET_OS_LINUX - Generated code will run under Linux
|
||||
* TARGET_OS_MAC - Generated code will run under Mac OS X variant
|
||||
* TARGET_OS_OSX - Generated code will run under OS X devices
|
||||
* TARGET_OS_IPHONE - Generated code for firmware, devices, or simulator
|
||||
* TARGET_OS_IOS - Generated code will run under iOS
|
||||
* TARGET_OS_TV - Generated code will run under Apple TV OS
|
||||
* TARGET_OS_WATCH - Generated code will run under Apple Watch OS
|
||||
* TARGET_OS_BRIDGE - Generated code will run under Bridge devices
|
||||
* TARGET_OS_MACCATALYST - Generated code will run under macOS
|
||||
* TARGET_OS_DRIVERKIT - Generated code will run under macOS, iOS, Apple TV OS, or Apple Watch OS
|
||||
* TARGET_OS_SIMULATOR - Generated code will run under a simulator
|
||||
* TARGET_OS_EMBEDDED - DEPRECATED: Use TARGET_OS_IPHONE and/or TARGET_OS_SIMULATOR instead
|
||||
* TARGET_IPHONE_SIMULATOR - DEPRECATED: Same as TARGET_OS_SIMULATOR
|
||||
* TARGET_OS_NANO - DEPRECATED: Same as TARGET_OS_WATCH
|
||||
*
|
||||
* TARGET_OS_EMBEDDED - DEPRECATED: Use TARGET_OS_IPHONE and/or TARGET_OS_SIMULATOR instead
|
||||
* TARGET_IPHONE_SIMULATOR - DEPRECATED: Same as TARGET_OS_SIMULATOR
|
||||
* TARGET_OS_NANO - DEPRECATED: Same as TARGET_OS_WATCH
|
||||
*
|
||||
* +---------------------------------------------------------------------------+
|
||||
* | TARGET_OS_MAC |
|
||||
* | +-----+ +-------------------------------------------------+ +-----------+ |
|
||||
* | | | | TARGET_OS_IPHONE | | | |
|
||||
* | | | | +-----------------+ +----+ +-------+ +--------+ | | | |
|
||||
* | | | | | IOS | | | | | | | | | | |
|
||||
* | | OSX | | | +-------------+ | | TV | | WATCH | | BRIDGE | | | DRIVERKIT | |
|
||||
* | | | | | | MACCATALYST | | | | | | | | | | | |
|
||||
* | | | | | +-------------+ | | | | | | | | | | |
|
||||
* | | | | +-----------------+ +----+ +-------+ +--------+ | | | |
|
||||
* | +-----+ +-------------------------------------------------+ +-----------+ |
|
||||
* +---------------------------------------------------------------------------+
|
||||
* +--------------------------------------------------------------------------------------+
|
||||
* | TARGET_OS_MAC |
|
||||
* | +-----+ +------------------------------------------------------------+ +-----------+ |
|
||||
* | | | | TARGET_OS_IPHONE | | | |
|
||||
* | | | | +-----------------+ +----+ +-------+ +--------+ +--------+ | | | |
|
||||
* | | | | | IOS | | | | | | | | | | | | |
|
||||
* | | OSX | | | +-------------+ | | TV | | WATCH | | BRIDGE | | VISION | | | DRIVERKIT | |
|
||||
* | | | | | | MACCATALYST | | | | | | | | | | | | | |
|
||||
* | | | | | +-------------+ | | | | | | | | | | | | |
|
||||
* | | | | +-----------------+ +----+ +-------+ +--------+ +--------+ | | | |
|
||||
* | +-----+ +------------------------------------------------------------+ +-----------+ |
|
||||
* +--------------------------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
/*
|
||||
* TARGET_RT_*
|
||||
*
|
||||
* These conditionals specify in which runtime the generated code will
|
||||
* run. This is needed when the OS and CPU support more than one runtime
|
||||
* (e.g. Mac OS X supports CFM and mach-o).
|
||||
@@ -105,7 +112,7 @@
|
||||
* TARGET_RT_MAC_MACHO - TARGET_OS_MAC is true and Mach-O/dlyd runtime is used
|
||||
*/
|
||||
|
||||
/*
|
||||
/*
|
||||
* TARGET_OS conditionals can be enabled via clang preprocessor extensions:
|
||||
*
|
||||
* __is_target_arch
|
||||
@@ -130,6 +137,7 @@
|
||||
* It is disabled by default.
|
||||
*/
|
||||
|
||||
#if !defined(__has_extension) || !__has_extension(define_target_os_macros)
|
||||
#if defined(__has_builtin)
|
||||
#if __has_builtin(__is_target_arch)
|
||||
#if __has_builtin(__is_target_vendor)
|
||||
@@ -141,26 +149,15 @@
|
||||
/* "-target=arm64e-apple-ios12-macabi" */
|
||||
#if (__is_target_arch(x86_64) || __is_target_arch(arm64) || __is_target_arch(arm64e)) && __is_target_vendor(apple) && __is_target_os(ios) && __is_target_environment(macabi)
|
||||
#define TARGET_OS_MAC 1
|
||||
#define TARGET_OS_OSX 0
|
||||
#define TARGET_OS_IPHONE 1
|
||||
#define TARGET_OS_IOS 1
|
||||
#define TARGET_OS_WATCH 0
|
||||
|
||||
#define TARGET_OS_TV 0
|
||||
#define TARGET_OS_SIMULATOR 0
|
||||
#define TARGET_OS_EMBEDDED 0
|
||||
#define TARGET_OS_RTKIT 0
|
||||
#define TARGET_OS_MACCATALYST 1
|
||||
#define TARGET_OS_MACCATALYST 1
|
||||
|
||||
#define TARGET_OS_VISION 0
|
||||
|
||||
|
||||
#ifndef TARGET_OS_UIKITFORMAC
|
||||
#define TARGET_OS_UIKITFORMAC 1
|
||||
#endif
|
||||
#define TARGET_OS_DRIVERKIT 0
|
||||
#define DYNAMIC_TARGETS_ENABLED 1
|
||||
#define TARGET_OS_UNIX 0
|
||||
#define DYNAMIC_TARGETS_ENABLED 1
|
||||
#endif
|
||||
|
||||
/* "-target=x86_64-apple-ios12-simulator" */
|
||||
@@ -168,131 +165,42 @@
|
||||
/* "-target=arm64e-apple-ios12-simulator" */
|
||||
#if (__is_target_arch(x86_64) || __is_target_arch(arm64) || __is_target_arch(arm64e)) && __is_target_vendor(apple) && __is_target_os(ios) && __is_target_environment(simulator)
|
||||
#define TARGET_OS_MAC 1
|
||||
#define TARGET_OS_OSX 0
|
||||
#define TARGET_OS_IPHONE 1
|
||||
#define TARGET_OS_IOS 1
|
||||
#define TARGET_OS_WATCH 0
|
||||
|
||||
#define TARGET_OS_TV 0
|
||||
#define TARGET_OS_SIMULATOR 1
|
||||
#define TARGET_OS_EMBEDDED 0
|
||||
#define TARGET_OS_RTKIT 0
|
||||
#define TARGET_OS_MACCATALYST 0
|
||||
#define TARGET_OS_MACCATALYST 0
|
||||
|
||||
#define TARGET_OS_VISION 0
|
||||
|
||||
|
||||
#ifndef TARGET_OS_UIKITFORMAC
|
||||
#define TARGET_OS_UIKITFORMAC 0
|
||||
#endif
|
||||
#define TARGET_OS_DRIVERKIT 0
|
||||
#define TARGET_OS_UNIX 0
|
||||
#define DYNAMIC_TARGETS_ENABLED 1
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/* "-target=arm64e-apple-xros1.0" */
|
||||
#if (__is_target_arch(arm64e) || __is_target_arch(arm64)) && __is_target_vendor(apple) && __is_target_os(xros)
|
||||
/* "-target=arm64e-apple-xros1.0[-simulator]" */
|
||||
#if __is_target_vendor(apple) && __is_target_os(xros)
|
||||
#define TARGET_OS_MAC 1
|
||||
#define TARGET_OS_OSX 0
|
||||
#define TARGET_OS_IPHONE 1
|
||||
#define TARGET_OS_IOS 1
|
||||
#define TARGET_OS_WATCH 0
|
||||
|
||||
#define TARGET_OS_TV 0
|
||||
#define TARGET_OS_SIMULATOR 0
|
||||
#define TARGET_OS_EMBEDDED 1
|
||||
#define TARGET_OS_RTKIT 0
|
||||
#define TARGET_OS_MACCATALYST 0
|
||||
#define TARGET_OS_MACCATALYST 0
|
||||
|
||||
#if __is_target_environment(simulator)
|
||||
#define TARGET_OS_SIMULATOR 1
|
||||
#else
|
||||
#define TARGET_OS_EMBEDDED 1
|
||||
#endif
|
||||
#define TARGET_OS_VISION 1
|
||||
|
||||
|
||||
#ifndef TARGET_OS_UIKITFORMAC
|
||||
#define TARGET_OS_UIKITFORMAC 0
|
||||
#endif
|
||||
#define TARGET_OS_DRIVERKIT 0
|
||||
#define TARGET_OS_UNIX 0
|
||||
#define DYNAMIC_TARGETS_ENABLED 1
|
||||
#endif
|
||||
|
||||
/* "-target=arm64e-apple-xros1.0-simulator" */
|
||||
#if (__is_target_arch(x86_64) || __is_target_arch(arm64) || __is_target_arch(arm64e)) && __is_target_vendor(apple) && __is_target_os(xros) && __is_target_environment(simulator)
|
||||
|
||||
#if (__is_target_vendor(apple) && __is_target_environment(exclavecore))
|
||||
|
||||
#define TARGET_OS_UNIX 0
|
||||
#define DYNAMIC_TARGETS_ENABLED 1
|
||||
#endif
|
||||
|
||||
|
||||
#if (__is_target_vendor(apple) && __is_target_environment(exclavekit))
|
||||
#define TARGET_OS_MAC 1
|
||||
#define TARGET_OS_OSX 0
|
||||
#define TARGET_OS_IPHONE 1
|
||||
#define TARGET_OS_IOS 1
|
||||
#define TARGET_OS_WATCH 0
|
||||
|
||||
#define TARGET_OS_TV 0
|
||||
#define TARGET_OS_SIMULATOR 1
|
||||
#define TARGET_OS_EMBEDDED 0
|
||||
#define TARGET_OS_RTKIT 0
|
||||
#define TARGET_OS_MACCATALYST 0
|
||||
#define TARGET_OS_MACCATALYST 0
|
||||
|
||||
#define TARGET_OS_VISION 1
|
||||
|
||||
|
||||
#ifndef TARGET_OS_UIKITFORMAC
|
||||
#define TARGET_OS_UIKITFORMAC 0
|
||||
#endif
|
||||
#define TARGET_OS_DRIVERKIT 0
|
||||
#define DYNAMIC_TARGETS_ENABLED 1
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
//FIXME: Workaround for rdar://100536146
|
||||
#if (__is_target_vendor(apple) && defined(__APPLE_EXCLAVECORE__) && __APPLE_EXCLAVECORE__)
|
||||
#define TARGET_OS_MAC 0
|
||||
#define TARGET_OS_OSX 0
|
||||
#define TARGET_OS_IPHONE 0
|
||||
#define TARGET_OS_IOS 0
|
||||
#define TARGET_OS_WATCH 0
|
||||
|
||||
#define TARGET_OS_TV 0
|
||||
#define TARGET_OS_SIMULATOR 0
|
||||
#define TARGET_OS_EMBEDDED 0
|
||||
#define TARGET_OS_RTKIT 0
|
||||
#define TARGET_OS_MACCATALYST 0
|
||||
#define TARGET_OS_MACCATALYST 0
|
||||
|
||||
#define TARGET_OS_VISION 0
|
||||
|
||||
|
||||
#ifndef TARGET_OS_UIKITFORMAC
|
||||
#define TARGET_OS_UIKITFORMAC 0
|
||||
#endif
|
||||
#define TARGET_OS_DRIVERKIT 0
|
||||
#define DYNAMIC_TARGETS_ENABLED 1
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
//FIXME: Workaround for rdar://100536146
|
||||
#if (__is_target_vendor(apple) && defined(__APPLE_EXCLAVEKIT__) && __APPLE_EXCLAVEKIT__)
|
||||
#define TARGET_OS_MAC 1
|
||||
#define TARGET_OS_OSX 0
|
||||
#define TARGET_OS_IPHONE 0
|
||||
#define TARGET_OS_IOS 0
|
||||
#define TARGET_OS_WATCH 0
|
||||
|
||||
#define TARGET_OS_TV 0
|
||||
#define TARGET_OS_SIMULATOR 0
|
||||
#define TARGET_OS_EMBEDDED 0
|
||||
#define TARGET_OS_RTKIT 0
|
||||
#define TARGET_OS_MACCATALYST 0
|
||||
#define TARGET_OS_MACCATALYST 0
|
||||
|
||||
#define TARGET_OS_VISION 0
|
||||
|
||||
|
||||
#ifndef TARGET_OS_UIKITFORMAC
|
||||
#define TARGET_OS_UIKITFORMAC 0
|
||||
#endif
|
||||
#define TARGET_OS_DRIVERKIT 0
|
||||
#define TARGET_OS_UNIX 0
|
||||
#define DYNAMIC_TARGETS_ENABLED 1
|
||||
#endif
|
||||
|
||||
@@ -301,25 +209,8 @@
|
||||
/* "-target=arm64e-apple-driverkit19.0" */
|
||||
#if __is_target_vendor(apple) && __is_target_os(driverkit)
|
||||
#define TARGET_OS_MAC 1
|
||||
#define TARGET_OS_OSX 0
|
||||
#define TARGET_OS_IPHONE 0
|
||||
#define TARGET_OS_IOS 0
|
||||
#define TARGET_OS_WATCH 0
|
||||
|
||||
#define TARGET_OS_TV 0
|
||||
#define TARGET_OS_SIMULATOR 0
|
||||
#define TARGET_OS_EMBEDDED 0
|
||||
#define TARGET_OS_RTKIT 0
|
||||
#define TARGET_OS_MACCATALYST 0
|
||||
#define TARGET_OS_MACCATALYST 0
|
||||
|
||||
#define TARGET_OS_VISION 0
|
||||
|
||||
|
||||
#ifndef TARGET_OS_UIKITFORMAC
|
||||
#define TARGET_OS_UIKITFORMAC 0
|
||||
#endif
|
||||
#define TARGET_OS_DRIVERKIT 1
|
||||
#define TARGET_OS_UNIX 0
|
||||
#define DYNAMIC_TARGETS_ENABLED 1
|
||||
#endif
|
||||
|
||||
@@ -329,186 +220,83 @@
|
||||
#endif /* #if __has_builtin(__is_target_arch) */
|
||||
#endif /* #if defined(__has_builtin) */
|
||||
|
||||
|
||||
#ifndef DYNAMIC_TARGETS_ENABLED
|
||||
#define DYNAMIC_TARGETS_ENABLED 0
|
||||
#define DYNAMIC_TARGETS_ENABLED 0
|
||||
#endif /* DYNAMIC_TARGETS_ENABLED */
|
||||
|
||||
/*
|
||||
* gcc based compiler used on Mac OS X
|
||||
*/
|
||||
#if defined(__GNUC__) && ( defined(__APPLE_CPP__) || defined(__APPLE_CC__) || defined(__MACOS_CLASSIC__) )
|
||||
#define TARGET_OS_WIN32 0
|
||||
#define TARGET_OS_WINDOWS 0
|
||||
#define TARGET_OS_UNIX 0
|
||||
#define TARGET_OS_LINUX 0
|
||||
|
||||
#if !DYNAMIC_TARGETS_ENABLED
|
||||
#define TARGET_OS_MAC 1
|
||||
#define TARGET_OS_OSX 1
|
||||
#define TARGET_OS_IPHONE 0
|
||||
|
||||
#define TARGET_OS_IOS 0
|
||||
|
||||
#define TARGET_OS_WATCH 0
|
||||
|
||||
#define TARGET_OS_TV 0
|
||||
#define TARGET_OS_MACCATALYST 0
|
||||
#define TARGET_OS_MACCATALYST 0
|
||||
|
||||
|
||||
|
||||
#define TARGET_OS_VISION 0
|
||||
#ifndef TARGET_OS_UIKITFORMAC
|
||||
#define TARGET_OS_UIKITFORMAC 0
|
||||
#endif
|
||||
#define TARGET_OS_SIMULATOR 0
|
||||
#define TARGET_OS_EMBEDDED 0
|
||||
#define TARGET_OS_RTKIT 0
|
||||
#define TARGET_OS_DRIVERKIT 0
|
||||
#define TARGET_OS_UNIX 0
|
||||
#endif
|
||||
|
||||
#define TARGET_IPHONE_SIMULATOR TARGET_OS_SIMULATOR /* deprecated */
|
||||
#define TARGET_OS_NANO TARGET_OS_WATCH /* deprecated */
|
||||
|
||||
#define TARGET_ABI_USES_IOS_VALUES (!TARGET_CPU_X86_64 || (TARGET_OS_IPHONE && !TARGET_OS_MACCATALYST))
|
||||
#if defined(__ppc__)
|
||||
#define TARGET_CPU_PPC 1
|
||||
#define TARGET_CPU_PPC64 0
|
||||
#define TARGET_CPU_68K 0
|
||||
#define TARGET_CPU_X86 0
|
||||
#define TARGET_CPU_X86_64 0
|
||||
#define TARGET_CPU_ARM 0
|
||||
#define TARGET_CPU_ARM64 0
|
||||
#define TARGET_CPU_MIPS 0
|
||||
#define TARGET_CPU_SPARC 0
|
||||
#define TARGET_CPU_ALPHA 0
|
||||
#define TARGET_RT_LITTLE_ENDIAN 0
|
||||
#define TARGET_RT_BIG_ENDIAN 1
|
||||
#define TARGET_RT_64_BIT 0
|
||||
#ifdef __MACOS_CLASSIC__
|
||||
#define TARGET_RT_MAC_CFM 1
|
||||
#define TARGET_RT_MAC_MACHO 0
|
||||
#else
|
||||
#define TARGET_RT_MAC_CFM 0
|
||||
#define TARGET_RT_MAC_MACHO 1
|
||||
#endif
|
||||
#elif defined(__ppc64__)
|
||||
#define TARGET_CPU_PPC 0
|
||||
#define TARGET_CPU_PPC64 1
|
||||
#define TARGET_CPU_68K 0
|
||||
#define TARGET_CPU_X86 0
|
||||
#define TARGET_CPU_X86_64 0
|
||||
#define TARGET_CPU_ARM 0
|
||||
#define TARGET_CPU_ARM64 0
|
||||
#define TARGET_CPU_MIPS 0
|
||||
#define TARGET_CPU_SPARC 0
|
||||
#define TARGET_CPU_ALPHA 0
|
||||
#define TARGET_RT_LITTLE_ENDIAN 0
|
||||
#define TARGET_RT_BIG_ENDIAN 1
|
||||
#define TARGET_RT_64_BIT 1
|
||||
#define TARGET_RT_MAC_CFM 0
|
||||
#define TARGET_RT_MAC_MACHO 1
|
||||
#elif defined(__i386__)
|
||||
#define TARGET_CPU_PPC 0
|
||||
#define TARGET_CPU_PPC64 0
|
||||
#define TARGET_CPU_68K 0
|
||||
#define TARGET_CPU_X86 1
|
||||
#define TARGET_CPU_X86_64 0
|
||||
#define TARGET_CPU_ARM 0
|
||||
#define TARGET_CPU_ARM64 0
|
||||
#define TARGET_CPU_MIPS 0
|
||||
#define TARGET_CPU_SPARC 0
|
||||
#define TARGET_CPU_ALPHA 0
|
||||
#define TARGET_RT_MAC_CFM 0
|
||||
#define TARGET_RT_MAC_MACHO 1
|
||||
#define TARGET_RT_LITTLE_ENDIAN 1
|
||||
#define TARGET_RT_BIG_ENDIAN 0
|
||||
#define TARGET_RT_64_BIT 0
|
||||
#elif defined(__x86_64__)
|
||||
#define TARGET_CPU_PPC 0
|
||||
#define TARGET_CPU_PPC64 0
|
||||
#define TARGET_CPU_68K 0
|
||||
#define TARGET_CPU_X86 0
|
||||
#define TARGET_CPU_X86_64 1
|
||||
#define TARGET_CPU_ARM 0
|
||||
#define TARGET_CPU_ARM64 0
|
||||
#define TARGET_CPU_MIPS 0
|
||||
#define TARGET_CPU_SPARC 0
|
||||
#define TARGET_CPU_ALPHA 0
|
||||
#define TARGET_RT_MAC_CFM 0
|
||||
#define TARGET_RT_MAC_MACHO 1
|
||||
#define TARGET_RT_LITTLE_ENDIAN 1
|
||||
#define TARGET_RT_BIG_ENDIAN 0
|
||||
#define TARGET_RT_64_BIT 1
|
||||
#elif defined(__arm__)
|
||||
#define TARGET_CPU_PPC 0
|
||||
#define TARGET_CPU_PPC64 0
|
||||
#define TARGET_CPU_68K 0
|
||||
#define TARGET_CPU_X86 0
|
||||
#define TARGET_CPU_X86_64 0
|
||||
#define TARGET_CPU_ARM 1
|
||||
#define TARGET_CPU_ARM64 0
|
||||
#define TARGET_CPU_MIPS 0
|
||||
#define TARGET_CPU_SPARC 0
|
||||
#define TARGET_CPU_ALPHA 0
|
||||
#define TARGET_RT_MAC_CFM 0
|
||||
#define TARGET_RT_MAC_MACHO 1
|
||||
#define TARGET_RT_LITTLE_ENDIAN 1
|
||||
#define TARGET_RT_BIG_ENDIAN 0
|
||||
#define TARGET_RT_64_BIT 0
|
||||
#elif defined(__arm64__)
|
||||
#define TARGET_CPU_PPC 0
|
||||
#define TARGET_CPU_PPC64 0
|
||||
#define TARGET_CPU_68K 0
|
||||
#define TARGET_CPU_X86 0
|
||||
#define TARGET_CPU_X86_64 0
|
||||
#define TARGET_CPU_ARM 0
|
||||
#define TARGET_CPU_ARM64 1
|
||||
#define TARGET_CPU_MIPS 0
|
||||
#define TARGET_CPU_SPARC 0
|
||||
#define TARGET_CPU_ALPHA 0
|
||||
#define TARGET_RT_MAC_CFM 0
|
||||
#define TARGET_RT_MAC_MACHO 1
|
||||
#define TARGET_RT_LITTLE_ENDIAN 1
|
||||
#define TARGET_RT_BIG_ENDIAN 0
|
||||
#if __LP64__
|
||||
#define TARGET_RT_64_BIT 1
|
||||
#else
|
||||
#define TARGET_RT_64_BIT 0
|
||||
#endif
|
||||
#else
|
||||
#error unrecognized GNU C compiler
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* CodeWarrior compiler from Metrowerks/Motorola
|
||||
*/
|
||||
#elif defined(__MWERKS__)
|
||||
#define TARGET_OS_MAC 1
|
||||
#define TARGET_OS_WIN32 0
|
||||
#define TARGET_OS_WINDOWS 0
|
||||
#define TARGET_OS_UNIX 0
|
||||
#define TARGET_OS_LINUX 0
|
||||
#define TARGET_OS_EMBEDDED 0
|
||||
|
||||
/*
|
||||
* unknown compiler
|
||||
*/
|
||||
#else
|
||||
#define TARGET_OS_MAC 1
|
||||
#endif
|
||||
#endif /* !defined(__has_extension) || !__has_extension(define_target_os_macros) */
|
||||
|
||||
// This has to always be defined in the header due to limitations in define_target_os_macros
|
||||
#define TARGET_OS_RTKIT 0
|
||||
|
||||
/*
|
||||
* gcc based compiler used on Mac OS X
|
||||
*/
|
||||
#if defined(__GNUC__) && ( defined(__APPLE_CPP__) || defined(__APPLE_CC__) || defined(__MACOS_CLASSIC__) )
|
||||
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
|
||||
#define TARGET_RT_LITTLE_ENDIAN 1
|
||||
#define TARGET_RT_BIG_ENDIAN 0
|
||||
#else
|
||||
#define TARGET_RT_LITTLE_ENDIAN 0
|
||||
#define TARGET_RT_BIG_ENDIAN 1
|
||||
#endif
|
||||
#if __LP64__
|
||||
#define TARGET_RT_64_BIT 1
|
||||
#else
|
||||
#define TARGET_RT_64_BIT 0
|
||||
#endif
|
||||
#if defined(__ppc__) && __MACOS_CLASSIC__
|
||||
#define TARGET_RT_MAC_CFM 1
|
||||
#define TARGET_RT_MAC_MACHO 0
|
||||
#else
|
||||
#define TARGET_RT_MAC_CFM 0
|
||||
#define TARGET_RT_MAC_MACHO 1
|
||||
#endif
|
||||
|
||||
/*
|
||||
* CodeWarrior compiler from Metrowerks/Motorola
|
||||
*/
|
||||
#elif defined(__MWERKS__)
|
||||
#if defined(__POWERPC__)
|
||||
#define TARGET_CPU_PPC 1
|
||||
#define TARGET_CPU_PPC64 0
|
||||
#define TARGET_CPU_68K 0
|
||||
#define TARGET_CPU_X86 0
|
||||
#define TARGET_CPU_MIPS 0
|
||||
#define TARGET_CPU_SPARC 0
|
||||
#define TARGET_CPU_ALPHA 0
|
||||
#define TARGET_RT_LITTLE_ENDIAN 0
|
||||
#define TARGET_RT_BIG_ENDIAN 1
|
||||
#elif defined(__INTEL__)
|
||||
#define TARGET_CPU_PPC 0
|
||||
#define TARGET_CPU_PPC64 0
|
||||
#define TARGET_CPU_68K 0
|
||||
#define TARGET_CPU_X86 1
|
||||
#define TARGET_CPU_MIPS 0
|
||||
#define TARGET_CPU_SPARC 0
|
||||
#define TARGET_CPU_ALPHA 0
|
||||
#define TARGET_RT_LITTLE_ENDIAN 1
|
||||
#define TARGET_RT_BIG_ENDIAN 0
|
||||
#else
|
||||
@@ -527,98 +315,6 @@
|
||||
* unknown compiler
|
||||
*/
|
||||
#else
|
||||
#if defined(TARGET_CPU_PPC) && TARGET_CPU_PPC
|
||||
#define TARGET_CPU_PPC64 0
|
||||
#define TARGET_CPU_68K 0
|
||||
#define TARGET_CPU_X86 0
|
||||
#define TARGET_CPU_X86_64 0
|
||||
#define TARGET_CPU_ARM 0
|
||||
#define TARGET_CPU_ARM64 0
|
||||
#define TARGET_CPU_MIPS 0
|
||||
#define TARGET_CPU_SPARC 0
|
||||
#define TARGET_CPU_ALPHA 0
|
||||
#elif defined(TARGET_CPU_PPC64) && TARGET_CPU_PPC64
|
||||
#define TARGET_CPU_PPC 0
|
||||
#define TARGET_CPU_68K 0
|
||||
#define TARGET_CPU_X86 0
|
||||
#define TARGET_CPU_X86_64 0
|
||||
#define TARGET_CPU_ARM 0
|
||||
#define TARGET_CPU_ARM64 0
|
||||
#define TARGET_CPU_MIPS 0
|
||||
#define TARGET_CPU_SPARC 0
|
||||
#define TARGET_CPU_ALPHA 0
|
||||
#elif defined(TARGET_CPU_X86) && TARGET_CPU_X86
|
||||
#define TARGET_CPU_PPC 0
|
||||
#define TARGET_CPU_PPC64 0
|
||||
#define TARGET_CPU_X86_64 0
|
||||
#define TARGET_CPU_68K 0
|
||||
#define TARGET_CPU_ARM 0
|
||||
#define TARGET_CPU_ARM64 0
|
||||
#define TARGET_CPU_MIPS 0
|
||||
#define TARGET_CPU_SPARC 0
|
||||
#define TARGET_CPU_ALPHA 0
|
||||
#elif defined(TARGET_CPU_X86_64) && TARGET_CPU_X86_64
|
||||
#define TARGET_CPU_PPC 0
|
||||
#define TARGET_CPU_PPC64 0
|
||||
#define TARGET_CPU_X86 0
|
||||
#define TARGET_CPU_68K 0
|
||||
#define TARGET_CPU_ARM 0
|
||||
#define TARGET_CPU_ARM64 0
|
||||
#define TARGET_CPU_MIPS 0
|
||||
#define TARGET_CPU_SPARC 0
|
||||
#define TARGET_CPU_ALPHA 0
|
||||
#elif defined(TARGET_CPU_ARM) && TARGET_CPU_ARM
|
||||
#define TARGET_CPU_PPC 0
|
||||
#define TARGET_CPU_PPC64 0
|
||||
#define TARGET_CPU_X86 0
|
||||
#define TARGET_CPU_X86_64 0
|
||||
#define TARGET_CPU_68K 0
|
||||
#define TARGET_CPU_ARM64 0
|
||||
#define TARGET_CPU_MIPS 0
|
||||
#define TARGET_CPU_SPARC 0
|
||||
#define TARGET_CPU_ALPHA 0
|
||||
#elif defined(TARGET_CPU_ARM64) && TARGET_CPU_ARM64
|
||||
#define TARGET_CPU_PPC 0
|
||||
#define TARGET_CPU_PPC64 0
|
||||
#define TARGET_CPU_X86 0
|
||||
#define TARGET_CPU_X86_64 0
|
||||
#define TARGET_CPU_68K 0
|
||||
#define TARGET_CPU_ARM 0
|
||||
#define TARGET_CPU_MIPS 0
|
||||
#define TARGET_CPU_SPARC 0
|
||||
#define TARGET_CPU_ALPHA 0
|
||||
#else
|
||||
/*
|
||||
NOTE: If your compiler errors out here then support for your compiler
|
||||
has not yet been added to TargetConditionals.h.
|
||||
|
||||
TargetConditionals.h is designed to be plug-and-play. It auto detects
|
||||
which compiler is being run and configures the TARGET_ conditionals
|
||||
appropriately.
|
||||
|
||||
The short term work around is to set the TARGET_CPU_ and TARGET_OS_
|
||||
on the command line to the compiler (e.g. -DTARGET_CPU_MIPS=1 -DTARGET_OS_UNIX=1)
|
||||
|
||||
The long term solution is to add a new case to this file which
|
||||
auto detects your compiler and sets up the TARGET_ conditionals.
|
||||
Then submit the changes to Apple Computer.
|
||||
*/
|
||||
#error TargetConditionals.h: unknown compiler (see comment above)
|
||||
#define TARGET_CPU_PPC 0
|
||||
#define TARGET_CPU_68K 0
|
||||
#define TARGET_CPU_X86 0
|
||||
#define TARGET_CPU_ARM 0
|
||||
#define TARGET_CPU_ARM64 0
|
||||
#define TARGET_CPU_MIPS 0
|
||||
#define TARGET_CPU_SPARC 0
|
||||
#define TARGET_CPU_ALPHA 0
|
||||
#endif
|
||||
#define TARGET_OS_MAC 1
|
||||
#define TARGET_OS_WIN32 0
|
||||
#define TARGET_OS_WINDOWS 0
|
||||
#define TARGET_OS_UNIX 0
|
||||
#define TARGET_OS_LINUX 0
|
||||
#define TARGET_OS_EMBEDDED 0
|
||||
#if TARGET_CPU_PPC || TARGET_CPU_PPC64
|
||||
#define TARGET_RT_BIG_ENDIAN 1
|
||||
#define TARGET_RT_LITTLE_ENDIAN 0
|
||||
@@ -638,7 +334,201 @@
|
||||
#define TARGET_RT_MAC_MACHO 0
|
||||
#define TARGET_RT_MAC_CFM 1
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
* __is_target_arch based defines
|
||||
*/
|
||||
#if defined(__has_builtin) && __has_builtin(__is_target_arch)
|
||||
#if __is_target_arch(arm64) || __is_target_arch(arm64e) || __is_target_arch(arm64_32)
|
||||
#define TARGET_CPU_ARM64 1
|
||||
#elif __is_target_arch(arm)
|
||||
#define TARGET_CPU_ARM 1
|
||||
#elif __is_target_arch(x86_64)
|
||||
#define TARGET_CPU_X86_64 1
|
||||
#elif __is_target_arch(i386)
|
||||
#define TARGET_CPU_X86 1
|
||||
#else
|
||||
|
||||
#error unrecognized arch using compiler with __is_target_arch support
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
* GCC and older clang fallback
|
||||
*/
|
||||
#elif defined(__GNUC__) && ( defined(__APPLE_CPP__) || defined(__APPLE_CC__) || defined(__MACOS_CLASSIC__) )
|
||||
#if defined(__ppc__)
|
||||
#define TARGET_CPU_PPC 1
|
||||
#elif defined(__ppc64__)
|
||||
#define TARGET_CPU_PPC64 1
|
||||
#elif defined(__i386__)
|
||||
#define TARGET_CPU_X86 1
|
||||
#elif defined(__x86_64__)
|
||||
#define TARGET_CPU_X86_64 1
|
||||
#elif defined(__arm__)
|
||||
#define TARGET_CPU_ARM 1
|
||||
#elif defined(__arm64__)
|
||||
#define TARGET_CPU_ARM64 1
|
||||
#else
|
||||
#error unrecognized GNU C compiler
|
||||
#endif
|
||||
|
||||
/*
|
||||
* CodeWarrior compiler from Metrowerks/Motorola
|
||||
*/
|
||||
#elif defined(__MWERKS__)
|
||||
#if defined(__POWERPC__)
|
||||
#define TARGET_CPU_PPC 1
|
||||
#elif defined(__INTEL__)
|
||||
#define TARGET_CPU_X86 1
|
||||
#else
|
||||
#error unknown Metrowerks CPU type
|
||||
#endif
|
||||
|
||||
/*
|
||||
* unknown compiler
|
||||
*/
|
||||
#else
|
||||
#if !defined(TARGET_CPU_PPC) && !defined(TARGET_CPU_PPC64) \
|
||||
&& !defined(TARGET_CPU_X86) && !defined(TARGET_CPU_X86_64) \
|
||||
&& !defined(TARGET_CPU_ARM) && !defined(TARGET_CPU_ARM64)
|
||||
/*
|
||||
TargetConditionals.h is designed to be plug-and-play. It auto detects
|
||||
which compiler is being run and configures the TARGET_ conditionals
|
||||
appropriately.
|
||||
|
||||
The short term work around is to set the TARGET_CPU_ and TARGET_OS_
|
||||
on the command line to the compiler (e.g. -DTARGET_CPU_MIPS=1 -DTARGET_OS_UNIX=1)
|
||||
|
||||
The long term solution is to add suppport for __is_target_arch and __is_target_os
|
||||
to your compiler.
|
||||
*/
|
||||
#error TargetConditionals.h: unknown compiler (see comment above)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
// Make sure all TARGET_OS_* and TARGET_CPU_* values are defined
|
||||
#ifndef TARGET_OS_MAC
|
||||
#define TARGET_OS_MAC 0
|
||||
#endif
|
||||
|
||||
#ifndef TARGET_OS_OSX
|
||||
#define TARGET_OS_OSX 0
|
||||
#endif
|
||||
|
||||
#ifndef TARGET_OS_IPHONE
|
||||
#define TARGET_OS_IPHONE 0
|
||||
#endif
|
||||
|
||||
#ifndef TARGET_OS_IOS
|
||||
#define TARGET_OS_IOS 0
|
||||
#endif
|
||||
|
||||
#ifndef TARGET_OS_WATCH
|
||||
#define TARGET_OS_WATCH 0
|
||||
#endif
|
||||
|
||||
#ifndef TARGET_OS_TV
|
||||
#define TARGET_OS_TV 0
|
||||
#endif
|
||||
|
||||
#ifndef TARGET_OS_SIMULATOR
|
||||
#define TARGET_OS_SIMULATOR 0
|
||||
#endif
|
||||
|
||||
#ifndef TARGET_OS_EMBEDDED
|
||||
#define TARGET_OS_EMBEDDED 0
|
||||
#endif
|
||||
|
||||
#ifndef TARGET_OS_RTKIT
|
||||
#define TARGET_OS_RTKIT 0
|
||||
#endif
|
||||
|
||||
#ifndef TARGET_OS_MACCATALYST
|
||||
#define TARGET_OS_MACCATALYST 0
|
||||
#endif
|
||||
|
||||
#ifndef TARGET_OS_VISION
|
||||
#define TARGET_OS_VISION 0
|
||||
#endif
|
||||
|
||||
#ifndef TARGET_OS_UIKITFORMAC
|
||||
#define TARGET_OS_UIKITFORMAC 0
|
||||
#endif
|
||||
|
||||
#ifndef TARGET_OS_DRIVERKIT
|
||||
#define TARGET_OS_DRIVERKIT 0
|
||||
#endif
|
||||
|
||||
#ifndef TARGET_OS_WIN32
|
||||
#define TARGET_OS_WIN32 0
|
||||
#endif
|
||||
|
||||
#ifndef TARGET_OS_WINDOWS
|
||||
#define TARGET_OS_WINDOWS 0
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#ifndef TARGET_OS_LINUX
|
||||
#define TARGET_OS_LINUX 0
|
||||
#endif
|
||||
|
||||
#ifndef TARGET_CPU_PPC
|
||||
#define TARGET_CPU_PPC 0
|
||||
#endif
|
||||
|
||||
#ifndef TARGET_CPU_PPC64
|
||||
#define TARGET_CPU_PPC64 0
|
||||
#endif
|
||||
|
||||
#ifndef TARGET_CPU_68K
|
||||
#define TARGET_CPU_68K 0
|
||||
#endif
|
||||
|
||||
#ifndef TARGET_CPU_X86
|
||||
#define TARGET_CPU_X86 0
|
||||
#endif
|
||||
|
||||
#ifndef TARGET_CPU_X86_64
|
||||
#define TARGET_CPU_X86_64 0
|
||||
#endif
|
||||
|
||||
#ifndef TARGET_CPU_ARM
|
||||
#define TARGET_CPU_ARM 0
|
||||
#endif
|
||||
|
||||
#ifndef TARGET_CPU_ARM64
|
||||
#define TARGET_CPU_ARM64 0
|
||||
#endif
|
||||
|
||||
#ifndef TARGET_CPU_MIPS
|
||||
#define TARGET_CPU_MIPS 0
|
||||
#endif
|
||||
|
||||
#ifndef TARGET_CPU_SPARC
|
||||
#define TARGET_CPU_SPARC 0
|
||||
#endif
|
||||
|
||||
#ifndef TARGET_CPU_ALPHA
|
||||
#define TARGET_CPU_ALPHA 0
|
||||
#endif
|
||||
|
||||
#ifndef TARGET_ABI_USES_IOS_VALUES
|
||||
#define TARGET_ABI_USES_IOS_VALUES (!TARGET_CPU_X86_64 || (TARGET_OS_IPHONE && !TARGET_OS_MACCATALYST))
|
||||
#endif
|
||||
|
||||
#ifndef TARGET_IPHONE_SIMULATOR
|
||||
#define TARGET_IPHONE_SIMULATOR TARGET_OS_SIMULATOR /* deprecated */
|
||||
#endif
|
||||
|
||||
#ifndef TARGET_OS_NANO
|
||||
#define TARGET_OS_NANO TARGET_OS_WATCH /* deprecated */
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif /* __TARGETCONDITIONALS__ */
|
||||
|
||||
190
lib/libc/include/any-macos-any/___wctype.h
vendored
Normal file
190
lib/libc/include/any-macos-any/___wctype.h
vendored
Normal file
@@ -0,0 +1,190 @@
|
||||
/*
|
||||
* Copyright (c) 2017 Apple Inc. All rights reserved.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_START@
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original Code
|
||||
* as defined in and that are subject to the Apple Public Source License
|
||||
* Version 2.0 (the 'License'). You may not use this file except in
|
||||
* compliance with the License. Please obtain a copy of the License at
|
||||
* http://www.opensource.apple.com/apsl/ and read it before using this
|
||||
* file.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
|
||||
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
|
||||
* Please see the License for the specific language governing rights and
|
||||
* limitations under the License.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_END@
|
||||
*/
|
||||
/*-
|
||||
* Copyright (c)1999 Citrus Project,
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Common header for __wctype.h and xlocale/___wctype.h
|
||||
*/
|
||||
|
||||
#ifndef __WCTYPE_H_
|
||||
#define __WCTYPE_H_
|
||||
#define ___WCTYPE_H_
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#include <_types.h>
|
||||
|
||||
#include <sys/_types/_wint_t.h>
|
||||
#include <_types/_wctype_t.h>
|
||||
|
||||
#ifndef WEOF
|
||||
#define WEOF __DARWIN_WEOF
|
||||
#endif
|
||||
|
||||
#ifndef __DARWIN_WCTYPE_TOP_inline
|
||||
#define __DARWIN_WCTYPE_TOP_inline __header_inline
|
||||
#endif
|
||||
|
||||
#include <ctype.h>
|
||||
|
||||
/*
|
||||
* Use inline functions if we are allowed to and the compiler supports them.
|
||||
*/
|
||||
#if !defined(_DONT_USE_CTYPE_INLINE_) && \
|
||||
(defined(_USE_CTYPE_INLINE_) || defined(__GNUC__) || defined(__cplusplus))
|
||||
|
||||
__DARWIN_WCTYPE_TOP_inline int
|
||||
iswalnum(wint_t _wc)
|
||||
{
|
||||
return (__istype(_wc, _CTYPE_A|_CTYPE_D));
|
||||
}
|
||||
|
||||
__DARWIN_WCTYPE_TOP_inline int
|
||||
iswalpha(wint_t _wc)
|
||||
{
|
||||
return (__istype(_wc, _CTYPE_A));
|
||||
}
|
||||
|
||||
__DARWIN_WCTYPE_TOP_inline int
|
||||
iswcntrl(wint_t _wc)
|
||||
{
|
||||
return (__istype(_wc, _CTYPE_C));
|
||||
}
|
||||
|
||||
__DARWIN_WCTYPE_TOP_inline int
|
||||
iswctype(wint_t _wc, wctype_t _charclass)
|
||||
{
|
||||
return (__istype(_wc, _charclass));
|
||||
}
|
||||
|
||||
__DARWIN_WCTYPE_TOP_inline int
|
||||
iswdigit(wint_t _wc)
|
||||
{
|
||||
return (__isctype(_wc, _CTYPE_D));
|
||||
}
|
||||
|
||||
__DARWIN_WCTYPE_TOP_inline int
|
||||
iswgraph(wint_t _wc)
|
||||
{
|
||||
return (__istype(_wc, _CTYPE_G));
|
||||
}
|
||||
|
||||
__DARWIN_WCTYPE_TOP_inline int
|
||||
iswlower(wint_t _wc)
|
||||
{
|
||||
return (__istype(_wc, _CTYPE_L));
|
||||
}
|
||||
|
||||
__DARWIN_WCTYPE_TOP_inline int
|
||||
iswprint(wint_t _wc)
|
||||
{
|
||||
return (__istype(_wc, _CTYPE_R));
|
||||
}
|
||||
|
||||
__DARWIN_WCTYPE_TOP_inline int
|
||||
iswpunct(wint_t _wc)
|
||||
{
|
||||
return (__istype(_wc, _CTYPE_P));
|
||||
}
|
||||
|
||||
__DARWIN_WCTYPE_TOP_inline int
|
||||
iswspace(wint_t _wc)
|
||||
{
|
||||
return (__istype(_wc, _CTYPE_S));
|
||||
}
|
||||
|
||||
__DARWIN_WCTYPE_TOP_inline int
|
||||
iswupper(wint_t _wc)
|
||||
{
|
||||
return (__istype(_wc, _CTYPE_U));
|
||||
}
|
||||
|
||||
__DARWIN_WCTYPE_TOP_inline int
|
||||
iswxdigit(wint_t _wc)
|
||||
{
|
||||
return (__isctype(_wc, _CTYPE_X));
|
||||
}
|
||||
|
||||
__DARWIN_WCTYPE_TOP_inline wint_t
|
||||
towlower(wint_t _wc)
|
||||
{
|
||||
return (__tolower(_wc));
|
||||
}
|
||||
|
||||
__DARWIN_WCTYPE_TOP_inline wint_t
|
||||
towupper(wint_t _wc)
|
||||
{
|
||||
return (__toupper(_wc));
|
||||
}
|
||||
|
||||
#else /* not using inlines */
|
||||
|
||||
__BEGIN_DECLS
|
||||
int iswalnum(wint_t);
|
||||
int iswalpha(wint_t);
|
||||
int iswcntrl(wint_t);
|
||||
int iswctype(wint_t, wctype_t);
|
||||
int iswdigit(wint_t);
|
||||
int iswgraph(wint_t);
|
||||
int iswlower(wint_t);
|
||||
int iswprint(wint_t);
|
||||
int iswpunct(wint_t);
|
||||
int iswspace(wint_t);
|
||||
int iswupper(wint_t);
|
||||
int iswxdigit(wint_t);
|
||||
wint_t towlower(wint_t);
|
||||
wint_t towupper(wint_t);
|
||||
__END_DECLS
|
||||
|
||||
#endif /* using inlines */
|
||||
|
||||
__BEGIN_DECLS
|
||||
wctype_t
|
||||
wctype(const char *);
|
||||
__END_DECLS
|
||||
|
||||
#endif /* __WCTYPE_H_ */
|
||||
55
lib/libc/include/any-macos-any/__wctype.h
vendored
55
lib/libc/include/any-macos-any/__wctype.h
vendored
@@ -1,25 +1,3 @@
|
||||
/*
|
||||
* Copyright (c) 2017 Apple Inc. All rights reserved.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_START@
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original Code
|
||||
* as defined in and that are subject to the Apple Public Source License
|
||||
* Version 2.0 (the 'License'). You may not use this file except in
|
||||
* compliance with the License. Please obtain a copy of the License at
|
||||
* http://www.opensource.apple.com/apsl/ and read it before using this
|
||||
* file.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
|
||||
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
|
||||
* Please see the License for the specific language governing rights and
|
||||
* limitations under the License.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_END@
|
||||
*/
|
||||
/*-
|
||||
* Copyright (c)1999 Citrus Project,
|
||||
* All rights reserved.
|
||||
@@ -48,27 +26,18 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* Common header for _wctype.h and xlocale/__wctype.h
|
||||
* Common header for _wctype.h and _wchar.h
|
||||
*
|
||||
* Contains everything required by wctype.h except:
|
||||
*
|
||||
* #include <_types/_wctrans_t.h>
|
||||
* int iswblank(wint_t);
|
||||
* wint_t towctrans(wint_t, wctrans_t);
|
||||
* wctrans_t wctrans(const char *);
|
||||
*/
|
||||
|
||||
#ifndef ___WCTYPE_H_
|
||||
#define ___WCTYPE_H_
|
||||
#include <___wctype.h>
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#include <_types.h>
|
||||
|
||||
#include <sys/_types/_wint_t.h>
|
||||
#include <sys/_types/_wint_t.h>
|
||||
#include <_types/_wctype_t.h>
|
||||
|
||||
#ifndef WEOF
|
||||
#define WEOF __DARWIN_WEOF
|
||||
#endif
|
||||
|
||||
#ifndef __DARWIN_WCTYPE_TOP_inline
|
||||
#define __DARWIN_WCTYPE_TOP_inline __header_inline
|
||||
#endif
|
||||
|
||||
#include <ctype.h>
|
||||
|
||||
#endif /* ___WCTYPE_H_ */
|
||||
#ifdef _USE_EXTENDED_LOCALES_
|
||||
#include <xlocale/___wctype.h>
|
||||
#endif /* _USE_EXTENDED_LOCALES_ */
|
||||
|
||||
40
lib/libc/include/any-macos-any/__xlocale.h
vendored
Normal file
40
lib/libc/include/any-macos-any/__xlocale.h
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* Copyright (c) 2005 Apple Computer, Inc. All rights reserved.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_START@
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original Code
|
||||
* as defined in and that are subject to the Apple Public Source License
|
||||
* Version 2.0 (the 'License'). You may not use this file except in
|
||||
* compliance with the License. Please obtain a copy of the License at
|
||||
* http://www.opensource.apple.com/apsl/ and read it before using this
|
||||
* file.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
|
||||
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
|
||||
* Please see the License for the specific language governing rights and
|
||||
* limitations under the License.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_END@
|
||||
*/
|
||||
|
||||
#ifndef __XLOCALE_H_
|
||||
#define __XLOCALE_H_
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#include <_mb_cur_max.h>
|
||||
|
||||
struct _xlocale; /* forward reference */
|
||||
typedef struct _xlocale * locale_t;
|
||||
|
||||
__BEGIN_DECLS
|
||||
int ___mb_cur_max_l(locale_t);
|
||||
__END_DECLS
|
||||
|
||||
#undef MB_CUR_MAX_L
|
||||
#define MB_CUR_MAX_L(x) (___mb_cur_max_l(x))
|
||||
|
||||
#endif /* __XLOCALE_H_ */
|
||||
33
lib/libc/include/any-macos-any/_abort.h
vendored
Normal file
33
lib/libc/include/any-macos-any/_abort.h
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Copyright (c) 2023 Apple Inc. All rights reserved.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_START@
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original Code
|
||||
* as defined in and that are subject to the Apple Public Source License
|
||||
* Version 2.0 (the 'License'). You may not use this file except in
|
||||
* compliance with the License. Please obtain a copy of the License at
|
||||
* http://www.opensource.apple.com/apsl/ and read it before using this
|
||||
* file.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
|
||||
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
|
||||
* Please see the License for the specific language governing rights and
|
||||
* limitations under the License.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_END@
|
||||
*/
|
||||
|
||||
#ifndef __ABORT_H_
|
||||
#define __ABORT_H_
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
void abort(void) __cold __dead2;
|
||||
__END_DECLS
|
||||
|
||||
#endif /* __ABORT_H_ */
|
||||
77
lib/libc/include/any-macos-any/_assert.h
vendored
Normal file
77
lib/libc/include/any-macos-any/_assert.h
vendored
Normal file
@@ -0,0 +1,77 @@
|
||||
/*-
|
||||
* Copyright (c) 1992, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
* (c) UNIX System Laboratories, Inc.
|
||||
* All or some portions of this file are derived from material licensed
|
||||
* to the University of California by American Telephone and Telegraph
|
||||
* Co. or Unix System Laboratories, Inc. and are reproduced herein with
|
||||
* the permission of UNIX System Laboratories, Inc.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)assert.h 8.2 (Berkeley) 1/21/94
|
||||
* $FreeBSD: src/include/assert.h,v 1.4 2002/03/23 17:24:53 imp Exp $
|
||||
*/
|
||||
|
||||
#ifndef __ASSERT_H_
|
||||
#define __ASSERT_H_
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
#ifndef __GNUC__
|
||||
|
||||
#ifndef __cplusplus
|
||||
#include <_abort.h>
|
||||
#endif /* !__cplusplus */
|
||||
#include <_printf.h>
|
||||
|
||||
#define __assert(e, file, line) \
|
||||
((void)printf ("%s:%d: failed assertion `%s'\n", file, line, e), abort())
|
||||
|
||||
#else /* __GNUC__ */
|
||||
|
||||
__BEGIN_DECLS
|
||||
void __assert_rtn(const char *, const char *, int, const char *) __dead2 __cold __disable_tail_calls;
|
||||
#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && ((__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__-0) < 1070)
|
||||
void __eprintf(const char *, const char *, unsigned, const char *) __dead2 __cold;
|
||||
#endif
|
||||
__END_DECLS
|
||||
|
||||
#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && ((__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__-0) < 1070)
|
||||
#define __assert(e, file, line) \
|
||||
__eprintf ("%s:%d: failed assertion `%s'\n", file, line, e)
|
||||
#else
|
||||
/* 8462256: modified __assert_rtn() replaces deprecated __eprintf() */
|
||||
#define __assert(e, file, line) \
|
||||
__assert_rtn ((const char *)-1L, file, line, e)
|
||||
#endif
|
||||
|
||||
#endif /* __GNUC__ */
|
||||
|
||||
#endif /* __ASSERT_H_ */
|
||||
8
lib/libc/include/any-macos-any/_ctype.h
vendored
8
lib/libc/include/any-macos-any/_ctype.h
vendored
@@ -63,7 +63,8 @@
|
||||
* @(#)ctype.h 8.4 (Berkeley) 1/21/94
|
||||
*/
|
||||
|
||||
#ifndef __CTYPE_H_
|
||||
#ifndef _CTYPE_H_
|
||||
#define _CTYPE_H_
|
||||
#define __CTYPE_H_
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
@@ -118,6 +119,7 @@
|
||||
|
||||
#define __DARWIN_CTYPE_TOP_inline __header_inline
|
||||
|
||||
|
||||
/*
|
||||
* Use inline functions if we are allowed to and the compiler supports them.
|
||||
*/
|
||||
@@ -380,8 +382,4 @@ __END_DECLS
|
||||
|
||||
#endif /* using inlines */
|
||||
|
||||
#ifdef _USE_EXTENDED_LOCALES_
|
||||
#include <xlocale/_ctype.h>
|
||||
#endif /* _USE_EXTENDED_LOCALES_ */
|
||||
|
||||
#endif /* !_CTYPE_H_ */
|
||||
|
||||
293
lib/libc/include/any-macos-any/_inttypes.h
vendored
Normal file
293
lib/libc/include/any-macos-any/_inttypes.h
vendored
Normal file
@@ -0,0 +1,293 @@
|
||||
/*
|
||||
* Copyright (c) 2023 Apple Inc. All rights reserved.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_START@
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original Code
|
||||
* as defined in and that are subject to the Apple Public Source License
|
||||
* Version 2.0 (the 'License'). You may not use this file except in
|
||||
* compliance with the License. Please obtain a copy of the License at
|
||||
* http://www.opensource.apple.com/apsl/ and read it before using this
|
||||
* file.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
|
||||
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
|
||||
* Please see the License for the specific language governing rights and
|
||||
* limitations under the License.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_END@
|
||||
*/
|
||||
|
||||
/*
|
||||
* <inttypes.h> -- Standard C header, defined in ISO/IEC 9899:1999
|
||||
* (aka "C99"), section 7.8. This defines format string conversion
|
||||
* specifiers suitable for use within arguments to fprintf and fscanf
|
||||
* and their ilk.
|
||||
*/
|
||||
|
||||
#if !defined(_INTTYPES_H_)
|
||||
#define _INTTYPES_H_
|
||||
|
||||
# define __PRI_8_LENGTH_MODIFIER__ "hh"
|
||||
# define __PRI_64_LENGTH_MODIFIER__ "ll"
|
||||
# define __SCN_64_LENGTH_MODIFIER__ "ll"
|
||||
# define __PRI_MAX_LENGTH_MODIFIER__ "j"
|
||||
# define __SCN_MAX_LENGTH_MODIFIER__ "j"
|
||||
|
||||
# define PRId8 __PRI_8_LENGTH_MODIFIER__ "d"
|
||||
# define PRIi8 __PRI_8_LENGTH_MODIFIER__ "i"
|
||||
# define PRIo8 __PRI_8_LENGTH_MODIFIER__ "o"
|
||||
# define PRIu8 __PRI_8_LENGTH_MODIFIER__ "u"
|
||||
# define PRIx8 __PRI_8_LENGTH_MODIFIER__ "x"
|
||||
# define PRIX8 __PRI_8_LENGTH_MODIFIER__ "X"
|
||||
|
||||
# define PRId16 "hd"
|
||||
# define PRIi16 "hi"
|
||||
# define PRIo16 "ho"
|
||||
# define PRIu16 "hu"
|
||||
# define PRIx16 "hx"
|
||||
# define PRIX16 "hX"
|
||||
|
||||
# define PRId32 "d"
|
||||
# define PRIi32 "i"
|
||||
# define PRIo32 "o"
|
||||
# define PRIu32 "u"
|
||||
# define PRIx32 "x"
|
||||
# define PRIX32 "X"
|
||||
|
||||
# define PRId64 __PRI_64_LENGTH_MODIFIER__ "d"
|
||||
# define PRIi64 __PRI_64_LENGTH_MODIFIER__ "i"
|
||||
# define PRIo64 __PRI_64_LENGTH_MODIFIER__ "o"
|
||||
# define PRIu64 __PRI_64_LENGTH_MODIFIER__ "u"
|
||||
# define PRIx64 __PRI_64_LENGTH_MODIFIER__ "x"
|
||||
# define PRIX64 __PRI_64_LENGTH_MODIFIER__ "X"
|
||||
|
||||
# define PRIdLEAST8 PRId8
|
||||
# define PRIiLEAST8 PRIi8
|
||||
# define PRIoLEAST8 PRIo8
|
||||
# define PRIuLEAST8 PRIu8
|
||||
# define PRIxLEAST8 PRIx8
|
||||
# define PRIXLEAST8 PRIX8
|
||||
|
||||
# define PRIdLEAST16 PRId16
|
||||
# define PRIiLEAST16 PRIi16
|
||||
# define PRIoLEAST16 PRIo16
|
||||
# define PRIuLEAST16 PRIu16
|
||||
# define PRIxLEAST16 PRIx16
|
||||
# define PRIXLEAST16 PRIX16
|
||||
|
||||
# define PRIdLEAST32 PRId32
|
||||
# define PRIiLEAST32 PRIi32
|
||||
# define PRIoLEAST32 PRIo32
|
||||
# define PRIuLEAST32 PRIu32
|
||||
# define PRIxLEAST32 PRIx32
|
||||
# define PRIXLEAST32 PRIX32
|
||||
|
||||
# define PRIdLEAST64 PRId64
|
||||
# define PRIiLEAST64 PRIi64
|
||||
# define PRIoLEAST64 PRIo64
|
||||
# define PRIuLEAST64 PRIu64
|
||||
# define PRIxLEAST64 PRIx64
|
||||
# define PRIXLEAST64 PRIX64
|
||||
|
||||
# define PRIdFAST8 PRId8
|
||||
# define PRIiFAST8 PRIi8
|
||||
# define PRIoFAST8 PRIo8
|
||||
# define PRIuFAST8 PRIu8
|
||||
# define PRIxFAST8 PRIx8
|
||||
# define PRIXFAST8 PRIX8
|
||||
|
||||
# define PRIdFAST16 PRId16
|
||||
# define PRIiFAST16 PRIi16
|
||||
# define PRIoFAST16 PRIo16
|
||||
# define PRIuFAST16 PRIu16
|
||||
# define PRIxFAST16 PRIx16
|
||||
# define PRIXFAST16 PRIX16
|
||||
|
||||
# define PRIdFAST32 PRId32
|
||||
# define PRIiFAST32 PRIi32
|
||||
# define PRIoFAST32 PRIo32
|
||||
# define PRIuFAST32 PRIu32
|
||||
# define PRIxFAST32 PRIx32
|
||||
# define PRIXFAST32 PRIX32
|
||||
|
||||
# define PRIdFAST64 PRId64
|
||||
# define PRIiFAST64 PRIi64
|
||||
# define PRIoFAST64 PRIo64
|
||||
# define PRIuFAST64 PRIu64
|
||||
# define PRIxFAST64 PRIx64
|
||||
# define PRIXFAST64 PRIX64
|
||||
|
||||
/* int32_t is 'int', but intptr_t is 'long'. */
|
||||
# define PRIdPTR "ld"
|
||||
# define PRIiPTR "li"
|
||||
# define PRIoPTR "lo"
|
||||
# define PRIuPTR "lu"
|
||||
# define PRIxPTR "lx"
|
||||
# define PRIXPTR "lX"
|
||||
|
||||
# define PRIdMAX __PRI_MAX_LENGTH_MODIFIER__ "d"
|
||||
# define PRIiMAX __PRI_MAX_LENGTH_MODIFIER__ "i"
|
||||
# define PRIoMAX __PRI_MAX_LENGTH_MODIFIER__ "o"
|
||||
# define PRIuMAX __PRI_MAX_LENGTH_MODIFIER__ "u"
|
||||
# define PRIxMAX __PRI_MAX_LENGTH_MODIFIER__ "x"
|
||||
# define PRIXMAX __PRI_MAX_LENGTH_MODIFIER__ "X"
|
||||
|
||||
# define SCNd8 __PRI_8_LENGTH_MODIFIER__ "d"
|
||||
# define SCNi8 __PRI_8_LENGTH_MODIFIER__ "i"
|
||||
# define SCNo8 __PRI_8_LENGTH_MODIFIER__ "o"
|
||||
# define SCNu8 __PRI_8_LENGTH_MODIFIER__ "u"
|
||||
# define SCNx8 __PRI_8_LENGTH_MODIFIER__ "x"
|
||||
|
||||
# define SCNd16 "hd"
|
||||
# define SCNi16 "hi"
|
||||
# define SCNo16 "ho"
|
||||
# define SCNu16 "hu"
|
||||
# define SCNx16 "hx"
|
||||
|
||||
# define SCNd32 "d"
|
||||
# define SCNi32 "i"
|
||||
# define SCNo32 "o"
|
||||
# define SCNu32 "u"
|
||||
# define SCNx32 "x"
|
||||
|
||||
# define SCNd64 __SCN_64_LENGTH_MODIFIER__ "d"
|
||||
# define SCNi64 __SCN_64_LENGTH_MODIFIER__ "i"
|
||||
# define SCNo64 __SCN_64_LENGTH_MODIFIER__ "o"
|
||||
# define SCNu64 __SCN_64_LENGTH_MODIFIER__ "u"
|
||||
# define SCNx64 __SCN_64_LENGTH_MODIFIER__ "x"
|
||||
|
||||
# define SCNdLEAST8 SCNd8
|
||||
# define SCNiLEAST8 SCNi8
|
||||
# define SCNoLEAST8 SCNo8
|
||||
# define SCNuLEAST8 SCNu8
|
||||
# define SCNxLEAST8 SCNx8
|
||||
|
||||
# define SCNdLEAST16 SCNd16
|
||||
# define SCNiLEAST16 SCNi16
|
||||
# define SCNoLEAST16 SCNo16
|
||||
# define SCNuLEAST16 SCNu16
|
||||
# define SCNxLEAST16 SCNx16
|
||||
|
||||
# define SCNdLEAST32 SCNd32
|
||||
# define SCNiLEAST32 SCNi32
|
||||
# define SCNoLEAST32 SCNo32
|
||||
# define SCNuLEAST32 SCNu32
|
||||
# define SCNxLEAST32 SCNx32
|
||||
|
||||
# define SCNdLEAST64 SCNd64
|
||||
# define SCNiLEAST64 SCNi64
|
||||
# define SCNoLEAST64 SCNo64
|
||||
# define SCNuLEAST64 SCNu64
|
||||
# define SCNxLEAST64 SCNx64
|
||||
|
||||
# define SCNdFAST8 SCNd8
|
||||
# define SCNiFAST8 SCNi8
|
||||
# define SCNoFAST8 SCNo8
|
||||
# define SCNuFAST8 SCNu8
|
||||
# define SCNxFAST8 SCNx8
|
||||
|
||||
# define SCNdFAST16 SCNd16
|
||||
# define SCNiFAST16 SCNi16
|
||||
# define SCNoFAST16 SCNo16
|
||||
# define SCNuFAST16 SCNu16
|
||||
# define SCNxFAST16 SCNx16
|
||||
|
||||
# define SCNdFAST32 SCNd32
|
||||
# define SCNiFAST32 SCNi32
|
||||
# define SCNoFAST32 SCNo32
|
||||
# define SCNuFAST32 SCNu32
|
||||
# define SCNxFAST32 SCNx32
|
||||
|
||||
# define SCNdFAST64 SCNd64
|
||||
# define SCNiFAST64 SCNi64
|
||||
# define SCNoFAST64 SCNo64
|
||||
# define SCNuFAST64 SCNu64
|
||||
# define SCNxFAST64 SCNx64
|
||||
|
||||
# define SCNdPTR "ld"
|
||||
# define SCNiPTR "li"
|
||||
# define SCNoPTR "lo"
|
||||
# define SCNuPTR "lu"
|
||||
# define SCNxPTR "lx"
|
||||
|
||||
# define SCNdMAX __SCN_MAX_LENGTH_MODIFIER__ "d"
|
||||
# define SCNiMAX __SCN_MAX_LENGTH_MODIFIER__ "i"
|
||||
# define SCNoMAX __SCN_MAX_LENGTH_MODIFIER__ "o"
|
||||
# define SCNuMAX __SCN_MAX_LENGTH_MODIFIER__ "u"
|
||||
# define SCNxMAX __SCN_MAX_LENGTH_MODIFIER__ "x"
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#include <Availability.h>
|
||||
|
||||
#include <_types.h>
|
||||
#include <sys/_types/_wchar_t.h>
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* 7.8.2.1 */
|
||||
__OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0)
|
||||
extern intmax_t
|
||||
imaxabs(intmax_t j);
|
||||
|
||||
/* 7.8.2.2 */
|
||||
typedef struct {
|
||||
intmax_t quot;
|
||||
intmax_t rem;
|
||||
} imaxdiv_t;
|
||||
|
||||
__OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0)
|
||||
extern imaxdiv_t
|
||||
imaxdiv(intmax_t __numer, intmax_t __denom);
|
||||
|
||||
/* 7.8.2.3 */
|
||||
__OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0)
|
||||
extern intmax_t
|
||||
strtoimax(const char * __restrict __nptr,
|
||||
char ** __restrict __endptr,
|
||||
int __base);
|
||||
|
||||
__OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0)
|
||||
extern uintmax_t
|
||||
strtoumax(const char * __restrict __nptr,
|
||||
char ** __restrict __endptr,
|
||||
int __base);
|
||||
|
||||
/* 7.8.2.4 */
|
||||
__OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0)
|
||||
extern intmax_t
|
||||
wcstoimax(const wchar_t * __restrict __nptr,
|
||||
wchar_t ** __restrict __endptr,
|
||||
int __base);
|
||||
|
||||
__OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0)
|
||||
extern uintmax_t
|
||||
wcstoumax(const wchar_t * __restrict __nptr,
|
||||
wchar_t ** __restrict __endptr,
|
||||
int __base);
|
||||
|
||||
/* Poison the following routines if -fshort-wchar is set */
|
||||
#if !defined(__cplusplus) && defined(__WCHAR_MAX__) && __WCHAR_MAX__ <= 0xffffU
|
||||
#pragma GCC poison wcstoimax wcstoumax
|
||||
#endif
|
||||
|
||||
__END_DECLS
|
||||
|
||||
/*
|
||||
No need to #undef the __*_{8,64}_LENGTH_MODIFIER__ macros;
|
||||
in fact, you can't #undef them, because later uses of any of
|
||||
their dependents will *not* then do the intended substitution.
|
||||
Expansion of a #define like this one:
|
||||
|
||||
#define x IDENT y
|
||||
|
||||
uses the cpp value of IDENT at the location where x is *expanded*,
|
||||
not where it is #defined.
|
||||
*/
|
||||
|
||||
#endif /* !_INTTYPES_H_ */
|
||||
116
lib/libc/include/any-macos-any/_langinfo.h
vendored
Normal file
116
lib/libc/include/any-macos-any/_langinfo.h
vendored
Normal file
@@ -0,0 +1,116 @@
|
||||
/*-
|
||||
* Copyright (c) 2001 Alexey Zelkin <phantom@FreeBSD.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $FreeBSD: /repoman/r/ncvs/src/include/langinfo.h,v 1.6 2002/09/18 05:54:25 mike Exp $
|
||||
*/
|
||||
|
||||
#ifndef _LANGINFO_H_
|
||||
#define _LANGINFO_H_
|
||||
|
||||
#include <_types.h>
|
||||
#include <_types/_nl_item.h>
|
||||
|
||||
#define CODESET 0 /* codeset name */
|
||||
#define D_T_FMT 1 /* string for formatting date and time */
|
||||
#define D_FMT 2 /* date format string */
|
||||
#define T_FMT 3 /* time format string */
|
||||
#define T_FMT_AMPM 4 /* a.m. or p.m. time formatting string */
|
||||
#define AM_STR 5 /* Ante Meridian affix */
|
||||
#define PM_STR 6 /* Post Meridian affix */
|
||||
|
||||
/* week day names */
|
||||
#define DAY_1 7
|
||||
#define DAY_2 8
|
||||
#define DAY_3 9
|
||||
#define DAY_4 10
|
||||
#define DAY_5 11
|
||||
#define DAY_6 12
|
||||
#define DAY_7 13
|
||||
|
||||
/* abbreviated week day names */
|
||||
#define ABDAY_1 14
|
||||
#define ABDAY_2 15
|
||||
#define ABDAY_3 16
|
||||
#define ABDAY_4 17
|
||||
#define ABDAY_5 18
|
||||
#define ABDAY_6 19
|
||||
#define ABDAY_7 20
|
||||
|
||||
/* month names */
|
||||
#define MON_1 21
|
||||
#define MON_2 22
|
||||
#define MON_3 23
|
||||
#define MON_4 24
|
||||
#define MON_5 25
|
||||
#define MON_6 26
|
||||
#define MON_7 27
|
||||
#define MON_8 28
|
||||
#define MON_9 29
|
||||
#define MON_10 30
|
||||
#define MON_11 31
|
||||
#define MON_12 32
|
||||
|
||||
/* abbreviated month names */
|
||||
#define ABMON_1 33
|
||||
#define ABMON_2 34
|
||||
#define ABMON_3 35
|
||||
#define ABMON_4 36
|
||||
#define ABMON_5 37
|
||||
#define ABMON_6 38
|
||||
#define ABMON_7 39
|
||||
#define ABMON_8 40
|
||||
#define ABMON_9 41
|
||||
#define ABMON_10 42
|
||||
#define ABMON_11 43
|
||||
#define ABMON_12 44
|
||||
|
||||
#define ERA 45 /* era description segments */
|
||||
#define ERA_D_FMT 46 /* era date format string */
|
||||
#define ERA_D_T_FMT 47 /* era date and time format string */
|
||||
#define ERA_T_FMT 48 /* era time format string */
|
||||
#define ALT_DIGITS 49 /* alternative symbols for digits */
|
||||
|
||||
#define RADIXCHAR 50 /* radix char */
|
||||
#define THOUSEP 51 /* separator for thousands */
|
||||
|
||||
#define YESEXPR 52 /* affirmative response expression */
|
||||
#define NOEXPR 53 /* negative response expression */
|
||||
|
||||
#if (__DARWIN_C_LEVEL > __DARWIN_C_ANSI && __DARWIN_C_LEVEL < 200112L) || __DARWIN_C_LEVEL == __DARWIN_C_FULL
|
||||
#define YESSTR 54 /* affirmative response for yes/no queries */
|
||||
#define NOSTR 55 /* negative response for yes/no queries */
|
||||
#endif
|
||||
|
||||
#define CRNCYSTR 56 /* currency symbol */
|
||||
|
||||
#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
|
||||
#define D_MD_ORDER 57 /* month/day order (local extension) */
|
||||
#endif
|
||||
|
||||
__BEGIN_DECLS
|
||||
char *nl_langinfo(nl_item);
|
||||
__END_DECLS
|
||||
|
||||
#endif /* !_LANGINFO_H_ */
|
||||
36
lib/libc/include/any-macos-any/_mb_cur_max.h
vendored
Normal file
36
lib/libc/include/any-macos-any/_mb_cur_max.h
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Copyright (c) 2024 Apple Inc. All rights reserved.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_START@
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original Code
|
||||
* as defined in and that are subject to the Apple Public Source License
|
||||
* Version 2.0 (the 'License'). You may not use this file except in
|
||||
* compliance with the License. Please obtain a copy of the License at
|
||||
* http://www.opensource.apple.com/apsl/ and read it before using this
|
||||
* file.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
|
||||
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
|
||||
* Please see the License for the specific language governing rights and
|
||||
* limitations under the License.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_END@
|
||||
*/
|
||||
|
||||
#ifndef __MB_CUR_MAX_H_
|
||||
#define __MB_CUR_MAX_H_
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
int ___mb_cur_max(void);
|
||||
__END_DECLS
|
||||
|
||||
#undef MB_CUR_MAX
|
||||
#define MB_CUR_MAX (___mb_cur_max())
|
||||
|
||||
#endif /* __MB_CUR_MAX_H_ */
|
||||
41
lib/libc/include/any-macos-any/_monetary.h
vendored
Normal file
41
lib/libc/include/any-macos-any/_monetary.h
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
/*-
|
||||
* Copyright (c) 2001 Alexey Zelkin <phantom@FreeBSD.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $FreeBSD: /repoman/r/ncvs/src/include/monetary.h,v 1.7 2002/09/20 08:22:48 mike Exp $
|
||||
*/
|
||||
|
||||
#ifndef _MONETARY_H_
|
||||
#define _MONETARY_H_
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#include <_types.h>
|
||||
#include <sys/_types/_size_t.h>
|
||||
#include <sys/_types/_ssize_t.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
ssize_t strfmon(char *, size_t, const char *, ...);
|
||||
__END_DECLS
|
||||
|
||||
#endif /* !_MONETARY_H_ */
|
||||
35
lib/libc/include/any-macos-any/_printf.h
vendored
Normal file
35
lib/libc/include/any-macos-any/_printf.h
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Copyright (c) 2023 Apple Inc. All rights reserved.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_START@
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original Code
|
||||
* as defined in and that are subject to the Apple Public Source License
|
||||
* Version 2.0 (the 'License'). You may not use this file except in
|
||||
* compliance with the License. Please obtain a copy of the License at
|
||||
* http://www.opensource.apple.com/apsl/ and read it before using this
|
||||
* file.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
|
||||
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
|
||||
* Please see the License for the specific language governing rights and
|
||||
* limitations under the License.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_END@
|
||||
*/
|
||||
|
||||
#ifndef __PRINTF_H_
|
||||
#define __PRINTF_H_
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
|
||||
__BEGIN_DECLS
|
||||
int printf(const char * __restrict, ...) __printflike(1, 2);
|
||||
__END_DECLS
|
||||
|
||||
|
||||
#endif /* __PRINTF_H_ */
|
||||
124
lib/libc/include/any-macos-any/_regex.h
vendored
124
lib/libc/include/any-macos-any/_regex.h
vendored
@@ -90,7 +90,8 @@
|
||||
* Common header for regex.h and xlocale/_regex.h
|
||||
*/
|
||||
|
||||
#ifndef __REGEX_H_
|
||||
#ifndef _REGEX_H_
|
||||
#define _REGEX_H_
|
||||
#define __REGEX_H_
|
||||
|
||||
#include <_types.h>
|
||||
@@ -118,4 +119,123 @@ typedef struct {
|
||||
regoff_t rm_eo; /* end of match */
|
||||
} regmatch_t;
|
||||
|
||||
#endif /* !__REGEX_H_ */
|
||||
/*******************/
|
||||
/* regcomp() flags */
|
||||
/*******************/
|
||||
#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
|
||||
#define REG_BASIC 0000 /* Basic regular expressions (synonym for 0) */
|
||||
#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */
|
||||
|
||||
#define REG_EXTENDED 0001 /* Extended regular expressions */
|
||||
#define REG_ICASE 0002 /* Compile ignoring upper/lower case */
|
||||
#define REG_NOSUB 0004 /* Compile only reporting success/failure */
|
||||
#define REG_NEWLINE 0010 /* Compile for newline-sensitive matching */
|
||||
|
||||
#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
|
||||
#define REG_NOSPEC 0020 /* Compile turning off all special characters */
|
||||
|
||||
#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_8 \
|
||||
|| __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_6_0 \
|
||||
|| defined(__DRIVERKIT_VERSION_MIN_REQUIRED)
|
||||
#define REG_LITERAL REG_NOSPEC
|
||||
#endif
|
||||
|
||||
#define REG_PEND 0040 /* Use re_endp as end pointer */
|
||||
|
||||
#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_8 \
|
||||
|| __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_6_0 \
|
||||
|| defined(__DRIVERKIT_VERSION_MIN_REQUIRED)
|
||||
#define REG_MINIMAL 0100 /* Compile using minimal repetition */
|
||||
#define REG_UNGREEDY REG_MINIMAL
|
||||
#endif
|
||||
|
||||
#define REG_DUMP 0200 /* Unused */
|
||||
|
||||
#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_8 \
|
||||
|| __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_6_0 \
|
||||
|| defined(__DRIVERKIT_VERSION_MIN_REQUIRED)
|
||||
#define REG_ENHANCED 0400 /* Additional (non-POSIX) features */
|
||||
#endif
|
||||
#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */
|
||||
|
||||
/********************/
|
||||
/* regerror() flags */
|
||||
/********************/
|
||||
#define REG_ENOSYS (-1) /* Reserved */
|
||||
#define REG_NOMATCH 1 /* regexec() function failed to match */
|
||||
#define REG_BADPAT 2 /* invalid regular expression */
|
||||
#define REG_ECOLLATE 3 /* invalid collating element */
|
||||
#define REG_ECTYPE 4 /* invalid character class */
|
||||
#define REG_EESCAPE 5 /* trailing backslash (\) */
|
||||
#define REG_ESUBREG 6 /* invalid backreference number */
|
||||
#define REG_EBRACK 7 /* brackets ([ ]) not balanced */
|
||||
#define REG_EPAREN 8 /* parentheses not balanced */
|
||||
#define REG_EBRACE 9 /* braces not balanced */
|
||||
#define REG_BADBR 10 /* invalid repetition count(s) */
|
||||
#define REG_ERANGE 11 /* invalid character range */
|
||||
#define REG_ESPACE 12 /* out of memory */
|
||||
#define REG_BADRPT 13 /* repetition-operator operand invalid */
|
||||
|
||||
#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
|
||||
#define REG_EMPTY 14 /* Unused */
|
||||
#define REG_ASSERT 15 /* Unused */
|
||||
#define REG_INVARG 16 /* invalid argument to regex routine */
|
||||
#define REG_ILLSEQ 17 /* illegal byte sequence */
|
||||
|
||||
#define REG_ATOI 255 /* convert name to number (!) */
|
||||
#define REG_ITOA 0400 /* convert number to name (!) */
|
||||
#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */
|
||||
|
||||
/*******************/
|
||||
/* regexec() flags */
|
||||
/*******************/
|
||||
#define REG_NOTBOL 00001 /* First character not at beginning of line */
|
||||
#define REG_NOTEOL 00002 /* Last character not at end of line */
|
||||
|
||||
#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
|
||||
#define REG_STARTEND 00004 /* String start/end in pmatch[0] */
|
||||
#define REG_TRACE 00400 /* Unused */
|
||||
#define REG_LARGE 01000 /* Unused */
|
||||
#define REG_BACKR 02000 /* force use of backref code */
|
||||
|
||||
#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_8 \
|
||||
|| __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_6_0 \
|
||||
|| defined(__DRIVERKIT_VERSION_MIN_REQUIRED)
|
||||
#define REG_BACKTRACKING_MATCHER REG_BACKR
|
||||
#endif
|
||||
#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */
|
||||
|
||||
__BEGIN_DECLS
|
||||
int regcomp(regex_t * __restrict, const char * __restrict, int) __DARWIN_ALIAS(regcomp);
|
||||
size_t regerror(int, const regex_t * __restrict, char * __restrict, size_t) __cold;
|
||||
/*
|
||||
* gcc under c99 mode won't compile "[ __restrict]" by itself. As a workaround,
|
||||
* a dummy argument name is added.
|
||||
*/
|
||||
int regexec(const regex_t * __restrict, const char * __restrict, size_t,
|
||||
regmatch_t __pmatch[ __restrict], int);
|
||||
void regfree(regex_t *);
|
||||
|
||||
#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
|
||||
|
||||
/* Darwin extensions */
|
||||
int regncomp(regex_t * __restrict, const char * __restrict, size_t, int)
|
||||
__OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_6_0);
|
||||
int regnexec(const regex_t * __restrict, const char * __restrict, size_t,
|
||||
size_t, regmatch_t __pmatch[ __restrict], int)
|
||||
__OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_6_0);
|
||||
int regwcomp(regex_t * __restrict, const wchar_t * __restrict, int)
|
||||
__OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_6_0);
|
||||
int regwexec(const regex_t * __restrict, const wchar_t * __restrict, size_t,
|
||||
regmatch_t __pmatch[ __restrict], int)
|
||||
__OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_6_0);
|
||||
int regwncomp(regex_t * __restrict, const wchar_t * __restrict, size_t, int)
|
||||
__OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_6_0);
|
||||
int regwnexec(const regex_t * __restrict, const wchar_t * __restrict,
|
||||
size_t, size_t, regmatch_t __pmatch[ __restrict], int)
|
||||
__OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_6_0);
|
||||
|
||||
#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */
|
||||
__END_DECLS
|
||||
|
||||
#endif /* !_REGEX_H_ */
|
||||
|
||||
33
lib/libc/include/any-macos-any/_static_assert.h
vendored
Normal file
33
lib/libc/include/any-macos-any/_static_assert.h
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Copyright (c) 2023 Apple Inc. All rights reserved.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_START@
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original Code
|
||||
* as defined in and that are subject to the Apple Public Source License
|
||||
* Version 2.0 (the 'License'). You may not use this file except in
|
||||
* compliance with the License. Please obtain a copy of the License at
|
||||
* http://www.opensource.apple.com/apsl/ and read it before using this
|
||||
* file.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
|
||||
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
|
||||
* Please see the License for the specific language governing rights and
|
||||
* limitations under the License.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_END@
|
||||
*/
|
||||
|
||||
#ifndef _ASSERT_H_
|
||||
#define _ASSERT_H_
|
||||
|
||||
#ifndef __cplusplus
|
||||
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
|
||||
#define static_assert _Static_assert
|
||||
#endif /* __STDC_VERSION__ */
|
||||
#endif /* !__cplusplus */
|
||||
|
||||
#endif /* _ASSERT_H_ */
|
||||
349
lib/libc/include/any-macos-any/_stdio.h
vendored
349
lib/libc/include/any-macos-any/_stdio.h
vendored
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2005, 2007, 2009, 2010 Apple Inc. All rights reserved.
|
||||
* Copyright (c) 2000, 2005, 2007, 2009, 2010, 2023 Apple Inc. All rights reserved.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_START@
|
||||
*
|
||||
@@ -62,7 +62,8 @@
|
||||
* Common header for stdio.h and xlocale/_stdio.h
|
||||
*/
|
||||
|
||||
#ifndef __STDIO_H_
|
||||
#ifndef _STDIO_H_
|
||||
#define _STDIO_H_
|
||||
#define __STDIO_H_
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
@@ -77,6 +78,7 @@
|
||||
#include <sys/_types/_null.h>
|
||||
|
||||
#include <sys/stdio.h>
|
||||
#include <_printf.h>
|
||||
|
||||
typedef __darwin_off_t fpos_t;
|
||||
|
||||
@@ -156,4 +158,345 @@ typedef struct __sFILE {
|
||||
fpos_t _offset; /* current lseek offset (see WARNING) */
|
||||
} FILE;
|
||||
|
||||
#endif /* __STDIO_H_ */
|
||||
#include <sys/_types/_seek_set.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
extern FILE *__stdinp __swift_nonisolated_unsafe;
|
||||
extern FILE *__stdoutp __swift_nonisolated_unsafe;
|
||||
extern FILE *__stderrp __swift_nonisolated_unsafe;
|
||||
__END_DECLS
|
||||
|
||||
#define __SLBF 0x0001 /* line buffered */
|
||||
#define __SNBF 0x0002 /* unbuffered */
|
||||
#define __SRD 0x0004 /* OK to read */
|
||||
#define __SWR 0x0008 /* OK to write */
|
||||
/* RD and WR are never simultaneously asserted */
|
||||
#define __SRW 0x0010 /* open for reading & writing */
|
||||
#define __SEOF 0x0020 /* found EOF */
|
||||
#define __SERR 0x0040 /* found error */
|
||||
#define __SMBF 0x0080 /* _buf is from malloc */
|
||||
#define __SAPP 0x0100 /* fdopen()ed in append mode */
|
||||
#define __SSTR 0x0200 /* this is an sprintf/snprintf string */
|
||||
#define __SOPT 0x0400 /* do fseek() optimisation */
|
||||
#define __SNPT 0x0800 /* do not do fseek() optimisation */
|
||||
#define __SOFF 0x1000 /* set iff _offset is in fact correct */
|
||||
#define __SMOD 0x2000 /* true => fgetln modified _p text */
|
||||
#define __SALC 0x4000 /* allocate string space dynamically */
|
||||
#define __SIGN 0x8000 /* ignore this file in _fwalk */
|
||||
|
||||
/*
|
||||
* The following three definitions are for ANSI C, which took them
|
||||
* from System V, which brilliantly took internal interface macros and
|
||||
* made them official arguments to setvbuf(), without renaming them.
|
||||
* Hence, these ugly _IOxxx names are *supposed* to appear in user code.
|
||||
*
|
||||
* Although numbered as their counterparts above, the implementation
|
||||
* does not rely on this.
|
||||
*/
|
||||
#define _IOFBF 0 /* setvbuf should set fully buffered */
|
||||
#define _IOLBF 1 /* setvbuf should set line buffered */
|
||||
#define _IONBF 2 /* setvbuf should set unbuffered */
|
||||
|
||||
#define BUFSIZ 1024 /* size of buffer used by setbuf */
|
||||
#define EOF (-1)
|
||||
|
||||
/* must be == _POSIX_STREAM_MAX <limits.h> */
|
||||
#define FOPEN_MAX 20 /* must be <= OPEN_MAX <sys/syslimits.h> */
|
||||
#define FILENAME_MAX 1024 /* must be <= PATH_MAX <sys/syslimits.h> */
|
||||
|
||||
/* System V/ANSI C; this is the wrong way to do this, do *not* use these. */
|
||||
#ifndef _ANSI_SOURCE
|
||||
#define P_tmpdir "/var/tmp/"
|
||||
#endif
|
||||
#define L_tmpnam 1024 /* XXX must be == PATH_MAX */
|
||||
#define TMP_MAX 308915776
|
||||
|
||||
#define stdin __stdinp
|
||||
#define stdout __stdoutp
|
||||
#define stderr __stderrp
|
||||
|
||||
#ifdef _DARWIN_UNLIMITED_STREAMS
|
||||
#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_3_2
|
||||
#error "_DARWIN_UNLIMITED_STREAMS specified, but -miphoneos-version-min version does not support it."
|
||||
#elif defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_6
|
||||
#error "_DARWIN_UNLIMITED_STREAMS specified, but -mmacosx-version-min version does not support it."
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* ANSI-C */
|
||||
|
||||
__BEGIN_DECLS
|
||||
void clearerr(FILE *);
|
||||
int fclose(FILE *);
|
||||
int feof(FILE *);
|
||||
int ferror(FILE *);
|
||||
int fflush(FILE *);
|
||||
int fgetc(FILE *);
|
||||
int fgetpos(FILE * __restrict, fpos_t *);
|
||||
char *fgets(char * __restrict, int, FILE *);
|
||||
#if defined(_DARWIN_UNLIMITED_STREAMS) || defined(_DARWIN_C_SOURCE)
|
||||
FILE *fopen(const char * __restrict __filename, const char * __restrict __mode) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_3_2, __DARWIN_EXTSN(fopen));
|
||||
#else /* !_DARWIN_UNLIMITED_STREAMS && !_DARWIN_C_SOURCE */
|
||||
FILE *fopen(const char * __restrict __filename, const char * __restrict __mode) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_2_0, __DARWIN_ALIAS(fopen));
|
||||
#endif /* (DARWIN_UNLIMITED_STREAMS || _DARWIN_C_SOURCE) */
|
||||
int fprintf(FILE * __restrict, const char * __restrict, ...) __printflike(2, 3);
|
||||
int fputc(int, FILE *);
|
||||
int fputs(const char * __restrict, FILE * __restrict) __DARWIN_ALIAS(fputs);
|
||||
size_t fread(void * __restrict __ptr, size_t __size, size_t __nitems, FILE * __restrict __stream);
|
||||
FILE *freopen(const char * __restrict, const char * __restrict,
|
||||
FILE * __restrict) __DARWIN_ALIAS(freopen);
|
||||
int fscanf(FILE * __restrict, const char * __restrict, ...) __scanflike(2, 3);
|
||||
int fseek(FILE *, long, int);
|
||||
int fsetpos(FILE *, const fpos_t *);
|
||||
long ftell(FILE *);
|
||||
size_t fwrite(const void * __restrict __ptr, size_t __size, size_t __nitems, FILE * __restrict __stream) __DARWIN_ALIAS(fwrite);
|
||||
int getc(FILE *);
|
||||
int getchar(void);
|
||||
|
||||
#if !defined(_POSIX_C_SOURCE)
|
||||
__deprecated_msg("This function is provided for compatibility reasons only. Due to security concerns inherent in the design of gets(3), it is highly recommended that you use fgets(3) instead.")
|
||||
#endif
|
||||
char *gets(char *);
|
||||
|
||||
void perror(const char *) __cold;
|
||||
int putc(int, FILE *);
|
||||
int putchar(int);
|
||||
int puts(const char *);
|
||||
int remove(const char *);
|
||||
int rename (const char *__old, const char *__new);
|
||||
void rewind(FILE *);
|
||||
int scanf(const char * __restrict, ...) __scanflike(1, 2);
|
||||
void setbuf(FILE * __restrict, char * __restrict);
|
||||
int setvbuf(FILE * __restrict, char * __restrict, int, size_t);
|
||||
|
||||
__swift_unavailable("Use snprintf 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 sprintf(3), it is highly recommended that you use snprintf(3) instead.")
|
||||
#endif
|
||||
int sprintf(char * __restrict, const char * __restrict, ...) __printflike(2, 3);
|
||||
|
||||
int sscanf(const char * __restrict, const char * __restrict, ...) __scanflike(2, 3);
|
||||
FILE *tmpfile(void);
|
||||
|
||||
__swift_unavailable("Use mkstemp(3) 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 tmpnam(3), it is highly recommended that you use mkstemp(3) instead.")
|
||||
#endif
|
||||
char *tmpnam(char *);
|
||||
|
||||
int ungetc(int, FILE *);
|
||||
int vfprintf(FILE * __restrict, const char * __restrict, va_list) __printflike(2, 0);
|
||||
int vprintf(const char * __restrict, va_list) __printflike(1, 0);
|
||||
|
||||
__swift_unavailable("Use vsnprintf 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 sprintf(3), it is highly recommended that you use vsnprintf(3) instead.")
|
||||
#endif
|
||||
int vsprintf(char * __restrict, const char * __restrict, va_list) __printflike(2, 0);
|
||||
__END_DECLS
|
||||
|
||||
|
||||
|
||||
/* Additional functionality provided by:
|
||||
* POSIX.1-1988
|
||||
*/
|
||||
|
||||
#if __DARWIN_C_LEVEL >= 198808L
|
||||
#define L_ctermid 1024 /* size for ctermid(); PATH_MAX */
|
||||
|
||||
#include <_ctermid.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
#if defined(_DARWIN_UNLIMITED_STREAMS) || defined(_DARWIN_C_SOURCE)
|
||||
FILE *fdopen(int, const char *) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_3_2, __DARWIN_EXTSN(fdopen));
|
||||
#else /* !_DARWIN_UNLIMITED_STREAMS && !_DARWIN_C_SOURCE */
|
||||
FILE *fdopen(int, const char *) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_2_0, __DARWIN_ALIAS(fdopen));
|
||||
#endif /* (DARWIN_UNLIMITED_STREAMS || _DARWIN_C_SOURCE) */
|
||||
int fileno(FILE *);
|
||||
__END_DECLS
|
||||
#endif /* __DARWIN_C_LEVEL >= 198808L */
|
||||
|
||||
|
||||
/* Additional functionality provided by:
|
||||
* POSIX.2-1992 C Language Binding Option
|
||||
*/
|
||||
|
||||
#if __DARWIN_C_LEVEL >= 199209L
|
||||
__BEGIN_DECLS
|
||||
int pclose(FILE *) __swift_unavailable("Use posix_spawn APIs or NSTask instead. (On iOS, process spawning is unavailable.)");
|
||||
#if defined(_DARWIN_UNLIMITED_STREAMS) || defined(_DARWIN_C_SOURCE)
|
||||
FILE *popen(const char *, const char *) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_3_2, __DARWIN_EXTSN(popen)) __swift_unavailable("Use posix_spawn APIs or NSTask instead. (On iOS, process spawning is unavailable.)");
|
||||
#else /* !_DARWIN_UNLIMITED_STREAMS && !_DARWIN_C_SOURCE */
|
||||
FILE *popen(const char *, const char *) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_2_0, __DARWIN_ALIAS(popen)) __swift_unavailable("Use posix_spawn APIs or NSTask instead. (On iOS, process spawning is unavailable.)");
|
||||
#endif /* (DARWIN_UNLIMITED_STREAMS || _DARWIN_C_SOURCE) */
|
||||
__END_DECLS
|
||||
#endif /* __DARWIN_C_LEVEL >= 199209L */
|
||||
|
||||
/* Additional functionality provided by:
|
||||
* POSIX.1c-1995,
|
||||
* POSIX.1i-1995,
|
||||
* and the omnibus ISO/IEC 9945-1: 1996
|
||||
*/
|
||||
|
||||
#if __DARWIN_C_LEVEL >= 199506L
|
||||
|
||||
/* Functions internal to the implementation. */
|
||||
__BEGIN_DECLS
|
||||
int __srget(FILE *);
|
||||
int __svfscanf(FILE *, const char *, va_list) __scanflike(2, 0);
|
||||
int __swbuf(int, FILE *);
|
||||
__END_DECLS
|
||||
|
||||
/*
|
||||
* The __sfoo macros are here so that we can
|
||||
* define function versions in the C library.
|
||||
*/
|
||||
#define __sgetc(p) (--(p)->_r < 0 ? __srget(p) : (int)(*(p)->_p++))
|
||||
#if defined(__GNUC__) && defined(__STDC__)
|
||||
__header_always_inline int __sputc(int _c, FILE *_p) {
|
||||
if (--_p->_w >= 0 || (_p->_w >= _p->_lbfsize && (char)_c != '\n'))
|
||||
return (*_p->_p++ = _c);
|
||||
else
|
||||
return (__swbuf(_c, _p));
|
||||
}
|
||||
#else
|
||||
/*
|
||||
* This has been tuned to generate reasonable code on the vax using pcc.
|
||||
*/
|
||||
#define __sputc(c, p) \
|
||||
(--(p)->_w < 0 ? \
|
||||
(p)->_w >= (p)->_lbfsize ? \
|
||||
(*(p)->_p = (c)), *(p)->_p != '\n' ? \
|
||||
(int)*(p)->_p++ : \
|
||||
__swbuf('\n', p) : \
|
||||
__swbuf((int)(c), p) : \
|
||||
(*(p)->_p = (c), (int)*(p)->_p++))
|
||||
#endif
|
||||
|
||||
#define __sfeof(p) (((p)->_flags & __SEOF) != 0)
|
||||
#define __sferror(p) (((p)->_flags & __SERR) != 0)
|
||||
#define __sclearerr(p) ((void)((p)->_flags &= ~(__SERR|__SEOF)))
|
||||
#define __sfileno(p) ((p)->_file)
|
||||
|
||||
__BEGIN_DECLS
|
||||
void flockfile(FILE *);
|
||||
int ftrylockfile(FILE *);
|
||||
void funlockfile(FILE *);
|
||||
int getc_unlocked(FILE *);
|
||||
int getchar_unlocked(void);
|
||||
int putc_unlocked(int, FILE *);
|
||||
int putchar_unlocked(int);
|
||||
|
||||
/* Removed in Issue 6 */
|
||||
#if !defined(_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 200112L
|
||||
int getw(FILE *);
|
||||
int putw(int, FILE *);
|
||||
#endif
|
||||
|
||||
__swift_unavailable("Use mkstemp(3) 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 tempnam(3), it is highly recommended that you use mkstemp(3) instead.")
|
||||
#endif
|
||||
char *tempnam(const char *__dir, const char *__prefix) __DARWIN_ALIAS(tempnam);
|
||||
__END_DECLS
|
||||
|
||||
#ifndef lint
|
||||
#define getc_unlocked(fp) __sgetc(fp)
|
||||
#define putc_unlocked(x, fp) __sputc(x, fp)
|
||||
#endif /* lint */
|
||||
|
||||
#define getchar_unlocked() getc_unlocked(stdin)
|
||||
#define putchar_unlocked(x) putc_unlocked(x, stdout)
|
||||
#endif /* __DARWIN_C_LEVEL >= 199506L */
|
||||
|
||||
|
||||
|
||||
/* Additional functionality provided by:
|
||||
* POSIX.1-2001
|
||||
* ISO C99
|
||||
*/
|
||||
|
||||
#if __DARWIN_C_LEVEL >= 200112L
|
||||
#include <sys/_types/_off_t.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
int fseeko(FILE * __stream, off_t __offset, int __whence);
|
||||
off_t ftello(FILE * __stream);
|
||||
__END_DECLS
|
||||
#endif /* __DARWIN_C_LEVEL >= 200112L */
|
||||
|
||||
#if __DARWIN_C_LEVEL >= 200112L || defined(_C99_SOURCE) || defined(__cplusplus)
|
||||
__BEGIN_DECLS
|
||||
int snprintf(char * __restrict __str, size_t __size, const char * __restrict __format, ...) __printflike(3, 4);
|
||||
int vfscanf(FILE * __restrict __stream, const char * __restrict __format, va_list) __scanflike(2, 0);
|
||||
int vscanf(const char * __restrict __format, va_list) __scanflike(1, 0);
|
||||
int vsnprintf(char * __restrict __str, size_t __size, const char * __restrict __format, va_list) __printflike(3, 0);
|
||||
int vsscanf(const char * __restrict __str, const char * __restrict __format, va_list) __scanflike(2, 0);
|
||||
__END_DECLS
|
||||
#endif /* __DARWIN_C_LEVEL >= 200112L || defined(_C99_SOURCE) || defined(__cplusplus) */
|
||||
|
||||
|
||||
|
||||
/* Additional functionality provided by:
|
||||
* POSIX.1-2008
|
||||
*/
|
||||
|
||||
#if __DARWIN_C_LEVEL >= 200809L
|
||||
#include <sys/_types/_ssize_t.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
int dprintf(int, const char * __restrict, ...) __printflike(2, 3) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
|
||||
int vdprintf(int, const char * __restrict, va_list) __printflike(2, 0) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
|
||||
ssize_t getdelim(char ** __restrict __linep, size_t * __restrict __linecapp, int __delimiter, FILE * __restrict __stream) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
|
||||
ssize_t getline(char ** __restrict __linep, size_t * __restrict __linecapp, FILE * __restrict __stream) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
|
||||
FILE *fmemopen(void * __restrict __buf, size_t __size, const char * __restrict __mode) __API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0), watchos(4.0));
|
||||
FILE *open_memstream(char **__bufp, size_t *__sizep) __API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0), watchos(4.0));
|
||||
__END_DECLS
|
||||
#endif /* __DARWIN_C_LEVEL >= 200809L */
|
||||
|
||||
|
||||
|
||||
/* Darwin extensions */
|
||||
|
||||
#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
|
||||
__BEGIN_DECLS
|
||||
extern __const int sys_nerr; /* perror(3) external variables */
|
||||
extern __const char *__const sys_errlist[];
|
||||
|
||||
int asprintf(char ** __restrict, const char * __restrict, ...) __printflike(2, 3);
|
||||
char *ctermid_r(char *);
|
||||
char *fgetln(FILE *, size_t *);
|
||||
__const char *fmtcheck(const char *, const char *) __attribute__((format_arg(2)));
|
||||
int fpurge(FILE *);
|
||||
void setbuffer(FILE *, char *, int);
|
||||
int setlinebuf(FILE *);
|
||||
int vasprintf(char ** __restrict, const char * __restrict, va_list) __printflike(2, 0);
|
||||
|
||||
|
||||
/*
|
||||
* Stdio function-access interface.
|
||||
*/
|
||||
FILE *funopen(const void *,
|
||||
int (* _Nullable)(void *, char *, int),
|
||||
int (* _Nullable)(void *, const char *, int),
|
||||
fpos_t (* _Nullable)(void *, fpos_t, int),
|
||||
int (* _Nullable)(void *));
|
||||
__END_DECLS
|
||||
#define fropen(cookie, fn) funopen(cookie, fn, 0, 0, 0)
|
||||
#define fwopen(cookie, fn) funopen(cookie, 0, fn, 0, 0)
|
||||
|
||||
#define feof_unlocked(p) __sfeof(p)
|
||||
#define ferror_unlocked(p) __sferror(p)
|
||||
#define clearerr_unlocked(p) __sclearerr(p)
|
||||
#define fileno_unlocked(p) __sfileno(p)
|
||||
|
||||
#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */
|
||||
|
||||
|
||||
#if defined (__GNUC__) && _FORTIFY_SOURCE > 0 && !defined (__cplusplus)
|
||||
/* Security checking functions. */
|
||||
#include <secure/_stdio.h>
|
||||
#endif
|
||||
|
||||
#endif /* _STDIO_H_ */
|
||||
|
||||
378
lib/libc/include/any-macos-any/_stdlib.h
vendored
Normal file
378
lib/libc/include/any-macos-any/_stdlib.h
vendored
Normal file
@@ -0,0 +1,378 @@
|
||||
/*
|
||||
* Copyright (c) 2023 Apple Inc. All rights reserved.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_START@
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original Code
|
||||
* as defined in and that are subject to the Apple Public Source License
|
||||
* Version 2.0 (the 'License'). You may not use this file except in
|
||||
* compliance with the License. Please obtain a copy of the License at
|
||||
* http://www.opensource.apple.com/apsl/ and read it before using this
|
||||
* file.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
|
||||
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
|
||||
* Please see the License for the specific language governing rights and
|
||||
* limitations under the License.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_END@
|
||||
*/
|
||||
/*-
|
||||
* Copyright (c) 1990, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)stdlib.h 8.5 (Berkeley) 5/19/95
|
||||
*/
|
||||
|
||||
#ifndef _STDLIB_H_
|
||||
#define _STDLIB_H_
|
||||
|
||||
#include <Availability.h>
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
#include <_types.h>
|
||||
#if !defined(_ANSI_SOURCE)
|
||||
#include <sys/wait.h>
|
||||
#if (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
|
||||
#include <alloca.h>
|
||||
#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
|
||||
#endif /* !_ANSI_SOURCE */
|
||||
|
||||
/* DO NOT REMOVE THIS COMMENT: fixincludes needs to see:
|
||||
* _GCC_SIZE_T */
|
||||
#include <sys/_types/_size_t.h>
|
||||
|
||||
#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
|
||||
#include <sys/_types/_ct_rune_t.h>
|
||||
#include <sys/_types/_rune_t.h>
|
||||
#endif /* !_ANSI_SOURCE && (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
|
||||
|
||||
#include <sys/_types/_wchar_t.h>
|
||||
|
||||
typedef struct {
|
||||
int quot; /* quotient */
|
||||
int rem; /* remainder */
|
||||
} div_t;
|
||||
|
||||
typedef struct {
|
||||
long quot; /* quotient */
|
||||
long rem; /* remainder */
|
||||
} ldiv_t;
|
||||
|
||||
#if !__DARWIN_NO_LONG_LONG
|
||||
typedef struct {
|
||||
long long quot;
|
||||
long long rem;
|
||||
} lldiv_t;
|
||||
#endif /* !__DARWIN_NO_LONG_LONG */
|
||||
|
||||
#include <sys/_types/_null.h>
|
||||
|
||||
#define EXIT_FAILURE 1
|
||||
#define EXIT_SUCCESS 0
|
||||
|
||||
#define RAND_MAX 0x7fffffff
|
||||
|
||||
// When _USE_EXTENDED_LOCALES_ is enabled (by including xlocale.h),
|
||||
// MB_CUR_MAX is defined by xlocale.h.
|
||||
#if !defined(MB_CUR_MAX) && !defined(_USE_EXTENDED_LOCALES_)
|
||||
#if __has_feature(modules)
|
||||
// When clang modules are enabled, there can only be one definition of
|
||||
// MB_CUR_MAX, and that needs to be the same one used by xlocale.h.
|
||||
#include <_mb_cur_max.h>
|
||||
#else
|
||||
extern int __mb_cur_max;
|
||||
#define MB_CUR_MAX __mb_cur_max
|
||||
#endif /* __has_feature(modules) */
|
||||
#endif /* !MB_CUR_MAX && !_USE_EXTENDED_LOCALES_ */
|
||||
|
||||
#include <malloc/_malloc.h>
|
||||
#include <_abort.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
int abs(int) __pure2;
|
||||
int atexit(void (* _Nonnull)(void));
|
||||
#if (__DARWIN_C_LEVEL >= __DARWIN_C_FULL) || \
|
||||
defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
|
||||
int at_quick_exit(void (*)(void));
|
||||
#endif
|
||||
double atof(const char *);
|
||||
int atoi(const char *);
|
||||
long atol(const char *);
|
||||
#if !__DARWIN_NO_LONG_LONG
|
||||
long long
|
||||
atoll(const char *);
|
||||
#endif /* !__DARWIN_NO_LONG_LONG */
|
||||
void *bsearch(const void *__key, const void *__base, size_t __nel,
|
||||
size_t __width, int (* _Nonnull __compar)(const void *, const void *));
|
||||
/* calloc is now declared in _malloc.h */
|
||||
div_t div(int, int) __pure2;
|
||||
void exit(int) __dead2;
|
||||
/* free is now declared in _malloc.h */
|
||||
char *getenv(const char *);
|
||||
long labs(long) __pure2;
|
||||
ldiv_t ldiv(long, long) __pure2;
|
||||
#if !__DARWIN_NO_LONG_LONG
|
||||
long long
|
||||
llabs(long long);
|
||||
lldiv_t lldiv(long long, long long);
|
||||
#endif /* !__DARWIN_NO_LONG_LONG */
|
||||
/* malloc is now declared in _malloc.h */
|
||||
int mblen(const char *__s, size_t __n);
|
||||
size_t mbstowcs(wchar_t * __restrict , const char * __restrict, size_t);
|
||||
int mbtowc(wchar_t * __restrict, const char * __restrict, size_t);
|
||||
/* posix_memalign is now declared in _malloc.h */
|
||||
void qsort(void *__base, size_t __nel, size_t __width,
|
||||
int (* _Nonnull __compar)(const void *, const void *));
|
||||
#if (__DARWIN_C_LEVEL >= __DARWIN_C_FULL) || \
|
||||
defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
|
||||
void quick_exit(int) __dead2;
|
||||
#endif
|
||||
int rand(void) __swift_unavailable("Use arc4random instead.");
|
||||
/* realloc is now declared in _malloc.h */
|
||||
void srand(unsigned) __swift_unavailable("Use arc4random instead.");
|
||||
double strtod(const char *, char **) __DARWIN_ALIAS(strtod);
|
||||
float strtof(const char *, char **) __DARWIN_ALIAS(strtof);
|
||||
long strtol(const char *__str, char **__endptr, int __base);
|
||||
long double
|
||||
strtold(const char *, char **);
|
||||
#if !__DARWIN_NO_LONG_LONG
|
||||
long long
|
||||
strtoll(const char *__str, char **__endptr, int __base);
|
||||
#endif /* !__DARWIN_NO_LONG_LONG */
|
||||
unsigned long
|
||||
strtoul(const char *__str, char **__endptr, int __base);
|
||||
#if !__DARWIN_NO_LONG_LONG
|
||||
unsigned long long
|
||||
strtoull(const char *__str, char **__endptr, int __base);
|
||||
#endif /* !__DARWIN_NO_LONG_LONG */
|
||||
|
||||
__swift_unavailable("Use posix_spawn APIs or NSTask instead. (On iOS, process spawning is unavailable.)")
|
||||
__API_AVAILABLE(macos(10.0)) __IOS_PROHIBITED
|
||||
__WATCHOS_PROHIBITED __TVOS_PROHIBITED
|
||||
int system(const char *) __DARWIN_ALIAS_C(system);
|
||||
|
||||
|
||||
size_t wcstombs(char * __restrict, const wchar_t * __restrict, size_t);
|
||||
int wctomb(char *, wchar_t);
|
||||
|
||||
#ifndef _ANSI_SOURCE
|
||||
void _Exit(int) __dead2;
|
||||
long a64l(const char *);
|
||||
double drand48(void);
|
||||
char *ecvt(double, int, int *__restrict, int *__restrict); /* LEGACY */
|
||||
double erand48(unsigned short[3]);
|
||||
char *fcvt(double, int, int *__restrict, int *__restrict); /* LEGACY */
|
||||
char *gcvt(double, int, char *); /* LEGACY */
|
||||
int getsubopt(char **, char * const *, char **);
|
||||
int grantpt(int);
|
||||
#if __DARWIN_UNIX03
|
||||
char *initstate(unsigned, char *, size_t); /* no __DARWIN_ALIAS needed */
|
||||
#else /* !__DARWIN_UNIX03 */
|
||||
char *initstate(unsigned long, char *, long);
|
||||
#endif /* __DARWIN_UNIX03 */
|
||||
long jrand48(unsigned short[3]) __swift_unavailable("Use arc4random instead.");
|
||||
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.");
|
||||
long nrand48(unsigned short[3]) __swift_unavailable("Use arc4random instead.");
|
||||
int posix_openpt(int);
|
||||
char *ptsname(int);
|
||||
|
||||
#if (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
|
||||
int ptsname_r(int fildes, char *buffer, size_t buflen) __API_AVAILABLE(macos(10.13.4), ios(11.3), tvos(11.3), watchos(4.3));
|
||||
#endif
|
||||
|
||||
int putenv(char *) __DARWIN_ALIAS(putenv);
|
||||
long random(void) __swift_unavailable("Use arc4random instead.");
|
||||
int rand_r(unsigned *) __swift_unavailable("Use arc4random instead.");
|
||||
#if (__DARWIN_UNIX03 && !defined(_POSIX_C_SOURCE)) || defined(_DARWIN_C_SOURCE) || defined(_DARWIN_BETTER_REALPATH)
|
||||
char *realpath(const char * __restrict, char * __restrict) __DARWIN_EXTSN(realpath);
|
||||
#else /* (!__DARWIN_UNIX03 || _POSIX_C_SOURCE) && !_DARWIN_C_SOURCE && !_DARWIN_BETTER_REALPATH */
|
||||
char *realpath(const char * __restrict, char * __restrict) __DARWIN_ALIAS(realpath);
|
||||
#endif /* (__DARWIN_UNIX03 && _POSIX_C_SOURCE) || _DARWIN_C_SOURCE || _DARWIN_BETTER_REALPATH */
|
||||
unsigned short
|
||||
*seed48(unsigned short[3]);
|
||||
int setenv(const char * __name, const char * __value, int __overwrite) __DARWIN_ALIAS(setenv);
|
||||
#if __DARWIN_UNIX03
|
||||
void setkey(const char *) __DARWIN_ALIAS(setkey);
|
||||
#else /* !__DARWIN_UNIX03 */
|
||||
int setkey(const char *);
|
||||
#endif /* __DARWIN_UNIX03 */
|
||||
char *setstate(const char *);
|
||||
void srand48(long);
|
||||
#if __DARWIN_UNIX03
|
||||
void srandom(unsigned);
|
||||
#else /* !__DARWIN_UNIX03 */
|
||||
void srandom(unsigned long);
|
||||
#endif /* __DARWIN_UNIX03 */
|
||||
int unlockpt(int);
|
||||
#if __DARWIN_UNIX03
|
||||
int unsetenv(const char *) __DARWIN_ALIAS(unsetenv);
|
||||
#else /* !__DARWIN_UNIX03 */
|
||||
void unsetenv(const char *);
|
||||
#endif /* __DARWIN_UNIX03 */
|
||||
#endif /* !_ANSI_SOURCE */
|
||||
__END_DECLS
|
||||
|
||||
#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
|
||||
#include <machine/types.h>
|
||||
#include <sys/_types/_dev_t.h>
|
||||
#include <sys/_types/_mode_t.h>
|
||||
#include <_types/_uint32_t.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
uint32_t arc4random(void);
|
||||
void arc4random_addrandom(unsigned char * /*dat*/, int /*datlen*/)
|
||||
__OSX_DEPRECATED(10.0, 10.12, "use arc4random_stir")
|
||||
__IOS_DEPRECATED(2.0, 10.0, "use arc4random_stir")
|
||||
__TVOS_DEPRECATED(2.0, 10.0, "use arc4random_stir")
|
||||
__WATCHOS_DEPRECATED(1.0, 3.0, "use arc4random_stir");
|
||||
void arc4random_buf(void * __buf, size_t __nbytes) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
|
||||
void arc4random_stir(void);
|
||||
uint32_t
|
||||
arc4random_uniform(uint32_t __upper_bound) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
|
||||
#ifdef __BLOCKS__
|
||||
int atexit_b(void (^ _Nonnull)(void)) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2);
|
||||
|
||||
#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);
|
||||
#endif /* __BLOCKS__ */
|
||||
|
||||
/* getcap(3) functions */
|
||||
char *cgetcap(char *, const char *, int);
|
||||
int cgetclose(void);
|
||||
int cgetent(char **, char **, const char *);
|
||||
int cgetfirst(char **, char **);
|
||||
int cgetmatch(const char *, const char *);
|
||||
int cgetnext(char **, char **);
|
||||
int cgetnum(char *, const char *, long *);
|
||||
int cgetset(const char *);
|
||||
int cgetstr(char *, const char *, char **);
|
||||
int cgetustr(char *, const char *, char **);
|
||||
|
||||
int daemon(int, int) __DARWIN_1050(daemon) __OSX_AVAILABLE_BUT_DEPRECATED_MSG(__MAC_10_0, __MAC_10_5, __IPHONE_2_0, __IPHONE_2_0, "Use posix_spawn APIs instead.") __WATCHOS_PROHIBITED __TVOS_PROHIBITED;
|
||||
char *devname(dev_t, mode_t);
|
||||
char *devname_r(dev_t, mode_t, char *buf, int len);
|
||||
char *getbsize(int *, long *);
|
||||
int getloadavg(double [], int);
|
||||
const char
|
||||
*getprogname(void);
|
||||
void setprogname(const char *);
|
||||
|
||||
#ifdef __BLOCKS__
|
||||
#if __has_attribute(noescape)
|
||||
#define __sort_noescape __attribute__((__noescape__))
|
||||
#else
|
||||
#define __sort_noescape
|
||||
#endif
|
||||
#endif /* __BLOCKS__ */
|
||||
|
||||
int heapsort(void *__base, size_t __nel, size_t __width,
|
||||
int (* _Nonnull __compar)(const void *, const void *));
|
||||
#ifdef __BLOCKS__
|
||||
int heapsort_b(void *__base, size_t __nel, size_t __width,
|
||||
int (^ _Nonnull __compar)(const void *, const void *) __sort_noescape)
|
||||
__OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2);
|
||||
#endif /* __BLOCKS__ */
|
||||
int mergesort(void *__base, size_t __nel, size_t __width,
|
||||
int (* _Nonnull __compar)(const void *, const void *));
|
||||
#ifdef __BLOCKS__
|
||||
int mergesort_b(void *__base, size_t __nel, size_t __width,
|
||||
int (^ _Nonnull __compar)(const void *, const void *) __sort_noescape)
|
||||
__OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2);
|
||||
#endif /* __BLOCKS__ */
|
||||
void psort(void *__base, size_t __nel, size_t __width,
|
||||
int (* _Nonnull __compar)(const void *, const void *))
|
||||
__OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2);
|
||||
#ifdef __BLOCKS__
|
||||
void psort_b(void *__base, size_t __nel, size_t __width,
|
||||
int (^ _Nonnull __compar)(const void *, const void *) __sort_noescape)
|
||||
__OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2);
|
||||
#endif /* __BLOCKS__ */
|
||||
void psort_r(void *__base, size_t __nel, size_t __width, void *,
|
||||
int (* _Nonnull __compar)(void *, const void *, const void *))
|
||||
__OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2);
|
||||
#ifdef __BLOCKS__
|
||||
void qsort_b(void *__base, size_t __nel, size_t __width,
|
||||
int (^ _Nonnull __compar)(const void *, const void *) __sort_noescape)
|
||||
__OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2);
|
||||
#endif /* __BLOCKS__ */
|
||||
void qsort_r(void *__base, size_t __nel, size_t __width, void *,
|
||||
int (* _Nonnull __compar)(void *, const void *, const void *));
|
||||
int radixsort(const unsigned char **__base, int __nel, const unsigned char *__table,
|
||||
unsigned __endbyte);
|
||||
int rpmatch(const char *)
|
||||
__API_AVAILABLE(macos(10.15), ios(13.0), tvos(13.0), watchos(6.0));
|
||||
int sradixsort(const unsigned char **__base, int __nel, const unsigned char *__table,
|
||||
unsigned __endbyte);
|
||||
void sranddev(void);
|
||||
void srandomdev(void);
|
||||
/* reallocf is now declared in _malloc.h */
|
||||
long long
|
||||
strtonum(const char *__numstr, long long __minval, long long __maxval, const char **__errstrp)
|
||||
__API_AVAILABLE(macos(11.0), ios(14.0), tvos(14.0), watchos(7.0));
|
||||
#if !__DARWIN_NO_LONG_LONG
|
||||
long long
|
||||
strtoq(const char *__str, char **__endptr, int __base);
|
||||
unsigned long long
|
||||
strtouq(const char *__str, char **__endptr, int __base);
|
||||
#endif /* !__DARWIN_NO_LONG_LONG */
|
||||
extern char *suboptarg; /* getsubopt(3) external variable */
|
||||
/* valloc is now declared in _malloc.h */
|
||||
__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
|
||||
#endif
|
||||
__END_DECLS
|
||||
|
||||
#endif /* _STDLIB_H_ */
|
||||
191
lib/libc/include/any-macos-any/_string.h
vendored
Normal file
191
lib/libc/include/any-macos-any/_string.h
vendored
Normal file
@@ -0,0 +1,191 @@
|
||||
/*
|
||||
* Copyright (c) 2023 Apple Inc. All rights reserved.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_START@
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original Code
|
||||
* as defined in and that are subject to the Apple Public Source License
|
||||
* Version 2.0 (the 'License'). You may not use this file except in
|
||||
* compliance with the License. Please obtain a copy of the License at
|
||||
* http://www.opensource.apple.com/apsl/ and read it before using this
|
||||
* file.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
|
||||
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
|
||||
* Please see the License for the specific language governing rights and
|
||||
* limitations under the License.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_END@
|
||||
*/
|
||||
/*-
|
||||
* Copyright (c) 1990, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)string.h 8.1 (Berkeley) 6/2/93
|
||||
*/
|
||||
|
||||
#ifndef _STRING_H_
|
||||
#define _STRING_H_
|
||||
|
||||
#include <_types.h>
|
||||
#include <sys/cdefs.h>
|
||||
#include <Availability.h>
|
||||
#include <sys/_types/_size_t.h>
|
||||
#include <sys/_types/_null.h>
|
||||
|
||||
/* ANSI-C */
|
||||
|
||||
__BEGIN_DECLS
|
||||
void *memchr(const void *__s, int __c, size_t __n);
|
||||
int memcmp(const void *__s1, const void *__s2, size_t __n);
|
||||
void *memcpy(void *__dst, const void *__src, size_t __n);
|
||||
void *memmove(void *__dst, const void *__src, size_t __len);
|
||||
void *memset(void *__b, int __c, size_t __len);
|
||||
char *strcat(char *__s1, const char *__s2);
|
||||
char *strchr(const char *__s, int __c);
|
||||
int strcmp(const char *__s1, const char *__s2);
|
||||
int strcoll(const char *__s1, const char *__s2);
|
||||
char *strcpy(char *__dst, const char *__src);
|
||||
size_t strcspn(const char *__s, const char *__charset);
|
||||
char *strerror(int __errnum) __DARWIN_ALIAS(strerror);
|
||||
size_t strlen(const char *__s);
|
||||
char *strncat(char *__s1, const char *__s2, size_t __n);
|
||||
int strncmp(const char *__s1, const char *__s2, size_t __n);
|
||||
char *strncpy(char *__dst, const char *__src, size_t __n);
|
||||
char *strpbrk(const char *__s, const char *__charset);
|
||||
char *strrchr(const char *__s, int __c);
|
||||
size_t strspn(const char *__s, const char *__charset);
|
||||
char *strstr(const char *__big, const char *__little);
|
||||
char *strtok(char *__str, const char *__sep);
|
||||
size_t strxfrm(char *__s1, const char *__s2, size_t __n);
|
||||
__END_DECLS
|
||||
|
||||
|
||||
|
||||
/* Additional functionality provided by:
|
||||
* POSIX.1c-1995,
|
||||
* POSIX.1i-1995,
|
||||
* and the omnibus ISO/IEC 9945-1: 1996
|
||||
*/
|
||||
|
||||
#if __DARWIN_C_LEVEL >= 199506L
|
||||
__BEGIN_DECLS
|
||||
char *strtok_r(char *__str, const char *__sep, char **__lasts);
|
||||
__END_DECLS
|
||||
#endif /* __DARWIN_C_LEVEL >= 199506L */
|
||||
|
||||
|
||||
|
||||
/* Additional functionality provided by:
|
||||
* POSIX.1-2001
|
||||
*/
|
||||
|
||||
#if __DARWIN_C_LEVEL >= 200112L
|
||||
__BEGIN_DECLS
|
||||
int strerror_r(int __errnum, char *__strerrbuf, size_t __buflen);
|
||||
char *strdup(const char *__s1);
|
||||
void *memccpy(void *__dst, const void *__src, int __c, size_t __n);
|
||||
__END_DECLS
|
||||
#endif /* __DARWIN_C_LEVEL >= 200112L */
|
||||
|
||||
|
||||
|
||||
/* Additional functionality provided by:
|
||||
* POSIX.1-2008
|
||||
*/
|
||||
|
||||
#if __DARWIN_C_LEVEL >= 200809L
|
||||
__BEGIN_DECLS
|
||||
char *stpcpy(char *__dst, const char *__src);
|
||||
char *stpncpy(char *__dst, const char *__src, size_t __n) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
|
||||
char *strndup(const char *__s1, size_t __n) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
|
||||
size_t strnlen(const char *__s1, size_t __n) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
|
||||
char *strsignal(int __sig);
|
||||
__END_DECLS
|
||||
#endif /* __DARWIN_C_LEVEL >= 200809L */
|
||||
|
||||
/* C11 Annex K */
|
||||
|
||||
#if defined(__STDC_WANT_LIB_EXT1__) && __STDC_WANT_LIB_EXT1__ >= 1
|
||||
#include <sys/_types/_rsize_t.h>
|
||||
#include <sys/_types/_errno_t.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
errno_t memset_s(void *__s, rsize_t __smax, int __c, rsize_t __n) __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0);
|
||||
__END_DECLS
|
||||
#endif
|
||||
|
||||
/* Darwin extensions */
|
||||
|
||||
#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
|
||||
#include <sys/_types/_ssize_t.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
void *memmem(const void *__big, size_t __big_len, const void *__little, size_t __little_len) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
|
||||
void memset_pattern4(void *__b, const void *__pattern4, size_t __len) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_3_0);
|
||||
void memset_pattern8(void *__b, const void *__pattern8, size_t __len) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_3_0);
|
||||
void memset_pattern16(void *__b, const void *__pattern16, size_t __len) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_3_0);
|
||||
|
||||
char *strcasestr(const char *__big, const char *__little);
|
||||
char *strnstr(const char *__big, const char *__little, size_t __len);
|
||||
size_t strlcat(char *__dst, const char *__source, size_t __size);
|
||||
size_t strlcpy(char *__dst, const char *__source, size_t __size);
|
||||
void strmode(int __mode, char *__bp);
|
||||
char *strsep(char **__stringp, const char *__delim);
|
||||
|
||||
/* SUS places swab() in unistd.h. It is listed here for source compatibility */
|
||||
void swab(const void * __restrict, void * __restrict, ssize_t);
|
||||
|
||||
__OSX_AVAILABLE(10.12.1) __IOS_AVAILABLE(10.1)
|
||||
__TVOS_AVAILABLE(10.0.1) __WATCHOS_AVAILABLE(3.1)
|
||||
int timingsafe_bcmp(const void *__b1, const void *__b2, size_t __len);
|
||||
|
||||
__OSX_AVAILABLE(11.0) __IOS_AVAILABLE(14.0)
|
||||
__TVOS_AVAILABLE(14.0) __WATCHOS_AVAILABLE(7.0)
|
||||
int strsignal_r(int __sig, char *__strsignalbuf, size_t __buflen);
|
||||
__END_DECLS
|
||||
|
||||
/* Some functions historically defined in string.h were placed in strings.h
|
||||
* by SUS.
|
||||
*/
|
||||
#include <_strings.h>
|
||||
#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */
|
||||
|
||||
|
||||
#if defined (__GNUC__) && _FORTIFY_SOURCE > 0 && !defined (__cplusplus)
|
||||
/* Security checking functions. */
|
||||
#include <secure/_string.h>
|
||||
#endif
|
||||
|
||||
#endif /* _STRING_H_ */
|
||||
98
lib/libc/include/any-macos-any/_strings.h
vendored
Normal file
98
lib/libc/include/any-macos-any/_strings.h
vendored
Normal file
@@ -0,0 +1,98 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2007, 2010, 2023 Apple Inc. All rights reserved.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_START@
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original Code
|
||||
* as defined in and that are subject to the Apple Public Source License
|
||||
* Version 2.0 (the 'License'). You may not use this file except in
|
||||
* compliance with the License. Please obtain a copy of the License at
|
||||
* http://www.opensource.apple.com/apsl/ and read it before using this
|
||||
* file.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
|
||||
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
|
||||
* Please see the License for the specific language governing rights and
|
||||
* limitations under the License.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_END@
|
||||
*/
|
||||
/*-
|
||||
* Copyright (c) 1990, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)strings.h 8.1 (Berkeley) 6/2/93
|
||||
*/
|
||||
|
||||
#ifndef __STRINGS_H_
|
||||
#define __STRINGS_H_
|
||||
|
||||
#include <_types.h>
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#include <Availability.h>
|
||||
#include <sys/_types/_size_t.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
/* Removed in Issue 7 */
|
||||
#if !defined(_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 200809L
|
||||
int bcmp(const void *, const void *, size_t) __POSIX_C_DEPRECATED(200112L);
|
||||
void bcopy(const void *, void *, size_t) __POSIX_C_DEPRECATED(200112L);
|
||||
void bzero(void *, size_t) __POSIX_C_DEPRECATED(200112L);
|
||||
char *index(const char *, int) __POSIX_C_DEPRECATED(200112L);
|
||||
char *rindex(const char *, int) __POSIX_C_DEPRECATED(200112L);
|
||||
#endif
|
||||
|
||||
int ffs(int);
|
||||
int strcasecmp(const char *, const char *);
|
||||
int strncasecmp(const char *, const char *, size_t);
|
||||
__END_DECLS
|
||||
|
||||
/* Darwin extensions */
|
||||
#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
|
||||
__BEGIN_DECLS
|
||||
int ffsl(long) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
|
||||
int ffsll(long long) __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0);
|
||||
int fls(int) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
|
||||
int flsl(long) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
|
||||
int flsll(long long) __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0);
|
||||
__END_DECLS
|
||||
#endif
|
||||
|
||||
#if defined (__GNUC__) && _FORTIFY_SOURCE > 0 && !defined (__cplusplus)
|
||||
/* Security checking functions. */
|
||||
#include <secure/_strings.h>
|
||||
#endif
|
||||
|
||||
#endif /* __STRINGS_H_ */
|
||||
204
lib/libc/include/any-macos-any/_time.h
vendored
Normal file
204
lib/libc/include/any-macos-any/_time.h
vendored
Normal file
@@ -0,0 +1,204 @@
|
||||
/*
|
||||
* Copyright (c) 2023 Apple Computer, Inc. All rights reserved.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_START@
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original Code
|
||||
* as defined in and that are subject to the Apple Public Source License
|
||||
* Version 2.0 (the 'License'). You may not use this file except in
|
||||
* compliance with the License. Please obtain a copy of the License at
|
||||
* http://www.opensource.apple.com/apsl/ and read it before using this
|
||||
* file.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
|
||||
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
|
||||
* Please see the License for the specific language governing rights and
|
||||
* limitations under the License.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_END@
|
||||
*/
|
||||
/*
|
||||
* Copyright (c) 1989, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
* (c) UNIX System Laboratories, Inc.
|
||||
* All or some portions of this file are derived from material licensed
|
||||
* to the University of California by American Telephone and Telegraph
|
||||
* Co. or Unix System Laboratories, Inc. and are reproduced herein with
|
||||
* the permission of UNIX System Laboratories, Inc.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)time.h 8.3 (Berkeley) 1/21/94
|
||||
*/
|
||||
|
||||
#ifndef _TIME_H_
|
||||
#define _TIME_H_
|
||||
|
||||
#include <_types.h>
|
||||
#include <sys/cdefs.h>
|
||||
#include <Availability.h>
|
||||
#include <sys/_types/_clock_t.h>
|
||||
#include <sys/_types/_null.h>
|
||||
#include <sys/_types/_size_t.h>
|
||||
#include <sys/_types/_time_t.h>
|
||||
#include <sys/_types/_timespec.h>
|
||||
|
||||
struct tm {
|
||||
int tm_sec; /* seconds after the minute [0-60] */
|
||||
int tm_min; /* minutes after the hour [0-59] */
|
||||
int tm_hour; /* hours since midnight [0-23] */
|
||||
int tm_mday; /* day of the month [1-31] */
|
||||
int tm_mon; /* months since January [0-11] */
|
||||
int tm_year; /* years since 1900 */
|
||||
int tm_wday; /* days since Sunday [0-6] */
|
||||
int tm_yday; /* days since January 1 [0-365] */
|
||||
int tm_isdst; /* Daylight Savings Time flag */
|
||||
long tm_gmtoff; /* offset from UTC in seconds */
|
||||
char *tm_zone; /* timezone abbreviation */
|
||||
};
|
||||
|
||||
#if __DARWIN_UNIX03
|
||||
#define CLOCKS_PER_SEC ((clock_t)1000000) /* [XSI] */
|
||||
#else /* !__DARWIN_UNIX03 */
|
||||
#include <machine/_limits.h> /* Include file containing CLK_TCK. */
|
||||
|
||||
#define CLOCKS_PER_SEC ((clock_t)(__DARWIN_CLK_TCK))
|
||||
#endif /* __DARWIN_UNIX03 */
|
||||
|
||||
#ifndef _ANSI_SOURCE
|
||||
extern char *tzname[];
|
||||
#endif
|
||||
|
||||
extern int getdate_err;
|
||||
#if __DARWIN_UNIX03
|
||||
extern long timezone __DARWIN_ALIAS(timezone);
|
||||
#endif /* __DARWIN_UNIX03 */
|
||||
extern int daylight;
|
||||
|
||||
__BEGIN_DECLS
|
||||
char *asctime(const struct tm *);
|
||||
clock_t clock(void) __DARWIN_ALIAS(clock);
|
||||
char *ctime(const time_t *);
|
||||
double difftime(time_t, time_t);
|
||||
struct tm *getdate(const char *);
|
||||
struct tm *gmtime(const time_t *);
|
||||
struct tm *localtime(const time_t *);
|
||||
time_t mktime(struct tm *) __DARWIN_ALIAS(mktime);
|
||||
size_t strftime(char * __restrict, size_t, const char * __restrict, const struct tm * __restrict) __DARWIN_ALIAS(strftime);
|
||||
char *strptime(const char * __restrict, const char * __restrict, struct tm * __restrict) __DARWIN_ALIAS(strptime);
|
||||
time_t time(time_t *);
|
||||
|
||||
#ifndef _ANSI_SOURCE
|
||||
void tzset(void);
|
||||
#endif /* not ANSI */
|
||||
|
||||
/* [TSF] Thread safe functions */
|
||||
char *asctime_r(const struct tm * __restrict, char * __restrict);
|
||||
char *ctime_r(const time_t *, char *);
|
||||
struct tm *gmtime_r(const time_t * __restrict, struct tm * __restrict);
|
||||
struct tm *localtime_r(const time_t * __restrict, struct tm * __restrict);
|
||||
|
||||
#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
|
||||
time_t posix2time(time_t);
|
||||
#if !__DARWIN_UNIX03
|
||||
char *timezone(int, int);
|
||||
#endif /* !__DARWIN_UNIX03 */
|
||||
void tzsetwall(void);
|
||||
time_t time2posix(time_t);
|
||||
time_t timelocal(struct tm * const);
|
||||
time_t timegm(struct tm * const);
|
||||
#endif /* neither ANSI nor POSIX */
|
||||
|
||||
#if !defined(_ANSI_SOURCE)
|
||||
int nanosleep(const struct timespec *__rqtp, struct timespec *__rmtp) __DARWIN_ALIAS_C(nanosleep);
|
||||
#endif
|
||||
|
||||
#if !defined(_DARWIN_FEATURE_CLOCK_GETTIME) || _DARWIN_FEATURE_CLOCK_GETTIME != 0
|
||||
#if __DARWIN_C_LEVEL >= 199309L
|
||||
#if __has_feature(enumerator_attributes)
|
||||
#define __CLOCK_AVAILABILITY __OSX_AVAILABLE(10.12) __IOS_AVAILABLE(10.0) __TVOS_AVAILABLE(10.0) __WATCHOS_AVAILABLE(3.0)
|
||||
#else
|
||||
#define __CLOCK_AVAILABILITY
|
||||
#endif
|
||||
|
||||
typedef enum {
|
||||
_CLOCK_REALTIME __CLOCK_AVAILABILITY = 0,
|
||||
#define CLOCK_REALTIME _CLOCK_REALTIME
|
||||
_CLOCK_MONOTONIC __CLOCK_AVAILABILITY = 6,
|
||||
#define CLOCK_MONOTONIC _CLOCK_MONOTONIC
|
||||
#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
|
||||
_CLOCK_MONOTONIC_RAW __CLOCK_AVAILABILITY = 4,
|
||||
#define CLOCK_MONOTONIC_RAW _CLOCK_MONOTONIC_RAW
|
||||
_CLOCK_MONOTONIC_RAW_APPROX __CLOCK_AVAILABILITY = 5,
|
||||
#define CLOCK_MONOTONIC_RAW_APPROX _CLOCK_MONOTONIC_RAW_APPROX
|
||||
_CLOCK_UPTIME_RAW __CLOCK_AVAILABILITY = 8,
|
||||
#define CLOCK_UPTIME_RAW _CLOCK_UPTIME_RAW
|
||||
_CLOCK_UPTIME_RAW_APPROX __CLOCK_AVAILABILITY = 9,
|
||||
#define CLOCK_UPTIME_RAW_APPROX _CLOCK_UPTIME_RAW_APPROX
|
||||
#endif
|
||||
_CLOCK_PROCESS_CPUTIME_ID __CLOCK_AVAILABILITY = 12,
|
||||
#define CLOCK_PROCESS_CPUTIME_ID _CLOCK_PROCESS_CPUTIME_ID
|
||||
_CLOCK_THREAD_CPUTIME_ID __CLOCK_AVAILABILITY = 16
|
||||
#define CLOCK_THREAD_CPUTIME_ID _CLOCK_THREAD_CPUTIME_ID
|
||||
} clockid_t;
|
||||
|
||||
__CLOCK_AVAILABILITY
|
||||
int clock_getres(clockid_t __clock_id, struct timespec *__res);
|
||||
|
||||
__CLOCK_AVAILABILITY
|
||||
int clock_gettime(clockid_t __clock_id, struct timespec *__tp);
|
||||
|
||||
#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
|
||||
__CLOCK_AVAILABILITY
|
||||
__uint64_t clock_gettime_nsec_np(clockid_t __clock_id);
|
||||
#endif
|
||||
|
||||
__OSX_AVAILABLE(10.12) __IOS_PROHIBITED
|
||||
__TVOS_PROHIBITED __WATCHOS_PROHIBITED
|
||||
int clock_settime(clockid_t __clock_id, const struct timespec *__tp);
|
||||
|
||||
#undef __CLOCK_AVAILABILITY
|
||||
#endif /* __DARWIN_C_LEVEL */
|
||||
#endif /* _DARWIN_FEATURE_CLOCK_GETTIME */
|
||||
|
||||
#if (__DARWIN_C_LEVEL >= __DARWIN_C_FULL) || \
|
||||
(defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || \
|
||||
(defined(__cplusplus) && __cplusplus >= 201703L)
|
||||
/* ISO/IEC 9899:201x 7.27.2.5 The timespec_get function */
|
||||
#define TIME_UTC 1 /* time elapsed since epoch */
|
||||
__API_AVAILABLE(macosx(10.15), ios(13.0), tvos(13.0), watchos(6.0))
|
||||
int timespec_get(struct timespec *ts, int base);
|
||||
#endif
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* !_TIME_H_ */
|
||||
227
lib/libc/include/any-macos-any/_wchar.h
vendored
Normal file
227
lib/libc/include/any-macos-any/_wchar.h
vendored
Normal file
@@ -0,0 +1,227 @@
|
||||
/*-
|
||||
* Copyright (c)1999 Citrus Project,
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $FreeBSD: /repoman/r/ncvs/src/include/wchar.h,v 1.34 2003/03/13 06:29:53 tjr Exp $
|
||||
*/
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to The NetBSD Foundation
|
||||
* by Julian Coleman.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the NetBSD
|
||||
* Foundation, Inc. and its contributors.
|
||||
* 4. Neither the name of The NetBSD Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $NetBSD: wchar.h,v 1.8 2000/12/22 05:31:42 itojun Exp $
|
||||
*/
|
||||
|
||||
#ifndef _WCHAR_H_
|
||||
#define _WCHAR_H_
|
||||
|
||||
#include <_types.h>
|
||||
#include <sys/cdefs.h>
|
||||
#include <Availability.h>
|
||||
|
||||
#include <sys/_types/_null.h>
|
||||
#include <sys/_types/_size_t.h>
|
||||
#include <sys/_types/_mbstate_t.h>
|
||||
#include <sys/_types/_ct_rune_t.h>
|
||||
#include <sys/_types/_rune_t.h>
|
||||
#include <sys/_types/_wchar_t.h>
|
||||
|
||||
#ifndef WCHAR_MIN
|
||||
#define WCHAR_MIN __DARWIN_WCHAR_MIN
|
||||
#endif
|
||||
|
||||
#ifndef WCHAR_MAX
|
||||
#define WCHAR_MAX __DARWIN_WCHAR_MAX
|
||||
#endif
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
#include <__wctype.h>
|
||||
|
||||
|
||||
/* Initially added in Issue 4 */
|
||||
__BEGIN_DECLS
|
||||
wint_t btowc(int);
|
||||
wint_t fgetwc(FILE *);
|
||||
wchar_t *fgetws(wchar_t * __restrict, int, FILE * __restrict);
|
||||
wint_t fputwc(wchar_t, FILE *);
|
||||
int fputws(const wchar_t * __restrict, FILE * __restrict);
|
||||
int fwide(FILE *, int);
|
||||
int fwprintf(FILE * __restrict, const wchar_t * __restrict, ...);
|
||||
int fwscanf(FILE * __restrict, const wchar_t * __restrict, ...);
|
||||
wint_t getwc(FILE *);
|
||||
wint_t getwchar(void);
|
||||
size_t mbrlen(const char * __restrict, size_t, mbstate_t * __restrict);
|
||||
size_t mbrtowc(wchar_t * __restrict, const char * __restrict, size_t,
|
||||
mbstate_t * __restrict);
|
||||
int mbsinit(const mbstate_t *);
|
||||
size_t mbsrtowcs(wchar_t * __restrict, const char ** __restrict, size_t,
|
||||
mbstate_t * __restrict);
|
||||
wint_t putwc(wchar_t, FILE *);
|
||||
wint_t putwchar(wchar_t);
|
||||
int swprintf(wchar_t * __restrict, size_t, const wchar_t * __restrict, ...);
|
||||
int swscanf(const wchar_t * __restrict, const wchar_t * __restrict, ...);
|
||||
wint_t ungetwc(wint_t, FILE *);
|
||||
int vfwprintf(FILE * __restrict, const wchar_t * __restrict,
|
||||
__darwin_va_list);
|
||||
int vswprintf(wchar_t * __restrict, size_t, const wchar_t * __restrict,
|
||||
__darwin_va_list);
|
||||
int vwprintf(const wchar_t * __restrict, __darwin_va_list);
|
||||
size_t wcrtomb(char * __restrict, wchar_t, mbstate_t * __restrict);
|
||||
wchar_t *wcscat(wchar_t * __restrict, const wchar_t * __restrict);
|
||||
wchar_t *wcschr(const wchar_t *, wchar_t);
|
||||
int wcscmp(const wchar_t *, const wchar_t *);
|
||||
int wcscoll(const wchar_t *, const wchar_t *);
|
||||
wchar_t *wcscpy(wchar_t * __restrict, const wchar_t * __restrict);
|
||||
size_t wcscspn(const wchar_t *, const wchar_t *);
|
||||
size_t wcsftime(wchar_t * __restrict, size_t, const wchar_t * __restrict,
|
||||
const struct tm * __restrict) __DARWIN_ALIAS(wcsftime);
|
||||
size_t wcslen(const wchar_t *);
|
||||
wchar_t *wcsncat(wchar_t * __restrict, const wchar_t * __restrict, size_t);
|
||||
int wcsncmp(const wchar_t *, const wchar_t *, size_t);
|
||||
wchar_t *wcsncpy(wchar_t * __restrict , const wchar_t * __restrict, size_t);
|
||||
wchar_t *wcspbrk(const wchar_t *, const wchar_t *);
|
||||
wchar_t *wcsrchr(const wchar_t *, wchar_t);
|
||||
size_t wcsrtombs(char * __restrict, const wchar_t ** __restrict, size_t,
|
||||
mbstate_t * __restrict);
|
||||
size_t wcsspn(const wchar_t *, const wchar_t *);
|
||||
wchar_t *wcsstr(const wchar_t * __restrict, const wchar_t * __restrict);
|
||||
size_t wcsxfrm(wchar_t * __restrict, const wchar_t * __restrict, size_t);
|
||||
int wctob(wint_t);
|
||||
double wcstod(const wchar_t * __restrict, wchar_t ** __restrict);
|
||||
wchar_t *wcstok(wchar_t * __restrict, const wchar_t * __restrict,
|
||||
wchar_t ** __restrict);
|
||||
long wcstol(const wchar_t * __restrict, wchar_t ** __restrict, int);
|
||||
unsigned long
|
||||
wcstoul(const wchar_t * __restrict, wchar_t ** __restrict, int);
|
||||
wchar_t *wmemchr(const wchar_t *, wchar_t, size_t);
|
||||
int wmemcmp(const wchar_t *, const wchar_t *, size_t);
|
||||
wchar_t *wmemcpy(wchar_t * __restrict, const wchar_t * __restrict, size_t);
|
||||
wchar_t *wmemmove(wchar_t *, const wchar_t *, size_t);
|
||||
wchar_t *wmemset(wchar_t *, wchar_t, size_t);
|
||||
int wprintf(const wchar_t * __restrict, ...);
|
||||
int wscanf(const wchar_t * __restrict, ...);
|
||||
int wcswidth(const wchar_t *, size_t);
|
||||
int wcwidth(wchar_t);
|
||||
__END_DECLS
|
||||
|
||||
|
||||
|
||||
/* Additional functionality provided by:
|
||||
* POSIX.1-2001
|
||||
* ISO C99
|
||||
*/
|
||||
|
||||
#if __DARWIN_C_LEVEL >= 200112L || defined(_C99_SOURCE) || defined(__cplusplus)
|
||||
__BEGIN_DECLS
|
||||
int vfwscanf(FILE * __restrict, const wchar_t * __restrict,
|
||||
__darwin_va_list);
|
||||
int vswscanf(const wchar_t * __restrict, const wchar_t * __restrict,
|
||||
__darwin_va_list);
|
||||
int vwscanf(const wchar_t * __restrict, __darwin_va_list);
|
||||
float wcstof(const wchar_t * __restrict, wchar_t ** __restrict);
|
||||
long double
|
||||
wcstold(const wchar_t * __restrict, wchar_t ** __restrict);
|
||||
#if !__DARWIN_NO_LONG_LONG
|
||||
long long
|
||||
wcstoll(const wchar_t * __restrict, wchar_t ** __restrict, int);
|
||||
unsigned long long
|
||||
wcstoull(const wchar_t * __restrict, wchar_t ** __restrict, int);
|
||||
#endif /* !__DARWIN_NO_LONG_LONG */
|
||||
__END_DECLS
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/* Additional functionality provided by:
|
||||
* POSIX.1-2008
|
||||
*/
|
||||
|
||||
#if __DARWIN_C_LEVEL >= 200809L
|
||||
__BEGIN_DECLS
|
||||
size_t mbsnrtowcs(wchar_t * __restrict, const char ** __restrict, size_t,
|
||||
size_t, mbstate_t * __restrict);
|
||||
wchar_t *wcpcpy(wchar_t * __restrict, const wchar_t * __restrict) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
|
||||
wchar_t *wcpncpy(wchar_t * __restrict, const wchar_t * __restrict, size_t) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
|
||||
wchar_t *wcsdup(const wchar_t *) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
|
||||
int wcscasecmp(const wchar_t *, const wchar_t *) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
|
||||
int wcsncasecmp(const wchar_t *, const wchar_t *, size_t n) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
|
||||
size_t wcsnlen(const wchar_t *, size_t) __pure __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
|
||||
size_t wcsnrtombs(char * __restrict, const wchar_t ** __restrict, size_t,
|
||||
size_t, mbstate_t * __restrict);
|
||||
FILE *open_wmemstream(wchar_t ** __bufp, size_t * __sizep) __API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0), watchos(4.0));
|
||||
__END_DECLS
|
||||
#endif /* __DARWIN_C_LEVEL >= 200809L */
|
||||
|
||||
|
||||
|
||||
/* Darwin extensions */
|
||||
|
||||
#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
|
||||
__BEGIN_DECLS
|
||||
wchar_t *fgetwln(FILE * __restrict, size_t *) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
|
||||
size_t wcslcat(wchar_t *, const wchar_t *, size_t);
|
||||
size_t wcslcpy(wchar_t *, const wchar_t *, size_t);
|
||||
__END_DECLS
|
||||
#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */
|
||||
|
||||
|
||||
/* Poison the following routines if -fshort-wchar is set */
|
||||
#if !defined(__cplusplus) && defined(__WCHAR_MAX__) && __WCHAR_MAX__ <= 0xffffU
|
||||
#pragma GCC poison fgetwln fgetws fputwc fputws fwprintf fwscanf mbrtowc mbsnrtowcs mbsrtowcs putwc putwchar swprintf swscanf vfwprintf vfwscanf vswprintf vswscanf vwprintf vwscanf wcrtomb wcscat wcschr wcscmp wcscoll wcscpy wcscspn wcsftime wcsftime wcslcat wcslcpy wcslen wcsncat wcsncmp wcsncpy wcsnrtombs wcspbrk wcsrchr wcsrtombs wcsspn wcsstr wcstod wcstof wcstok wcstol wcstold wcstoll wcstoul wcstoull wcswidth wcsxfrm wcwidth wmemchr wmemcmp wmemcpy wmemmove wmemset wprintf wscanf
|
||||
#endif
|
||||
|
||||
#endif /* !_WCHAR_H_ */
|
||||
140
lib/libc/include/any-macos-any/_wctype.h
vendored
140
lib/libc/include/any-macos-any/_wctype.h
vendored
@@ -23,23 +23,22 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* citrus Id: wctype.h,v 1.4 2000/12/21 01:50:21 itojun Exp
|
||||
* $NetBSD: wctype.h,v 1.3 2000/12/22 14:16:16 itojun Exp $
|
||||
* $FreeBSD: /repoman/r/ncvs/src/include/wctype.h,v 1.10 2002/08/21 16:19:55 mike Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
* Common header for wctype.h and wchar.h
|
||||
*
|
||||
* Contains everything required by wctype.h except:
|
||||
*
|
||||
* #include <_types/_wctrans_t.h>
|
||||
* int iswblank(wint_t);
|
||||
* wint_t towctrans(wint_t, wctrans_t);
|
||||
* wctrans_t wctrans(const char *);
|
||||
*/
|
||||
#ifndef _WCTYPE_H_
|
||||
#define _WCTYPE_H_
|
||||
|
||||
#ifndef __WCTYPE_H_
|
||||
#define __WCTYPE_H_
|
||||
#include <sys/cdefs.h>
|
||||
#include <_types.h>
|
||||
#include <_types/_wctrans_t.h>
|
||||
|
||||
#define __DARWIN_WCTYPE_TOP_inline __header_inline
|
||||
|
||||
#include <__wctype.h>
|
||||
#include <ctype.h>
|
||||
|
||||
/*
|
||||
* Use inline functions if we are allowed to and the compiler supports them.
|
||||
@@ -48,117 +47,80 @@
|
||||
(defined(_USE_CTYPE_INLINE_) || defined(__GNUC__) || defined(__cplusplus))
|
||||
|
||||
__DARWIN_WCTYPE_TOP_inline int
|
||||
iswalnum(wint_t _wc)
|
||||
iswblank(wint_t _wc)
|
||||
{
|
||||
return (__istype(_wc, _CTYPE_A|_CTYPE_D));
|
||||
return (__istype(_wc, _CTYPE_B));
|
||||
}
|
||||
|
||||
#if !defined(_ANSI_SOURCE)
|
||||
__DARWIN_WCTYPE_TOP_inline int
|
||||
iswascii(wint_t _wc)
|
||||
{
|
||||
return ((_wc & ~0x7F) == 0);
|
||||
}
|
||||
|
||||
__DARWIN_WCTYPE_TOP_inline int
|
||||
iswalpha(wint_t _wc)
|
||||
iswhexnumber(wint_t _wc)
|
||||
{
|
||||
return (__istype(_wc, _CTYPE_A));
|
||||
return (__istype(_wc, _CTYPE_X));
|
||||
}
|
||||
|
||||
__DARWIN_WCTYPE_TOP_inline int
|
||||
iswcntrl(wint_t _wc)
|
||||
iswideogram(wint_t _wc)
|
||||
{
|
||||
return (__istype(_wc, _CTYPE_C));
|
||||
return (__istype(_wc, _CTYPE_I));
|
||||
}
|
||||
|
||||
__DARWIN_WCTYPE_TOP_inline int
|
||||
iswctype(wint_t _wc, wctype_t _charclass)
|
||||
iswnumber(wint_t _wc)
|
||||
{
|
||||
return (__istype(_wc, _charclass));
|
||||
return (__istype(_wc, _CTYPE_D));
|
||||
}
|
||||
|
||||
__DARWIN_WCTYPE_TOP_inline int
|
||||
iswdigit(wint_t _wc)
|
||||
iswphonogram(wint_t _wc)
|
||||
{
|
||||
return (__isctype(_wc, _CTYPE_D));
|
||||
return (__istype(_wc, _CTYPE_Q));
|
||||
}
|
||||
|
||||
__DARWIN_WCTYPE_TOP_inline int
|
||||
iswgraph(wint_t _wc)
|
||||
iswrune(wint_t _wc)
|
||||
{
|
||||
return (__istype(_wc, _CTYPE_G));
|
||||
return (__istype(_wc, 0xFFFFFFF0L));
|
||||
}
|
||||
|
||||
__DARWIN_WCTYPE_TOP_inline int
|
||||
iswlower(wint_t _wc)
|
||||
iswspecial(wint_t _wc)
|
||||
{
|
||||
return (__istype(_wc, _CTYPE_L));
|
||||
}
|
||||
|
||||
__DARWIN_WCTYPE_TOP_inline int
|
||||
iswprint(wint_t _wc)
|
||||
{
|
||||
return (__istype(_wc, _CTYPE_R));
|
||||
}
|
||||
|
||||
__DARWIN_WCTYPE_TOP_inline int
|
||||
iswpunct(wint_t _wc)
|
||||
{
|
||||
return (__istype(_wc, _CTYPE_P));
|
||||
}
|
||||
|
||||
__DARWIN_WCTYPE_TOP_inline int
|
||||
iswspace(wint_t _wc)
|
||||
{
|
||||
return (__istype(_wc, _CTYPE_S));
|
||||
}
|
||||
|
||||
__DARWIN_WCTYPE_TOP_inline int
|
||||
iswupper(wint_t _wc)
|
||||
{
|
||||
return (__istype(_wc, _CTYPE_U));
|
||||
}
|
||||
|
||||
__DARWIN_WCTYPE_TOP_inline int
|
||||
iswxdigit(wint_t _wc)
|
||||
{
|
||||
return (__isctype(_wc, _CTYPE_X));
|
||||
}
|
||||
|
||||
__DARWIN_WCTYPE_TOP_inline wint_t
|
||||
towlower(wint_t _wc)
|
||||
{
|
||||
return (__tolower(_wc));
|
||||
}
|
||||
|
||||
__DARWIN_WCTYPE_TOP_inline wint_t
|
||||
towupper(wint_t _wc)
|
||||
{
|
||||
return (__toupper(_wc));
|
||||
return (__istype(_wc, _CTYPE_T));
|
||||
}
|
||||
#endif /* !_ANSI_SOURCE */
|
||||
|
||||
#else /* not using inlines */
|
||||
|
||||
__BEGIN_DECLS
|
||||
int iswalnum(wint_t);
|
||||
int iswalpha(wint_t);
|
||||
int iswcntrl(wint_t);
|
||||
int iswctype(wint_t, wctype_t);
|
||||
int iswdigit(wint_t);
|
||||
int iswgraph(wint_t);
|
||||
int iswlower(wint_t);
|
||||
int iswprint(wint_t);
|
||||
int iswpunct(wint_t);
|
||||
int iswspace(wint_t);
|
||||
int iswupper(wint_t);
|
||||
int iswxdigit(wint_t);
|
||||
wint_t towlower(wint_t);
|
||||
wint_t towupper(wint_t);
|
||||
int iswblank(wint_t);
|
||||
|
||||
#if !defined(_ANSI_SOURCE)
|
||||
wint_t iswascii(wint_t);
|
||||
wint_t iswhexnumber(wint_t);
|
||||
wint_t iswideogram(wint_t);
|
||||
wint_t iswnumber(wint_t);
|
||||
wint_t iswphonogram(wint_t);
|
||||
wint_t iswrune(wint_t);
|
||||
wint_t iswspecial(wint_t);
|
||||
#endif
|
||||
__END_DECLS
|
||||
|
||||
#endif /* using inlines */
|
||||
|
||||
__BEGIN_DECLS
|
||||
wctype_t
|
||||
wctype(const char *);
|
||||
#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
|
||||
wint_t nextwctype(wint_t, wctype_t);
|
||||
#endif
|
||||
wint_t towctrans(wint_t, wctrans_t);
|
||||
wctrans_t
|
||||
wctrans(const char *);
|
||||
__END_DECLS
|
||||
|
||||
#ifdef _USE_EXTENDED_LOCALES_
|
||||
#include <xlocale/__wctype.h>
|
||||
#endif /* _USE_EXTENDED_LOCALES_ */
|
||||
|
||||
#endif /* __WCTYPE_H_ */
|
||||
#endif /* _WCTYPE_H_ */
|
||||
|
||||
43
lib/libc/include/any-macos-any/_xlocale.h
vendored
43
lib/libc/include/any-macos-any/_xlocale.h
vendored
@@ -21,17 +21,46 @@
|
||||
* @APPLE_LICENSE_HEADER_END@
|
||||
*/
|
||||
|
||||
#ifndef __XLOCALE_H_
|
||||
#define __XLOCALE_H_
|
||||
#ifndef _XLOCALE_H_
|
||||
#define _XLOCALE_H_
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
struct _xlocale; /* forward reference */
|
||||
typedef struct _xlocale * locale_t;
|
||||
#ifndef _USE_EXTENDED_LOCALES_
|
||||
#define _USE_EXTENDED_LOCALES_
|
||||
#endif /* _USE_EXTENDED_LOCALES_ */
|
||||
|
||||
#include <_locale.h>
|
||||
#include <__xlocale.h>
|
||||
|
||||
#define LC_ALL_MASK ( LC_COLLATE_MASK \
|
||||
| LC_CTYPE_MASK \
|
||||
| LC_MESSAGES_MASK \
|
||||
| LC_MONETARY_MASK \
|
||||
| LC_NUMERIC_MASK \
|
||||
| LC_TIME_MASK )
|
||||
#define LC_COLLATE_MASK (1 << 0)
|
||||
#define LC_CTYPE_MASK (1 << 1)
|
||||
#define LC_MESSAGES_MASK (1 << 2)
|
||||
#define LC_MONETARY_MASK (1 << 3)
|
||||
#define LC_NUMERIC_MASK (1 << 4)
|
||||
#define LC_TIME_MASK (1 << 5)
|
||||
|
||||
#define _LC_NUM_MASK 6
|
||||
#define _LC_LAST_MASK (1 << (_LC_NUM_MASK - 1))
|
||||
|
||||
#define LC_GLOBAL_LOCALE ((locale_t)-1)
|
||||
#define LC_C_LOCALE ((locale_t)NULL)
|
||||
|
||||
__BEGIN_DECLS
|
||||
int ___mb_cur_max(void);
|
||||
int ___mb_cur_max_l(locale_t);
|
||||
extern const locale_t _c_locale;
|
||||
|
||||
locale_t duplocale(locale_t);
|
||||
int freelocale(locale_t);
|
||||
struct lconv * localeconv_l(locale_t);
|
||||
locale_t newlocale(int, __const char *, locale_t);
|
||||
__const char * querylocale(int, locale_t);
|
||||
locale_t uselocale(locale_t);
|
||||
__END_DECLS
|
||||
|
||||
#endif /* __XLOCALE_H_ */
|
||||
#endif /* _XLOCALE_H_ */
|
||||
|
||||
105
lib/libc/include/any-macos-any/arm/_endian.h
vendored
Normal file
105
lib/libc/include/any-macos-any/arm/_endian.h
vendored
Normal file
@@ -0,0 +1,105 @@
|
||||
/*
|
||||
* Copyright (c) 2004, 2006, 2023 Apple Computer, Inc. All rights reserved.
|
||||
*
|
||||
* @APPLE_OSREFERENCE_LICENSE_HEADER_START@
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original Code
|
||||
* as defined in and that are subject to the Apple Public Source License
|
||||
* Version 2.0 (the 'License'). You may not use this file except in
|
||||
* compliance with the License. The rights granted to you under the License
|
||||
* may not be used to create, or enable the creation or redistribution of,
|
||||
* unlawful or unlicensed copies of an Apple operating system, or to
|
||||
* circumvent, violate, or enable the circumvention or violation of, any
|
||||
* terms of an Apple operating system software license agreement.
|
||||
*
|
||||
* Please obtain a copy of the License at
|
||||
* http://www.opensource.apple.com/apsl/ and read it before using this file.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
|
||||
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
|
||||
* Please see the License for the specific language governing rights and
|
||||
* limitations under the License.
|
||||
*
|
||||
* @APPLE_OSREFERENCE_LICENSE_HEADER_END@
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 1995 NeXT Computer, Inc. All rights reserved.
|
||||
* Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved.
|
||||
*
|
||||
* @APPLE_OSREFERENCE_LICENSE_HEADER_START@
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original Code
|
||||
* as defined in and that are subject to the Apple Public Source License
|
||||
* Version 2.0 (the 'License'). You may not use this file except in
|
||||
* compliance with the License. The rights granted to you under the License
|
||||
* may not be used to create, or enable the creation or redistribution of,
|
||||
* unlawful or unlicensed copies of an Apple operating system, or to
|
||||
* circumvent, violate, or enable the circumvention or violation of, any
|
||||
* terms of an Apple operating system software license agreement.
|
||||
*
|
||||
* Please obtain a copy of the License at
|
||||
* http://www.opensource.apple.com/apsl/ and read it before using this file.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
|
||||
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
|
||||
* Please see the License for the specific language governing rights and
|
||||
* limitations under the License.
|
||||
*
|
||||
* @APPLE_OSREFERENCE_LICENSE_HEADER_END@
|
||||
*/
|
||||
/*
|
||||
* Copyright (c) 1987, 1991, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef _ARM___ENDIAN_H_
|
||||
#define _ARM___ENDIAN_H_
|
||||
|
||||
#if defined (__arm__) || defined (__arm64__)
|
||||
|
||||
#include <sys/__endian.h>
|
||||
|
||||
#define __DARWIN_BYTE_ORDER __DARWIN_LITTLE_ENDIAN
|
||||
|
||||
#if defined(KERNEL) || (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
|
||||
|
||||
#define BYTE_ORDER __DARWIN_BYTE_ORDER
|
||||
|
||||
#endif /* defined(KERNEL) || (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) */
|
||||
#endif /* defined (__arm__) || defined (__arm64__) */
|
||||
#endif /* !_ARM___ENDIAN_H_ */
|
||||
31
lib/libc/include/any-macos-any/arm/_types.h
vendored
31
lib/libc/include/any-macos-any/arm/_types.h
vendored
@@ -6,6 +6,19 @@
|
||||
|
||||
#if defined (__arm__) || defined (__arm64__)
|
||||
|
||||
#if defined(__has_feature) && __has_feature(modules)
|
||||
#define USE_CLANG_TYPES 1
|
||||
#else
|
||||
#define USE_CLANG_TYPES 0
|
||||
#endif
|
||||
|
||||
#if USE_CLANG_TYPES
|
||||
#include <sys/_types/_ptrdiff_t.h>
|
||||
#include <sys/_types/_size_t.h>
|
||||
#include <sys/_types/_va_list.h>
|
||||
#include <sys/_types/_wchar_t.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
* This header file contains integer types. It's intended to also contain
|
||||
* flotaing point and other arithmetic types, as needed, later.
|
||||
@@ -58,7 +71,9 @@ typedef union {
|
||||
|
||||
typedef __mbstate_t __darwin_mbstate_t; /* mbstate_t */
|
||||
|
||||
#if defined(__PTRDIFF_TYPE__)
|
||||
#if USE_CLANG_TYPES
|
||||
typedef ptrdiff_t __darwin_ptrdiff_t; /* ptr1 - ptr2 */
|
||||
#elif defined(__PTRDIFF_TYPE__)
|
||||
typedef __PTRDIFF_TYPE__ __darwin_ptrdiff_t; /* ptr1 - ptr2 */
|
||||
#elif defined(__LP64__)
|
||||
typedef long __darwin_ptrdiff_t; /* ptr1 - ptr2 */
|
||||
@@ -66,19 +81,25 @@ typedef long __darwin_ptrdiff_t; /* ptr1 - ptr2 */
|
||||
typedef int __darwin_ptrdiff_t; /* ptr1 - ptr2 */
|
||||
#endif /* __GNUC__ */
|
||||
|
||||
#if defined(__SIZE_TYPE__)
|
||||
#if USE_CLANG_TYPES
|
||||
typedef size_t __darwin_size_t; /* sizeof() */
|
||||
#elif defined(__SIZE_TYPE__)
|
||||
typedef __SIZE_TYPE__ __darwin_size_t; /* sizeof() */
|
||||
#else
|
||||
typedef unsigned long __darwin_size_t; /* sizeof() */
|
||||
#endif
|
||||
|
||||
#if (__GNUC__ > 2)
|
||||
#if USE_CLANG_TYPES
|
||||
typedef va_list __darwin_va_list; /* va_list */
|
||||
#elif (__GNUC__ > 2)
|
||||
typedef __builtin_va_list __darwin_va_list; /* va_list */
|
||||
#else
|
||||
typedef void * __darwin_va_list; /* va_list */
|
||||
#endif
|
||||
|
||||
#if defined(__WCHAR_TYPE__)
|
||||
#if USE_CLANG_TYPES
|
||||
typedef wchar_t __darwin_wchar_t; /* wchar_t */
|
||||
#elif defined(__WCHAR_TYPE__)
|
||||
typedef __WCHAR_TYPE__ __darwin_wchar_t; /* wchar_t */
|
||||
#else
|
||||
typedef __darwin_ct_rune_t __darwin_wchar_t; /* wchar_t */
|
||||
@@ -97,6 +118,8 @@ typedef __uint32_t __darwin_socklen_t; /* socklen_t (duh) */
|
||||
typedef long __darwin_ssize_t; /* byte count or error */
|
||||
typedef long __darwin_time_t; /* time() */
|
||||
|
||||
#undef USE_CLANG_TYPES
|
||||
|
||||
#endif /* defined (__arm__) || defined (__arm64__) */
|
||||
|
||||
#endif /* _BSD_ARM__TYPES_H_ */
|
||||
|
||||
18
lib/libc/include/any-macos-any/arm/endian.h
vendored
18
lib/libc/include/any-macos-any/arm/endian.h
vendored
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000-2007 Apple Inc. All rights reserved.
|
||||
* Copyright (c) 2000-2023 Apple Inc. All rights reserved.
|
||||
*/
|
||||
/*
|
||||
* Copyright 1995 NeXT Computer, Inc. All rights reserved.
|
||||
@@ -56,24 +56,8 @@
|
||||
#define _QUAD_HIGHWORD 1
|
||||
#define _QUAD_LOWWORD 0
|
||||
|
||||
/*
|
||||
* Definitions for byte order, according to byte significance from low
|
||||
* address to high.
|
||||
*/
|
||||
#define __DARWIN_LITTLE_ENDIAN 1234 /* LSB first: i386, vax */
|
||||
#define __DARWIN_BIG_ENDIAN 4321 /* MSB first: 68000, ibm, net */
|
||||
#define __DARWIN_PDP_ENDIAN 3412 /* LSB first in word, MSW first in long */
|
||||
|
||||
#define __DARWIN_BYTE_ORDER __DARWIN_LITTLE_ENDIAN
|
||||
|
||||
#if defined(KERNEL) || (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
|
||||
|
||||
#define LITTLE_ENDIAN __DARWIN_LITTLE_ENDIAN
|
||||
#define BIG_ENDIAN __DARWIN_BIG_ENDIAN
|
||||
#define PDP_ENDIAN __DARWIN_PDP_ENDIAN
|
||||
|
||||
#define BYTE_ORDER __DARWIN_BYTE_ORDER
|
||||
|
||||
#include <sys/_endian.h>
|
||||
|
||||
#endif /* defined(KERNEL) || (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) */
|
||||
|
||||
12
lib/libc/include/any-macos-any/arm/limits.h
vendored
12
lib/libc/include/any-macos-any/arm/limits.h
vendored
@@ -44,6 +44,12 @@
|
||||
#include <sys/cdefs.h>
|
||||
#include <arm/_limits.h>
|
||||
|
||||
#if defined(__has_feature) && __has_feature(modules)
|
||||
#define USE_CLANG_LIMITS 1
|
||||
#else
|
||||
#define USE_CLANG_LIMITS 0
|
||||
#endif
|
||||
|
||||
#undef MB_LEN_MAX
|
||||
#define MB_LEN_MAX 6 /* Allow 31 bit UTF2 */
|
||||
|
||||
@@ -59,7 +65,7 @@
|
||||
#include_next <limits.h>
|
||||
#endif /* __has_include_next */
|
||||
|
||||
#else
|
||||
#elif !USE_CLANG_LIMITS
|
||||
|
||||
#define CHAR_BIT 8 /* number of bits in a char */
|
||||
|
||||
@@ -102,7 +108,7 @@
|
||||
#define LLONG_MAX 0x7fffffffffffffffLL /* max signed long long */
|
||||
#define LLONG_MIN (-0x7fffffffffffffffLL-1) /* min signed long long */
|
||||
|
||||
#endif /* defined(__has_include) && __has_include(<__xnu_libcxx_sentinel.h>) */
|
||||
#endif /* !USE_CLANG_LIMITS */
|
||||
|
||||
#if !defined(_ANSI_SOURCE)
|
||||
#ifdef __LP64__
|
||||
@@ -123,6 +129,8 @@
|
||||
#endif /* (!_POSIX_C_SOURCE && !_XOPEN_SOURCE) || _DARWIN_C_SOURCE */
|
||||
#endif /* !_ANSI_SOURCE */
|
||||
|
||||
#undef USE_CLANG_LIMITS
|
||||
|
||||
#endif /* defined (__arm__) || defined (__arm64__) */
|
||||
|
||||
#endif /* _ARM_LIMITS_H_ */
|
||||
|
||||
1
lib/libc/include/any-macos-any/arm/types.h
vendored
1
lib/libc/include/any-macos-any/arm/types.h
vendored
@@ -91,6 +91,7 @@ typedef int32_t user_time_t;
|
||||
typedef int64_t user_off_t;
|
||||
#endif
|
||||
|
||||
|
||||
#define USER_ADDR_NULL ((user_addr_t) 0)
|
||||
#define CAST_USER_ADDR_T(a_ptr) ((user_addr_t)((uintptr_t)(a_ptr)))
|
||||
|
||||
|
||||
39
lib/libc/include/any-macos-any/assert.h
vendored
39
lib/libc/include/any-macos-any/assert.h
vendored
@@ -50,12 +50,13 @@
|
||||
*/
|
||||
|
||||
#undef assert
|
||||
#undef __assert
|
||||
|
||||
#ifdef NDEBUG
|
||||
#define assert(e) ((void)0)
|
||||
#else
|
||||
|
||||
#include <_assert.h>
|
||||
|
||||
#ifdef __FILE_NAME__
|
||||
#define __ASSERT_FILE_NAME __FILE_NAME__
|
||||
#else /* __FILE_NAME__ */
|
||||
@@ -64,36 +65,11 @@
|
||||
|
||||
#ifndef __GNUC__
|
||||
|
||||
__BEGIN_DECLS
|
||||
#ifndef __cplusplus
|
||||
void abort(void) __dead2 __cold;
|
||||
#endif /* !__cplusplus */
|
||||
int printf(const char * __restrict, ...);
|
||||
__END_DECLS
|
||||
|
||||
#define assert(e) \
|
||||
((void) ((e) ? ((void)0) : __assert (#e, __ASSERT_FILE_NAME, __LINE__)))
|
||||
#define __assert(e, file, line) \
|
||||
((void)printf ("%s:%d: failed assertion `%s'\n", file, line, e), abort())
|
||||
|
||||
#else /* __GNUC__ */
|
||||
|
||||
__BEGIN_DECLS
|
||||
void __assert_rtn(const char *, const char *, int, const char *) __dead2 __cold __disable_tail_calls;
|
||||
#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && ((__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__-0) < 1070)
|
||||
void __eprintf(const char *, const char *, unsigned, const char *) __dead2 __cold;
|
||||
#endif
|
||||
__END_DECLS
|
||||
|
||||
#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && ((__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__-0) < 1070)
|
||||
#define __assert(e, file, line) \
|
||||
__eprintf ("%s:%d: failed assertion `%s'\n", file, line, e)
|
||||
#else
|
||||
/* 8462256: modified __assert_rtn() replaces deprecated __eprintf() */
|
||||
#define __assert(e, file, line) \
|
||||
__assert_rtn ((const char *)-1L, file, line, e)
|
||||
#endif
|
||||
|
||||
#if __DARWIN_UNIX03
|
||||
#define assert(e) \
|
||||
(__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __ASSERT_FILE_NAME, __LINE__, #e) : (void)0)
|
||||
@@ -105,13 +81,4 @@ __END_DECLS
|
||||
#endif /* __GNUC__ */
|
||||
#endif /* NDEBUG */
|
||||
|
||||
#ifndef _ASSERT_H_
|
||||
#define _ASSERT_H_
|
||||
|
||||
#ifndef __cplusplus
|
||||
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
|
||||
#define static_assert _Static_assert
|
||||
#endif /* __STDC_VERSION__ */
|
||||
#endif /* !__cplusplus */
|
||||
|
||||
#endif /* _ASSERT_H_ */
|
||||
#include <_static_assert.h>
|
||||
|
||||
6
lib/libc/include/any-macos-any/copyfile.h
vendored
6
lib/libc/include/any-macos-any/copyfile.h
vendored
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2021 Apple, Inc. All rights reserved.
|
||||
* Copyright (c) 2004-2023 Apple, Inc. All rights reserved.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_START@
|
||||
*
|
||||
@@ -79,6 +79,10 @@ typedef int (*copyfile_callback_t)(int, int, copyfile_state_t, const char *__uns
|
||||
#define COPYFILE_STATE_DST_BSIZE 12
|
||||
#define COPYFILE_STATE_BSIZE 13
|
||||
#define COPYFILE_STATE_FORBID_CROSS_MOUNT 14
|
||||
#define COPYFILE_STATE_NOCPROTECT 15
|
||||
#define COPYFILE_STATE_PRESERVE_SUID 16
|
||||
#define COPYFILE_STATE_RECURSIVE_SRC_FTSENT 17
|
||||
#define COPYFILE_STATE_FORBID_DST_EXISTING_SYMLINKS 18
|
||||
|
||||
|
||||
#define COPYFILE_DISABLE_VAR "COPYFILE_DISABLE"
|
||||
|
||||
5
lib/libc/include/any-macos-any/ctype.h
vendored
5
lib/libc/include/any-macos-any/ctype.h
vendored
@@ -63,13 +63,8 @@
|
||||
* @(#)ctype.h 8.4 (Berkeley) 1/21/94
|
||||
*/
|
||||
|
||||
#ifndef _CTYPE_H_
|
||||
#define _CTYPE_H_
|
||||
|
||||
#include <_ctype.h>
|
||||
|
||||
#ifdef _USE_EXTENDED_LOCALES_
|
||||
#include <xlocale/_ctype.h>
|
||||
#endif /* _USE_EXTENDED_LOCALES_ */
|
||||
|
||||
#endif /* !_CTYPE_H_ */
|
||||
|
||||
65
lib/libc/include/any-macos-any/dispatch/queue.h
vendored
65
lib/libc/include/any-macos-any/dispatch/queue.h
vendored
@@ -99,7 +99,6 @@ DISPATCH_DECL_FACTORY_CLASS_SWIFT(dispatch_queue, DispatchQueue);
|
||||
* Calls to dispatch_suspend(), dispatch_resume(), dispatch_set_context(), etc.,
|
||||
* will have no effect when used with queues of this type.
|
||||
*/
|
||||
API_AVAILABLE(macos(10.14), ios(12.0), tvos(12.0), watchos(5.0))
|
||||
DISPATCH_DECL_SUBCLASS(dispatch_queue_global, dispatch_queue);
|
||||
|
||||
/*!
|
||||
@@ -169,7 +168,6 @@ DISPATCH_DECL_SERIAL_EXECUTOR_SWIFT(dispatch_queue_serial, DispatchSerialQueue);
|
||||
* dispatch_suspend(), dispatch_resume(), dispatch_set_context(), etc., will
|
||||
* have no effect when used on the main queue.
|
||||
*/
|
||||
API_AVAILABLE(macos(10.14), ios(12.0), tvos(12.0), watchos(5.0))
|
||||
DISPATCH_DECL_SUBCLASS(dispatch_queue_main, dispatch_queue_serial);
|
||||
|
||||
/*!
|
||||
@@ -1738,6 +1736,69 @@ dispatch_assert_queue_not(dispatch_queue_t queue)
|
||||
#define dispatch_assert_queue_not_debug(q) dispatch_assert_queue_not(q)
|
||||
#endif
|
||||
|
||||
/* @function dispatch_allow_send_signals
|
||||
*
|
||||
* @discussion
|
||||
* This function provides the calling process an ability to send signals to
|
||||
* it's pthread worker threads created to service incoming work to dispatch,
|
||||
* including those which were already created prior to this function call
|
||||
* and those who may be created in the future. After a call to this function
|
||||
* returns successfully, this ability is retained for the lifetime of the
|
||||
* calling process.
|
||||
* Regular UNIX calls still need to be used to manipulate signal mask of
|
||||
* each individual pthread worker thread to allow delivery of a specific
|
||||
* signal to that thread.
|
||||
*
|
||||
* @param preserve_signum
|
||||
* Dispatch and its kernel runtime subsystem manages a pool of pthread
|
||||
* worker threads which are reused for handling incoming work to dispatch.
|
||||
* The signal number specified here is used internally by this subsystem to
|
||||
* preserve sigmask of the pthread worker threads across their reuse.
|
||||
*
|
||||
* In other words, if a pthread worker thread unblocks delivery of
|
||||
* @preserve_signum using regular UNIX calls after a call to this
|
||||
* function using the same @preserve_signum returns successfully,
|
||||
* that @preserve_signum remains unblocked across that thread's
|
||||
* reuse until it is further modified by regular UNIX calls.
|
||||
* Therefore, it avoids the need to call regular UNIX calls to
|
||||
* unblock delivery of @preserve_signum every time that thread
|
||||
* is reused. The specific signal @preserve_signum can be sent
|
||||
* to that specific pthread worker thread using pthread_kill().
|
||||
*
|
||||
* The following code illustrates an expected usage of this API.
|
||||
*
|
||||
* <code>
|
||||
*
|
||||
* // Enable sending signals to dispatch pthread worker threads.
|
||||
* int ret = dispatch_allow_send_signals(sig);
|
||||
* // Validate ret.
|
||||
*
|
||||
* dispatch_async(q, ^{
|
||||
* // Unblock sig for this worker thread if not already done.
|
||||
* // Such a state could be saved in TSD or globally.
|
||||
* mask = sigmask(sig);
|
||||
* pthread_sigmask(SIG_UNBLOCK, &mask, NULL);
|
||||
* // busy with some work. Can receive signal sig.
|
||||
* // If this worker thread is re-used later, it does not
|
||||
* // not need to call pthread_sigmask again to unblock delivery
|
||||
* // of signal sig.
|
||||
* }
|
||||
*
|
||||
* This function returns 0 upon success and -1 with an errno otherwise.
|
||||
* Possible error codes are as below :
|
||||
*
|
||||
* EINVAL : @preserve_signum is prohibited and is not allowed to be preserved
|
||||
* across the thread's reuse.
|
||||
* ENOTSUP : The underlying kernel does not support this functionality.
|
||||
*
|
||||
* </code>
|
||||
*/
|
||||
API_AVAILABLE(macos(14.4), ios(17.4), visionos(1.1))
|
||||
API_UNAVAILABLE(tvos, watchos, driverkit)
|
||||
DISPATCH_EXPORT
|
||||
int
|
||||
dispatch_allow_send_signals(int preserve_signum);
|
||||
|
||||
__END_DECLS
|
||||
|
||||
DISPATCH_ASSUME_ABI_SINGLE_END
|
||||
|
||||
@@ -145,6 +145,10 @@ dispatch_workloop_set_autorelease_frequency(dispatch_workloop_t workloop,
|
||||
* The worker thread will be a member of the specified os_workgroup_t while executing
|
||||
* work items submitted to the workloop.
|
||||
*
|
||||
* Using both dispatch_workloop_set_scheduler_priority() and
|
||||
* dispatch_workloop_set_os_workgroup() will prefer scheduling policies
|
||||
* from the workgroup, if they exist.
|
||||
*
|
||||
* @param workloop
|
||||
* The dispatch workloop to modify.
|
||||
*
|
||||
|
||||
11
lib/libc/include/any-macos-any/float.h
vendored
11
lib/libc/include/any-macos-any/float.h
vendored
@@ -22,6 +22,15 @@
|
||||
#ifndef __FLOAT_H
|
||||
#define __FLOAT_H
|
||||
|
||||
#if !defined(__has_feature) || !__has_feature(modules)
|
||||
/* clang's float.h comes before this header in the search order. It
|
||||
* will include this header first, undef all of these macros, and then
|
||||
* redeclare them. That doesn't work when the two headers are in
|
||||
* different clang modules. The only way to avoid redeclaration errors
|
||||
* is to not declare the macros here, and let clang's float.h handle
|
||||
* them.
|
||||
*/
|
||||
|
||||
/* Undefine anything that we'll be redefining below. */
|
||||
#undef FLT_EVAL_METHOD
|
||||
#undef FLT_ROUNDS
|
||||
@@ -137,4 +146,6 @@
|
||||
# define LDBL_DECIMAL_DIG __LDBL_DECIMAL_DIG__
|
||||
#endif
|
||||
|
||||
#endif /* !__has_feature(modules) */
|
||||
|
||||
#endif /* __FLOAT_H */
|
||||
|
||||
15
lib/libc/include/any-macos-any/hfs/hfs_format.h
vendored
15
lib/libc/include/any-macos-any/hfs/hfs_format.h
vendored
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000-2015 Apple Inc. All rights reserved.
|
||||
* Copyright (c) 2000-2023 Apple Inc. All rights reserved.
|
||||
*
|
||||
* @APPLE_OSREFERENCE_LICENSE_HEADER_START@
|
||||
*
|
||||
@@ -37,7 +37,7 @@
|
||||
*
|
||||
* This file describes the on-disk format for HFS and HFS Plus volumes.
|
||||
*
|
||||
* Note: Starting 10.9, definition of struct HFSUniStr255 exists in hfs_unitstr.h
|
||||
* Note: Starting with MacOS 10.9, definition of struct HFSUniStr255 exists in hfs_unistr.h
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -373,10 +373,12 @@ enum {
|
||||
kHFSFastDevCandidateMask = 0x0400,
|
||||
|
||||
kHFSAutoCandidateBit = 0x000b, /* this item was automatically marked as a fast-dev candidate by the kernel */
|
||||
kHFSAutoCandidateMask = 0x0800
|
||||
kHFSAutoCandidateMask = 0x0800,
|
||||
|
||||
// There are only 4 flag bits remaining: 0x1000, 0x2000, 0x4000, 0x8000
|
||||
kHFSCatExpandedTimesBit = 0x000c, /* this item has expanded timestamps */
|
||||
kHFSCatExpandedTimesMask = 0x1000
|
||||
|
||||
// There are only 3 flag bits remaining: 0x2000, 0x4000, 0x8000
|
||||
};
|
||||
|
||||
|
||||
@@ -600,6 +602,7 @@ enum {
|
||||
*/
|
||||
kHFSUnusedNodeFixBit = 31, /* Unused nodes in the Catalog B-tree have been zero-filled. See Radar #6947811. */
|
||||
kHFSContentProtectionBit = 30, /* Volume has per-file content protection */
|
||||
kHFSExpandedTimesBit = 29, /* Volume has expanded / non-MacOS native timestamps */
|
||||
|
||||
/*** Keep these in sync with the bits above ! ****/
|
||||
kHFSVolumeHardwareLockMask = 0x00000080,
|
||||
@@ -614,6 +617,7 @@ enum {
|
||||
|
||||
/* Bits 16-31 are allocated from high to low */
|
||||
|
||||
kHFSExpandedTimesMask = 0x20000000,
|
||||
kHFSContentProtectionMask = 0x40000000,
|
||||
kHFSUnusedNodeFixMask = 0x80000000,
|
||||
|
||||
@@ -621,7 +625,8 @@ enum {
|
||||
};
|
||||
|
||||
enum {
|
||||
kHFSUnusedNodesFixDate = 0xc5ef2480 /* March 25, 2009 */
|
||||
kHFSUnusedNodesFixDate = 0xc5ef2480, /* March 25, 2009 (aka 3320784000) */
|
||||
kHFSUnusedNodesFixExpandedDate = 0x49c97400 /* March 25, 2009 (akai 1237939200) - BSD epoch-relative */
|
||||
};
|
||||
|
||||
/* HFS Master Directory Block - 162 bytes */
|
||||
|
||||
105
lib/libc/include/any-macos-any/i386/_endian.h
vendored
Normal file
105
lib/libc/include/any-macos-any/i386/_endian.h
vendored
Normal file
@@ -0,0 +1,105 @@
|
||||
/*
|
||||
* Copyright (c) 2004, 2006, 2023 Apple Computer, Inc. All rights reserved.
|
||||
*
|
||||
* @APPLE_OSREFERENCE_LICENSE_HEADER_START@
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original Code
|
||||
* as defined in and that are subject to the Apple Public Source License
|
||||
* Version 2.0 (the 'License'). You may not use this file except in
|
||||
* compliance with the License. The rights granted to you under the License
|
||||
* may not be used to create, or enable the creation or redistribution of,
|
||||
* unlawful or unlicensed copies of an Apple operating system, or to
|
||||
* circumvent, violate, or enable the circumvention or violation of, any
|
||||
* terms of an Apple operating system software license agreement.
|
||||
*
|
||||
* Please obtain a copy of the License at
|
||||
* http://www.opensource.apple.com/apsl/ and read it before using this file.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
|
||||
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
|
||||
* Please see the License for the specific language governing rights and
|
||||
* limitations under the License.
|
||||
*
|
||||
* @APPLE_OSREFERENCE_LICENSE_HEADER_END@
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 1995 NeXT Computer, Inc. All rights reserved.
|
||||
* Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved.
|
||||
*
|
||||
* @APPLE_OSREFERENCE_LICENSE_HEADER_START@
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original Code
|
||||
* as defined in and that are subject to the Apple Public Source License
|
||||
* Version 2.0 (the 'License'). You may not use this file except in
|
||||
* compliance with the License. The rights granted to you under the License
|
||||
* may not be used to create, or enable the creation or redistribution of,
|
||||
* unlawful or unlicensed copies of an Apple operating system, or to
|
||||
* circumvent, violate, or enable the circumvention or violation of, any
|
||||
* terms of an Apple operating system software license agreement.
|
||||
*
|
||||
* Please obtain a copy of the License at
|
||||
* http://www.opensource.apple.com/apsl/ and read it before using this file.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
|
||||
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
|
||||
* Please see the License for the specific language governing rights and
|
||||
* limitations under the License.
|
||||
*
|
||||
* @APPLE_OSREFERENCE_LICENSE_HEADER_END@
|
||||
*/
|
||||
/*
|
||||
* Copyright (c) 1987, 1991, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef _I386___ENDIAN_H_
|
||||
#define _I386___ENDIAN_H_
|
||||
|
||||
#if defined (__i386__) || defined (__x86_64__)
|
||||
|
||||
#include <sys/__endian.h>
|
||||
|
||||
#define __DARWIN_BYTE_ORDER __DARWIN_LITTLE_ENDIAN
|
||||
|
||||
#if defined(KERNEL) || (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
|
||||
|
||||
#define BYTE_ORDER __DARWIN_BYTE_ORDER
|
||||
|
||||
#endif /* defined(KERNEL) || (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) */
|
||||
#endif /* defined (__i386__) || defined (__x86_64__) */
|
||||
#endif /* !_I386___ENDIAN_H_ */
|
||||
31
lib/libc/include/any-macos-any/i386/_types.h
vendored
31
lib/libc/include/any-macos-any/i386/_types.h
vendored
@@ -30,6 +30,19 @@
|
||||
|
||||
#if defined (__i386__) || defined (__x86_64__)
|
||||
|
||||
#if defined(__has_feature) && __has_feature(modules)
|
||||
#define USE_CLANG_TYPES 1
|
||||
#else
|
||||
#define USE_CLANG_TYPES 0
|
||||
#endif
|
||||
|
||||
#if USE_CLANG_TYPES
|
||||
#include <sys/_types/_ptrdiff_t.h>
|
||||
#include <sys/_types/_size_t.h>
|
||||
#include <sys/_types/_va_list.h>
|
||||
#include <sys/_types/_wchar_t.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
* This header file contains integer types. It's intended to also contain
|
||||
* flotaing point and other arithmetic types, as needed, later.
|
||||
@@ -82,7 +95,9 @@ typedef union {
|
||||
|
||||
typedef __mbstate_t __darwin_mbstate_t; /* mbstate_t */
|
||||
|
||||
#if defined(__PTRDIFF_TYPE__)
|
||||
#if USE_CLANG_TYPES
|
||||
typedef ptrdiff_t __darwin_ptrdiff_t; /* ptr1 - ptr2 */
|
||||
#elif defined(__PTRDIFF_TYPE__)
|
||||
typedef __PTRDIFF_TYPE__ __darwin_ptrdiff_t; /* ptr1 - ptr2 */
|
||||
#elif defined(__LP64__)
|
||||
typedef long __darwin_ptrdiff_t; /* ptr1 - ptr2 */
|
||||
@@ -90,19 +105,25 @@ typedef long __darwin_ptrdiff_t; /* ptr1 - ptr2 */
|
||||
typedef int __darwin_ptrdiff_t; /* ptr1 - ptr2 */
|
||||
#endif /* __GNUC__ */
|
||||
|
||||
#if defined(__SIZE_TYPE__)
|
||||
#if USE_CLANG_TYPES
|
||||
typedef size_t __darwin_size_t; /* sizeof() */
|
||||
#elif defined(__SIZE_TYPE__)
|
||||
typedef __SIZE_TYPE__ __darwin_size_t; /* sizeof() */
|
||||
#else
|
||||
typedef unsigned long __darwin_size_t; /* sizeof() */
|
||||
#endif
|
||||
|
||||
#if (__GNUC__ > 2)
|
||||
#if USE_CLANG_TYPES
|
||||
typedef va_list __darwin_va_list; /* va_list */
|
||||
#elif (__GNUC__ > 2)
|
||||
typedef __builtin_va_list __darwin_va_list; /* va_list */
|
||||
#else
|
||||
typedef void * __darwin_va_list; /* va_list */
|
||||
#endif
|
||||
|
||||
#if defined(__WCHAR_TYPE__)
|
||||
#if USE_CLANG_TYPES
|
||||
typedef wchar_t __darwin_wchar_t; /* wchar_t */
|
||||
#elif defined(__WCHAR_TYPE__)
|
||||
typedef __WCHAR_TYPE__ __darwin_wchar_t; /* wchar_t */
|
||||
#else
|
||||
typedef __darwin_ct_rune_t __darwin_wchar_t; /* wchar_t */
|
||||
@@ -121,6 +142,8 @@ typedef __uint32_t __darwin_socklen_t; /* socklen_t (duh) */
|
||||
typedef long __darwin_ssize_t; /* byte count or error */
|
||||
typedef long __darwin_time_t; /* time() */
|
||||
|
||||
#undef USE_CLANG_TYPES
|
||||
|
||||
#endif /* defined (__i386__) || defined (__x86_64__) */
|
||||
|
||||
#endif /* _BSD_I386__TYPES_H_ */
|
||||
|
||||
18
lib/libc/include/any-macos-any/i386/endian.h
vendored
18
lib/libc/include/any-macos-any/i386/endian.h
vendored
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved.
|
||||
* Copyright (c) 2000-2023 Apple Computer, Inc. All rights reserved.
|
||||
*
|
||||
* @APPLE_OSREFERENCE_LICENSE_HEADER_START@
|
||||
*
|
||||
@@ -80,24 +80,8 @@
|
||||
#define _QUAD_HIGHWORD 1
|
||||
#define _QUAD_LOWWORD 0
|
||||
|
||||
/*
|
||||
* Definitions for byte order, according to byte significance from low
|
||||
* address to high.
|
||||
*/
|
||||
#define __DARWIN_LITTLE_ENDIAN 1234 /* LSB first: i386, vax */
|
||||
#define __DARWIN_BIG_ENDIAN 4321 /* MSB first: 68000, ibm, net */
|
||||
#define __DARWIN_PDP_ENDIAN 3412 /* LSB first in word, MSW first in long */
|
||||
|
||||
#define __DARWIN_BYTE_ORDER __DARWIN_LITTLE_ENDIAN
|
||||
|
||||
#if defined(KERNEL) || (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
|
||||
|
||||
#define LITTLE_ENDIAN __DARWIN_LITTLE_ENDIAN
|
||||
#define BIG_ENDIAN __DARWIN_BIG_ENDIAN
|
||||
#define PDP_ENDIAN __DARWIN_PDP_ENDIAN
|
||||
|
||||
#define BYTE_ORDER __DARWIN_BYTE_ORDER
|
||||
|
||||
#include <sys/_endian.h>
|
||||
|
||||
#endif /* defined(KERNEL) || (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) */
|
||||
|
||||
12
lib/libc/include/any-macos-any/i386/limits.h
vendored
12
lib/libc/include/any-macos-any/i386/limits.h
vendored
@@ -41,6 +41,12 @@
|
||||
#include <sys/cdefs.h>
|
||||
#include <i386/_limits.h>
|
||||
|
||||
#if defined(__has_feature) && __has_feature(modules)
|
||||
#define USE_CLANG_LIMITS 1
|
||||
#else
|
||||
#define USE_CLANG_LIMITS 0
|
||||
#endif
|
||||
|
||||
#undef MB_LEN_MAX
|
||||
#define MB_LEN_MAX 6 /* Allow 31 bit UTF2 */
|
||||
|
||||
@@ -56,7 +62,7 @@
|
||||
#include_next <limits.h>
|
||||
#endif /* __has_include_next */
|
||||
|
||||
#else
|
||||
#elif !USE_CLANG_LIMITS
|
||||
|
||||
#define CHAR_BIT 8 /* number of bits in a char */
|
||||
|
||||
@@ -99,7 +105,7 @@
|
||||
#define LLONG_MAX 0x7fffffffffffffffLL /* max signed long long */
|
||||
#define LLONG_MIN (-0x7fffffffffffffffLL-1) /* min signed long long */
|
||||
|
||||
#endif /* defined(__has_include) && __has_include(<__xnu_libcxx_sentinel.h>) */
|
||||
#endif /* !USE_CLANG_LIMITS */
|
||||
|
||||
#if !defined(_ANSI_SOURCE)
|
||||
#ifdef __LP64__
|
||||
@@ -120,6 +126,8 @@
|
||||
#endif /* (!_POSIX_C_SOURCE && !_XOPEN_SOURCE) || _DARWIN_C_SOURCE */
|
||||
#endif /* !_ANSI_SOURCE */
|
||||
|
||||
#undef USE_CLANG_LIMITS
|
||||
|
||||
#endif /* defined (__i386__) || defined (__x86_64__) */
|
||||
|
||||
#endif /* _I386_LIMITS_H_ */
|
||||
|
||||
2
lib/libc/include/any-macos-any/i386/types.h
vendored
2
lib/libc/include/any-macos-any/i386/types.h
vendored
@@ -104,6 +104,8 @@ typedef int64_t user_long_t;
|
||||
typedef u_int64_t user_ulong_t;
|
||||
typedef int64_t user_time_t;
|
||||
typedef int64_t user_off_t;
|
||||
|
||||
|
||||
#define USER_ADDR_NULL ((user_addr_t) 0)
|
||||
#define CAST_USER_ADDR_T(a_ptr) ((user_addr_t)((uintptr_t)(a_ptr)))
|
||||
|
||||
|
||||
266
lib/libc/include/any-macos-any/inttypes.h
vendored
266
lib/libc/include/any-macos-any/inttypes.h
vendored
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000-2004, 2013 Apple Inc. All rights reserved.
|
||||
* Copyright (c) 2000-2004, 2013, 2023 Apple Inc. All rights reserved.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_START@
|
||||
*
|
||||
@@ -28,270 +28,8 @@
|
||||
* and their ilk.
|
||||
*/
|
||||
|
||||
#if !defined(_INTTYPES_H_)
|
||||
#define _INTTYPES_H_
|
||||
|
||||
# define __PRI_8_LENGTH_MODIFIER__ "hh"
|
||||
# define __PRI_64_LENGTH_MODIFIER__ "ll"
|
||||
# define __SCN_64_LENGTH_MODIFIER__ "ll"
|
||||
# define __PRI_MAX_LENGTH_MODIFIER__ "j"
|
||||
# define __SCN_MAX_LENGTH_MODIFIER__ "j"
|
||||
|
||||
# define PRId8 __PRI_8_LENGTH_MODIFIER__ "d"
|
||||
# define PRIi8 __PRI_8_LENGTH_MODIFIER__ "i"
|
||||
# define PRIo8 __PRI_8_LENGTH_MODIFIER__ "o"
|
||||
# define PRIu8 __PRI_8_LENGTH_MODIFIER__ "u"
|
||||
# define PRIx8 __PRI_8_LENGTH_MODIFIER__ "x"
|
||||
# define PRIX8 __PRI_8_LENGTH_MODIFIER__ "X"
|
||||
|
||||
# define PRId16 "hd"
|
||||
# define PRIi16 "hi"
|
||||
# define PRIo16 "ho"
|
||||
# define PRIu16 "hu"
|
||||
# define PRIx16 "hx"
|
||||
# define PRIX16 "hX"
|
||||
|
||||
# define PRId32 "d"
|
||||
# define PRIi32 "i"
|
||||
# define PRIo32 "o"
|
||||
# define PRIu32 "u"
|
||||
# define PRIx32 "x"
|
||||
# define PRIX32 "X"
|
||||
|
||||
# define PRId64 __PRI_64_LENGTH_MODIFIER__ "d"
|
||||
# define PRIi64 __PRI_64_LENGTH_MODIFIER__ "i"
|
||||
# define PRIo64 __PRI_64_LENGTH_MODIFIER__ "o"
|
||||
# define PRIu64 __PRI_64_LENGTH_MODIFIER__ "u"
|
||||
# define PRIx64 __PRI_64_LENGTH_MODIFIER__ "x"
|
||||
# define PRIX64 __PRI_64_LENGTH_MODIFIER__ "X"
|
||||
|
||||
# define PRIdLEAST8 PRId8
|
||||
# define PRIiLEAST8 PRIi8
|
||||
# define PRIoLEAST8 PRIo8
|
||||
# define PRIuLEAST8 PRIu8
|
||||
# define PRIxLEAST8 PRIx8
|
||||
# define PRIXLEAST8 PRIX8
|
||||
|
||||
# define PRIdLEAST16 PRId16
|
||||
# define PRIiLEAST16 PRIi16
|
||||
# define PRIoLEAST16 PRIo16
|
||||
# define PRIuLEAST16 PRIu16
|
||||
# define PRIxLEAST16 PRIx16
|
||||
# define PRIXLEAST16 PRIX16
|
||||
|
||||
# define PRIdLEAST32 PRId32
|
||||
# define PRIiLEAST32 PRIi32
|
||||
# define PRIoLEAST32 PRIo32
|
||||
# define PRIuLEAST32 PRIu32
|
||||
# define PRIxLEAST32 PRIx32
|
||||
# define PRIXLEAST32 PRIX32
|
||||
|
||||
# define PRIdLEAST64 PRId64
|
||||
# define PRIiLEAST64 PRIi64
|
||||
# define PRIoLEAST64 PRIo64
|
||||
# define PRIuLEAST64 PRIu64
|
||||
# define PRIxLEAST64 PRIx64
|
||||
# define PRIXLEAST64 PRIX64
|
||||
|
||||
# define PRIdFAST8 PRId8
|
||||
# define PRIiFAST8 PRIi8
|
||||
# define PRIoFAST8 PRIo8
|
||||
# define PRIuFAST8 PRIu8
|
||||
# define PRIxFAST8 PRIx8
|
||||
# define PRIXFAST8 PRIX8
|
||||
|
||||
# define PRIdFAST16 PRId16
|
||||
# define PRIiFAST16 PRIi16
|
||||
# define PRIoFAST16 PRIo16
|
||||
# define PRIuFAST16 PRIu16
|
||||
# define PRIxFAST16 PRIx16
|
||||
# define PRIXFAST16 PRIX16
|
||||
|
||||
# define PRIdFAST32 PRId32
|
||||
# define PRIiFAST32 PRIi32
|
||||
# define PRIoFAST32 PRIo32
|
||||
# define PRIuFAST32 PRIu32
|
||||
# define PRIxFAST32 PRIx32
|
||||
# define PRIXFAST32 PRIX32
|
||||
|
||||
# define PRIdFAST64 PRId64
|
||||
# define PRIiFAST64 PRIi64
|
||||
# define PRIoFAST64 PRIo64
|
||||
# define PRIuFAST64 PRIu64
|
||||
# define PRIxFAST64 PRIx64
|
||||
# define PRIXFAST64 PRIX64
|
||||
|
||||
/* int32_t is 'int', but intptr_t is 'long'. */
|
||||
# define PRIdPTR "ld"
|
||||
# define PRIiPTR "li"
|
||||
# define PRIoPTR "lo"
|
||||
# define PRIuPTR "lu"
|
||||
# define PRIxPTR "lx"
|
||||
# define PRIXPTR "lX"
|
||||
|
||||
# define PRIdMAX __PRI_MAX_LENGTH_MODIFIER__ "d"
|
||||
# define PRIiMAX __PRI_MAX_LENGTH_MODIFIER__ "i"
|
||||
# define PRIoMAX __PRI_MAX_LENGTH_MODIFIER__ "o"
|
||||
# define PRIuMAX __PRI_MAX_LENGTH_MODIFIER__ "u"
|
||||
# define PRIxMAX __PRI_MAX_LENGTH_MODIFIER__ "x"
|
||||
# define PRIXMAX __PRI_MAX_LENGTH_MODIFIER__ "X"
|
||||
|
||||
# define SCNd8 __PRI_8_LENGTH_MODIFIER__ "d"
|
||||
# define SCNi8 __PRI_8_LENGTH_MODIFIER__ "i"
|
||||
# define SCNo8 __PRI_8_LENGTH_MODIFIER__ "o"
|
||||
# define SCNu8 __PRI_8_LENGTH_MODIFIER__ "u"
|
||||
# define SCNx8 __PRI_8_LENGTH_MODIFIER__ "x"
|
||||
|
||||
# define SCNd16 "hd"
|
||||
# define SCNi16 "hi"
|
||||
# define SCNo16 "ho"
|
||||
# define SCNu16 "hu"
|
||||
# define SCNx16 "hx"
|
||||
|
||||
# define SCNd32 "d"
|
||||
# define SCNi32 "i"
|
||||
# define SCNo32 "o"
|
||||
# define SCNu32 "u"
|
||||
# define SCNx32 "x"
|
||||
|
||||
# define SCNd64 __SCN_64_LENGTH_MODIFIER__ "d"
|
||||
# define SCNi64 __SCN_64_LENGTH_MODIFIER__ "i"
|
||||
# define SCNo64 __SCN_64_LENGTH_MODIFIER__ "o"
|
||||
# define SCNu64 __SCN_64_LENGTH_MODIFIER__ "u"
|
||||
# define SCNx64 __SCN_64_LENGTH_MODIFIER__ "x"
|
||||
|
||||
# define SCNdLEAST8 SCNd8
|
||||
# define SCNiLEAST8 SCNi8
|
||||
# define SCNoLEAST8 SCNo8
|
||||
# define SCNuLEAST8 SCNu8
|
||||
# define SCNxLEAST8 SCNx8
|
||||
|
||||
# define SCNdLEAST16 SCNd16
|
||||
# define SCNiLEAST16 SCNi16
|
||||
# define SCNoLEAST16 SCNo16
|
||||
# define SCNuLEAST16 SCNu16
|
||||
# define SCNxLEAST16 SCNx16
|
||||
|
||||
# define SCNdLEAST32 SCNd32
|
||||
# define SCNiLEAST32 SCNi32
|
||||
# define SCNoLEAST32 SCNo32
|
||||
# define SCNuLEAST32 SCNu32
|
||||
# define SCNxLEAST32 SCNx32
|
||||
|
||||
# define SCNdLEAST64 SCNd64
|
||||
# define SCNiLEAST64 SCNi64
|
||||
# define SCNoLEAST64 SCNo64
|
||||
# define SCNuLEAST64 SCNu64
|
||||
# define SCNxLEAST64 SCNx64
|
||||
|
||||
# define SCNdFAST8 SCNd8
|
||||
# define SCNiFAST8 SCNi8
|
||||
# define SCNoFAST8 SCNo8
|
||||
# define SCNuFAST8 SCNu8
|
||||
# define SCNxFAST8 SCNx8
|
||||
|
||||
# define SCNdFAST16 SCNd16
|
||||
# define SCNiFAST16 SCNi16
|
||||
# define SCNoFAST16 SCNo16
|
||||
# define SCNuFAST16 SCNu16
|
||||
# define SCNxFAST16 SCNx16
|
||||
|
||||
# define SCNdFAST32 SCNd32
|
||||
# define SCNiFAST32 SCNi32
|
||||
# define SCNoFAST32 SCNo32
|
||||
# define SCNuFAST32 SCNu32
|
||||
# define SCNxFAST32 SCNx32
|
||||
|
||||
# define SCNdFAST64 SCNd64
|
||||
# define SCNiFAST64 SCNi64
|
||||
# define SCNoFAST64 SCNo64
|
||||
# define SCNuFAST64 SCNu64
|
||||
# define SCNxFAST64 SCNx64
|
||||
|
||||
# define SCNdPTR "ld"
|
||||
# define SCNiPTR "li"
|
||||
# define SCNoPTR "lo"
|
||||
# define SCNuPTR "lu"
|
||||
# define SCNxPTR "lx"
|
||||
|
||||
# define SCNdMAX __SCN_MAX_LENGTH_MODIFIER__ "d"
|
||||
# define SCNiMAX __SCN_MAX_LENGTH_MODIFIER__ "i"
|
||||
# define SCNoMAX __SCN_MAX_LENGTH_MODIFIER__ "o"
|
||||
# define SCNuMAX __SCN_MAX_LENGTH_MODIFIER__ "u"
|
||||
# define SCNxMAX __SCN_MAX_LENGTH_MODIFIER__ "x"
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#include <Availability.h>
|
||||
|
||||
#include <_types.h>
|
||||
#include <sys/_types/_wchar_t.h>
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* 7.8.2.1 */
|
||||
__OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0)
|
||||
extern intmax_t
|
||||
imaxabs(intmax_t j);
|
||||
|
||||
/* 7.8.2.2 */
|
||||
typedef struct {
|
||||
intmax_t quot;
|
||||
intmax_t rem;
|
||||
} imaxdiv_t;
|
||||
|
||||
__OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0)
|
||||
extern imaxdiv_t
|
||||
imaxdiv(intmax_t __numer, intmax_t __denom);
|
||||
|
||||
/* 7.8.2.3 */
|
||||
__OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0)
|
||||
extern intmax_t
|
||||
strtoimax(const char * __restrict __nptr,
|
||||
char ** __restrict __endptr,
|
||||
int __base);
|
||||
|
||||
__OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0)
|
||||
extern uintmax_t
|
||||
strtoumax(const char * __restrict __nptr,
|
||||
char ** __restrict __endptr,
|
||||
int __base);
|
||||
|
||||
/* 7.8.2.4 */
|
||||
__OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0)
|
||||
extern intmax_t
|
||||
wcstoimax(const wchar_t * __restrict __nptr,
|
||||
wchar_t ** __restrict __endptr,
|
||||
int __base);
|
||||
|
||||
__OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0)
|
||||
extern uintmax_t
|
||||
wcstoumax(const wchar_t * __restrict __nptr,
|
||||
wchar_t ** __restrict __endptr,
|
||||
int __base);
|
||||
|
||||
/* Poison the following routines if -fshort-wchar is set */
|
||||
#if !defined(__cplusplus) && defined(__WCHAR_MAX__) && __WCHAR_MAX__ <= 0xffffU
|
||||
#pragma GCC poison wcstoimax wcstoumax
|
||||
#endif
|
||||
|
||||
__END_DECLS
|
||||
#include <_inttypes.h>
|
||||
|
||||
#ifdef _USE_EXTENDED_LOCALES_
|
||||
#include <xlocale/_inttypes.h>
|
||||
#endif /* _USE_EXTENDED_LOCALES_ */
|
||||
|
||||
/*
|
||||
No need to #undef the __*_{8,64}_LENGTH_MODIFIER__ macros;
|
||||
in fact, you can't #undef them, because later uses of any of
|
||||
their dependents will *not* then do the intended substitution.
|
||||
Expansion of a #define like this one:
|
||||
|
||||
#define x IDENT y
|
||||
|
||||
uses the cpp value of IDENT at the location where x is *expanded*,
|
||||
not where it is #defined.
|
||||
*/
|
||||
|
||||
#endif /* !_INTTYPES_H_ */
|
||||
|
||||
89
lib/libc/include/any-macos-any/langinfo.h
vendored
89
lib/libc/include/any-macos-any/langinfo.h
vendored
@@ -26,95 +26,8 @@
|
||||
* $FreeBSD: /repoman/r/ncvs/src/include/langinfo.h,v 1.6 2002/09/18 05:54:25 mike Exp $
|
||||
*/
|
||||
|
||||
#ifndef _LANGINFO_H_
|
||||
#define _LANGINFO_H_
|
||||
|
||||
#include <_types.h>
|
||||
#include <_types/_nl_item.h>
|
||||
|
||||
#define CODESET 0 /* codeset name */
|
||||
#define D_T_FMT 1 /* string for formatting date and time */
|
||||
#define D_FMT 2 /* date format string */
|
||||
#define T_FMT 3 /* time format string */
|
||||
#define T_FMT_AMPM 4 /* a.m. or p.m. time formatting string */
|
||||
#define AM_STR 5 /* Ante Meridian affix */
|
||||
#define PM_STR 6 /* Post Meridian affix */
|
||||
|
||||
/* week day names */
|
||||
#define DAY_1 7
|
||||
#define DAY_2 8
|
||||
#define DAY_3 9
|
||||
#define DAY_4 10
|
||||
#define DAY_5 11
|
||||
#define DAY_6 12
|
||||
#define DAY_7 13
|
||||
|
||||
/* abbreviated week day names */
|
||||
#define ABDAY_1 14
|
||||
#define ABDAY_2 15
|
||||
#define ABDAY_3 16
|
||||
#define ABDAY_4 17
|
||||
#define ABDAY_5 18
|
||||
#define ABDAY_6 19
|
||||
#define ABDAY_7 20
|
||||
|
||||
/* month names */
|
||||
#define MON_1 21
|
||||
#define MON_2 22
|
||||
#define MON_3 23
|
||||
#define MON_4 24
|
||||
#define MON_5 25
|
||||
#define MON_6 26
|
||||
#define MON_7 27
|
||||
#define MON_8 28
|
||||
#define MON_9 29
|
||||
#define MON_10 30
|
||||
#define MON_11 31
|
||||
#define MON_12 32
|
||||
|
||||
/* abbreviated month names */
|
||||
#define ABMON_1 33
|
||||
#define ABMON_2 34
|
||||
#define ABMON_3 35
|
||||
#define ABMON_4 36
|
||||
#define ABMON_5 37
|
||||
#define ABMON_6 38
|
||||
#define ABMON_7 39
|
||||
#define ABMON_8 40
|
||||
#define ABMON_9 41
|
||||
#define ABMON_10 42
|
||||
#define ABMON_11 43
|
||||
#define ABMON_12 44
|
||||
|
||||
#define ERA 45 /* era description segments */
|
||||
#define ERA_D_FMT 46 /* era date format string */
|
||||
#define ERA_D_T_FMT 47 /* era date and time format string */
|
||||
#define ERA_T_FMT 48 /* era time format string */
|
||||
#define ALT_DIGITS 49 /* alternative symbols for digits */
|
||||
|
||||
#define RADIXCHAR 50 /* radix char */
|
||||
#define THOUSEP 51 /* separator for thousands */
|
||||
|
||||
#define YESEXPR 52 /* affirmative response expression */
|
||||
#define NOEXPR 53 /* negative response expression */
|
||||
|
||||
#if (__DARWIN_C_LEVEL > __DARWIN_C_ANSI && __DARWIN_C_LEVEL < 200112L) || __DARWIN_C_LEVEL == __DARWIN_C_FULL
|
||||
#define YESSTR 54 /* affirmative response for yes/no queries */
|
||||
#define NOSTR 55 /* negative response for yes/no queries */
|
||||
#endif
|
||||
|
||||
#define CRNCYSTR 56 /* currency symbol */
|
||||
|
||||
#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
|
||||
#define D_MD_ORDER 57 /* month/day order (local extension) */
|
||||
#endif
|
||||
|
||||
__BEGIN_DECLS
|
||||
char *nl_langinfo(nl_item);
|
||||
__END_DECLS
|
||||
#include <_langinfo.h>
|
||||
|
||||
#ifdef _USE_EXTENDED_LOCALES_
|
||||
#include <xlocale/_langinfo.h>
|
||||
#endif /* _USE_EXTENDED_LOCALES_ */
|
||||
|
||||
#endif /* !_LANGINFO_H_ */
|
||||
|
||||
@@ -40,6 +40,10 @@
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
#if __has_include(<libkern/OSAtomicPrivate.h>)
|
||||
#include <libkern/OSAtomicPrivate.h>
|
||||
#endif
|
||||
|
||||
#include "OSAtomicDeprecated.h"
|
||||
#include "OSSpinLockDeprecated.h"
|
||||
#include "OSAtomicQueue.h"
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
*/
|
||||
|
||||
#include <Availability.h>
|
||||
#include <TargetConditionals.h>
|
||||
|
||||
#if !(defined(OSATOMIC_USE_INLINED) && OSATOMIC_USE_INLINED)
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#include <Availability.h>
|
||||
#include <TargetConditionals.h>
|
||||
|
||||
/*
|
||||
** OSThermalNotification.h
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2006 Apple Computer, Inc. All rights reserved.
|
||||
* Copyright (c) 2006-2023 Apple Computer, Inc. All rights reserved.
|
||||
*
|
||||
* @APPLE_OSREFERENCE_LICENSE_HEADER_START@
|
||||
*
|
||||
@@ -29,14 +29,6 @@
|
||||
#ifndef _OS__OSBYTEORDER_H
|
||||
#define _OS__OSBYTEORDER_H
|
||||
|
||||
/*
|
||||
* This header is normally included from <libkern/OSByteOrder.h>. However,
|
||||
* <sys/_endian.h> also includes this in the case of little-endian
|
||||
* architectures, so that we can map OSByteOrder routines to the hton* and ntoh*
|
||||
* macros. This results in the asymmetry below; we only include
|
||||
* <libkern/arch/_OSByteOrder.h> for little-endian architectures.
|
||||
*/
|
||||
|
||||
#include <sys/_types.h>
|
||||
|
||||
/* Macros for swapping constant values in the preprocessing stage. */
|
||||
@@ -62,22 +54,12 @@
|
||||
|
||||
#if defined(__GNUC__)
|
||||
|
||||
#if !defined(__DARWIN_OS_INLINE)
|
||||
# if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
|
||||
# define __DARWIN_OS_INLINE static inline
|
||||
# elif defined(__MWERKS__) || defined(__cplusplus)
|
||||
# define __DARWIN_OS_INLINE static inline
|
||||
# else
|
||||
# define __DARWIN_OS_INLINE static __inline__
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(__i386__) || defined(__x86_64__)
|
||||
#include <libkern/i386/_OSByteOrder.h>
|
||||
#endif
|
||||
|
||||
#if defined (__arm__) || defined(__arm64__)
|
||||
#include <libkern/arm/OSByteOrder.h>
|
||||
#include <libkern/arm/_OSByteOrder.h>
|
||||
#endif
|
||||
|
||||
|
||||
@@ -94,28 +76,38 @@
|
||||
|
||||
#if defined(__i386__) || defined(__x86_64__)
|
||||
|
||||
#if !defined(__DARWIN_OS_INLINE)
|
||||
# if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
|
||||
# define __DARWIN_OS_INLINE static inline
|
||||
# elif defined(__MWERKS__) || defined(__cplusplus)
|
||||
# define __DARWIN_OS_INLINE static inline
|
||||
# else
|
||||
# define __DARWIN_OS_INLINE static __inline__
|
||||
# endif
|
||||
#endif
|
||||
|
||||
__DARWIN_OS_INLINE
|
||||
uint16_t
|
||||
__uint16_t
|
||||
_OSSwapInt16(
|
||||
uint16_t data
|
||||
__uint16_t data
|
||||
)
|
||||
{
|
||||
return __DARWIN_OSSwapConstInt16(data);
|
||||
}
|
||||
|
||||
__DARWIN_OS_INLINE
|
||||
uint32_t
|
||||
__uint32_t
|
||||
_OSSwapInt32(
|
||||
uint32_t data
|
||||
__uint32_t data
|
||||
)
|
||||
{
|
||||
return __DARWIN_OSSwapConstInt32(data);
|
||||
}
|
||||
|
||||
__DARWIN_OS_INLINE
|
||||
uint64_t
|
||||
__uint64_t
|
||||
_OSSwapInt64(
|
||||
uint64_t data
|
||||
__uint64_t data
|
||||
)
|
||||
{
|
||||
return __DARWIN_OSSwapConstInt64(data);
|
||||
|
||||
@@ -1,64 +1,41 @@
|
||||
/*
|
||||
* Copyright (c) 1999-2007 Apple Inc. All rights reserved.
|
||||
* Copyright (c) 1999-2023 Apple Inc. All rights reserved.
|
||||
*
|
||||
* @APPLE_OSREFERENCE_LICENSE_HEADER_START@
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original Code
|
||||
* as defined in and that are subject to the Apple Public Source License
|
||||
* Version 2.0 (the 'License'). You may not use this file except in
|
||||
* compliance with the License. The rights granted to you under the License
|
||||
* may not be used to create, or enable the creation or redistribution of,
|
||||
* unlawful or unlicensed copies of an Apple operating system, or to
|
||||
* circumvent, violate, or enable the circumvention or violation of, any
|
||||
* terms of an Apple operating system software license agreement.
|
||||
*
|
||||
* Please obtain a copy of the License at
|
||||
* http://www.opensource.apple.com/apsl/ and read it before using this file.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
|
||||
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
|
||||
* Please see the License for the specific language governing rights and
|
||||
* limitations under the License.
|
||||
*
|
||||
* @APPLE_OSREFERENCE_LICENSE_HEADER_END@
|
||||
*/
|
||||
|
||||
#ifndef _OS_OSBYTEORDERARM_H
|
||||
#define _OS_OSBYTEORDERARM_H
|
||||
|
||||
#if defined (__arm__) || defined(__arm64__)
|
||||
|
||||
#include <stdint.h>
|
||||
#include <libkern/arm/_OSByteOrder.h>
|
||||
#include <sys/_types/_os_inline.h>
|
||||
#include <arm/arch.h> /* for _ARM_ARCH_6 */
|
||||
|
||||
/* Generic byte swapping functions. */
|
||||
|
||||
__DARWIN_OS_INLINE
|
||||
uint16_t
|
||||
_OSSwapInt16(
|
||||
uint16_t _data
|
||||
)
|
||||
{
|
||||
/* Reduces to 'rev16' with clang */
|
||||
return (uint16_t)(_data << 8 | _data >> 8);
|
||||
}
|
||||
|
||||
__DARWIN_OS_INLINE
|
||||
uint32_t
|
||||
_OSSwapInt32(
|
||||
uint32_t _data
|
||||
)
|
||||
{
|
||||
#if defined(__llvm__)
|
||||
_data = __builtin_bswap32(_data);
|
||||
#else
|
||||
/* This actually generates the best code */
|
||||
_data = (((_data ^ (_data >> 16 | (_data << 16))) & 0xFF00FFFF) >> 8) ^ (_data >> 8 | _data << 24);
|
||||
#endif
|
||||
|
||||
return _data;
|
||||
}
|
||||
|
||||
__DARWIN_OS_INLINE
|
||||
uint64_t
|
||||
_OSSwapInt64(
|
||||
uint64_t _data
|
||||
)
|
||||
{
|
||||
#if defined(__llvm__)
|
||||
return __builtin_bswap64(_data);
|
||||
#else
|
||||
union {
|
||||
uint64_t _ull;
|
||||
uint32_t _ul[2];
|
||||
} _u;
|
||||
|
||||
/* This actually generates the best code */
|
||||
_u._ul[0] = (uint32_t)(_data >> 32);
|
||||
_u._ul[1] = (uint32_t)(_data & 0xffffffff);
|
||||
_u._ul[0] = _OSSwapInt32(_u._ul[0]);
|
||||
_u._ul[1] = _OSSwapInt32(_u._ul[1]);
|
||||
return _u._ull;
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Functions for byte reversed loads. */
|
||||
|
||||
struct _OSUnalignedU16 {
|
||||
@@ -74,7 +51,7 @@ struct _OSUnalignedU64 {
|
||||
} __attribute__((__packed__));
|
||||
|
||||
#if defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE)
|
||||
__DARWIN_OS_INLINE
|
||||
OS_INLINE
|
||||
uint16_t
|
||||
_OSReadSwapInt16(
|
||||
const volatile void * _base,
|
||||
@@ -84,7 +61,7 @@ _OSReadSwapInt16(
|
||||
return _OSSwapInt16(((struct _OSUnalignedU16 *)((uintptr_t)_base + _offset))->__val);
|
||||
}
|
||||
#else
|
||||
__DARWIN_OS_INLINE
|
||||
OS_INLINE
|
||||
uint16_t
|
||||
OSReadSwapInt16(
|
||||
const volatile void * _base,
|
||||
@@ -96,7 +73,7 @@ OSReadSwapInt16(
|
||||
#endif
|
||||
|
||||
#if defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE)
|
||||
__DARWIN_OS_INLINE
|
||||
OS_INLINE
|
||||
uint32_t
|
||||
_OSReadSwapInt32(
|
||||
const volatile void * _base,
|
||||
@@ -106,7 +83,7 @@ _OSReadSwapInt32(
|
||||
return _OSSwapInt32(((struct _OSUnalignedU32 *)((uintptr_t)_base + _offset))->__val);
|
||||
}
|
||||
#else
|
||||
__DARWIN_OS_INLINE
|
||||
OS_INLINE
|
||||
uint32_t
|
||||
OSReadSwapInt32(
|
||||
const volatile void * _base,
|
||||
@@ -118,7 +95,7 @@ OSReadSwapInt32(
|
||||
#endif
|
||||
|
||||
#if defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE)
|
||||
__DARWIN_OS_INLINE
|
||||
OS_INLINE
|
||||
uint64_t
|
||||
_OSReadSwapInt64(
|
||||
const volatile void * _base,
|
||||
@@ -128,7 +105,7 @@ _OSReadSwapInt64(
|
||||
return _OSSwapInt64(((struct _OSUnalignedU64 *)((uintptr_t)_base + _offset))->__val);
|
||||
}
|
||||
#else
|
||||
__DARWIN_OS_INLINE
|
||||
OS_INLINE
|
||||
uint64_t
|
||||
OSReadSwapInt64(
|
||||
const volatile void * _base,
|
||||
@@ -142,7 +119,7 @@ OSReadSwapInt64(
|
||||
/* Functions for byte reversed stores. */
|
||||
|
||||
#if defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE)
|
||||
__DARWIN_OS_INLINE
|
||||
OS_INLINE
|
||||
void
|
||||
_OSWriteSwapInt16(
|
||||
volatile void * _base,
|
||||
@@ -153,7 +130,7 @@ _OSWriteSwapInt16(
|
||||
((struct _OSUnalignedU16 *)((uintptr_t)_base + _offset))->__val = _OSSwapInt16(_data);
|
||||
}
|
||||
#else
|
||||
__DARWIN_OS_INLINE
|
||||
OS_INLINE
|
||||
void
|
||||
OSWriteSwapInt16(
|
||||
volatile void * _base,
|
||||
@@ -166,7 +143,7 @@ OSWriteSwapInt16(
|
||||
#endif
|
||||
|
||||
#if defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE)
|
||||
__DARWIN_OS_INLINE
|
||||
OS_INLINE
|
||||
void
|
||||
_OSWriteSwapInt32(
|
||||
volatile void * _base,
|
||||
@@ -177,7 +154,7 @@ _OSWriteSwapInt32(
|
||||
((struct _OSUnalignedU32 *)((uintptr_t)_base + _offset))->__val = _OSSwapInt32(_data);
|
||||
}
|
||||
#else
|
||||
__DARWIN_OS_INLINE
|
||||
OS_INLINE
|
||||
void
|
||||
OSWriteSwapInt32(
|
||||
volatile void * _base,
|
||||
@@ -190,7 +167,7 @@ OSWriteSwapInt32(
|
||||
#endif
|
||||
|
||||
#if defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE)
|
||||
__DARWIN_OS_INLINE
|
||||
OS_INLINE
|
||||
void
|
||||
_OSWriteSwapInt64(
|
||||
volatile void * _base,
|
||||
@@ -201,7 +178,7 @@ _OSWriteSwapInt64(
|
||||
((struct _OSUnalignedU64 *)((uintptr_t)_base + _offset))->__val = _OSSwapInt64(_data);
|
||||
}
|
||||
#else
|
||||
__DARWIN_OS_INLINE
|
||||
OS_INLINE
|
||||
void
|
||||
OSWriteSwapInt64(
|
||||
volatile void * _base,
|
||||
@@ -213,4 +190,6 @@ OSWriteSwapInt64(
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* defined (__arm__) || defined(__arm64__) */
|
||||
|
||||
#endif /* ! _OS_OSBYTEORDERARM_H */
|
||||
|
||||
99
lib/libc/include/any-macos-any/libkern/arm/_OSByteOrder.h
vendored
Normal file
99
lib/libc/include/any-macos-any/libkern/arm/_OSByteOrder.h
vendored
Normal file
@@ -0,0 +1,99 @@
|
||||
/*
|
||||
* Copyright (c) 2023 Apple Inc. All rights reserved.
|
||||
*
|
||||
* @APPLE_OSREFERENCE_LICENSE_HEADER_START@
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original Code
|
||||
* as defined in and that are subject to the Apple Public Source License
|
||||
* Version 2.0 (the 'License'). You may not use this file except in
|
||||
* compliance with the License. The rights granted to you under the License
|
||||
* may not be used to create, or enable the creation or redistribution of,
|
||||
* unlawful or unlicensed copies of an Apple operating system, or to
|
||||
* circumvent, violate, or enable the circumvention or violation of, any
|
||||
* terms of an Apple operating system software license agreement.
|
||||
*
|
||||
* Please obtain a copy of the License at
|
||||
* http://www.opensource.apple.com/apsl/ and read it before using this file.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
|
||||
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
|
||||
* Please see the License for the specific language governing rights and
|
||||
* limitations under the License.
|
||||
*
|
||||
* @APPLE_OSREFERENCE_LICENSE_HEADER_END@
|
||||
*/
|
||||
|
||||
#ifndef _OS__OSBYTEORDERARM_H
|
||||
#define _OS__OSBYTEORDERARM_H
|
||||
|
||||
#if defined (__arm__) || defined(__arm64__)
|
||||
|
||||
#include <sys/_types.h>
|
||||
|
||||
#if !defined(__DARWIN_OS_INLINE)
|
||||
# if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
|
||||
# define __DARWIN_OS_INLINE static inline
|
||||
# elif defined(__MWERKS__) || defined(__cplusplus)
|
||||
# define __DARWIN_OS_INLINE static inline
|
||||
# else
|
||||
# define __DARWIN_OS_INLINE static __inline__
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Generic byte swapping functions. */
|
||||
|
||||
__DARWIN_OS_INLINE
|
||||
__uint16_t
|
||||
_OSSwapInt16(
|
||||
__uint16_t _data
|
||||
)
|
||||
{
|
||||
/* Reduces to 'rev16' with clang */
|
||||
return (__uint16_t)(_data << 8 | _data >> 8);
|
||||
}
|
||||
|
||||
__DARWIN_OS_INLINE
|
||||
__uint32_t
|
||||
_OSSwapInt32(
|
||||
__uint32_t _data
|
||||
)
|
||||
{
|
||||
#if defined(__llvm__)
|
||||
_data = __builtin_bswap32(_data);
|
||||
#else
|
||||
/* This actually generates the best code */
|
||||
_data = (((_data ^ (_data >> 16 | (_data << 16))) & 0xFF00FFFF) >> 8) ^ (_data >> 8 | _data << 24);
|
||||
#endif
|
||||
|
||||
return _data;
|
||||
}
|
||||
|
||||
__DARWIN_OS_INLINE
|
||||
__uint64_t
|
||||
_OSSwapInt64(
|
||||
__uint64_t _data
|
||||
)
|
||||
{
|
||||
#if defined(__llvm__)
|
||||
return __builtin_bswap64(_data);
|
||||
#else
|
||||
union {
|
||||
__uint64_t _ull;
|
||||
__uint32_t _ul[2];
|
||||
} _u;
|
||||
|
||||
/* This actually generates the best code */
|
||||
_u._ul[0] = (__uint32_t)(_data >> 32);
|
||||
_u._ul[1] = (__uint32_t)(_data & 0xffffffff);
|
||||
_u._ul[0] = _OSSwapInt32(_u._ul[0]);
|
||||
_u._ul[1] = _OSSwapInt32(_u._ul[1]);
|
||||
return _u._ull;
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif /* defined (__arm__) || defined(__arm64__) */
|
||||
|
||||
#endif /* ! _OS__OSBYTEORDERARM_H */
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999-2006 Apple Computer, Inc. All rights reserved.
|
||||
* Copyright (c) 1999-2023 Apple Computer, Inc. All rights reserved.
|
||||
*
|
||||
* @APPLE_OSREFERENCE_LICENSE_HEADER_START@
|
||||
*
|
||||
@@ -29,6 +29,8 @@
|
||||
#ifndef _OS_OSBYTEORDERI386_H
|
||||
#define _OS_OSBYTEORDERI386_H
|
||||
|
||||
#if defined(__i386__) || defined(__x86_64__)
|
||||
|
||||
#include <stdint.h>
|
||||
#include <libkern/i386/_OSByteOrder.h>
|
||||
#include <sys/_types/_os_inline.h>
|
||||
@@ -109,4 +111,6 @@ OSWriteSwapInt64(
|
||||
*(volatile uint64_t *)((uintptr_t)base + byteOffset) = _OSSwapInt64(data);
|
||||
}
|
||||
|
||||
#endif /* defined(__i386__) || defined(__x86_64__) */
|
||||
|
||||
#endif /* ! _OS_OSBYTEORDERI386_H */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2006-2012 Apple Inc. All rights reserved.
|
||||
* Copyright (c) 2006-2023 Apple Inc. All rights reserved.
|
||||
*
|
||||
* @APPLE_OSREFERENCE_LICENSE_HEADER_START@
|
||||
*
|
||||
@@ -29,6 +29,10 @@
|
||||
#ifndef _OS__OSBYTEORDERI386_H
|
||||
#define _OS__OSBYTEORDERI386_H
|
||||
|
||||
#if defined(__i386__) || defined(__x86_64__)
|
||||
|
||||
#include <sys/_types.h>
|
||||
|
||||
#if !defined(__DARWIN_OS_INLINE)
|
||||
# if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
|
||||
# define __DARWIN_OS_INLINE static inline
|
||||
@@ -101,4 +105,6 @@ _OSSwapInt64(
|
||||
#error Unknown architecture
|
||||
#endif
|
||||
|
||||
#endif /* defined(__i386__) || defined(__x86_64__) */
|
||||
|
||||
#endif /* ! _OS__OSBYTEORDERI386_H */
|
||||
|
||||
8
lib/libc/include/any-macos-any/libproc.h
vendored
8
lib/libc/include/any-macos-any/libproc.h
vendored
@@ -129,6 +129,10 @@ int proc_clear_dirty(pid_t pid, uint32_t flags);
|
||||
|
||||
int proc_terminate(pid_t pid, int *sig);
|
||||
int proc_terminate_all_rsr(int sig);
|
||||
int proc_signal_with_audittoken(audit_token_t *audittoken, int sig);
|
||||
int proc_terminate_with_audittoken(audit_token_t *audittoken, int *sig);
|
||||
int proc_signal_delegate(audit_token_t instigator, audit_token_t target, int sig);
|
||||
int proc_terminate_delegate(audit_token_t instigator, audit_token_t target, int *sig);
|
||||
|
||||
/*
|
||||
* NO_SMT means that on an SMT CPU, this thread must be scheduled alone,
|
||||
@@ -164,10 +168,6 @@ int proc_setthread_csm(uint32_t flags) __API_AVAILABLE(macos(11.0));
|
||||
|
||||
int proc_udata_info(int pid, int flavor, void *buffer, int buffersize);
|
||||
|
||||
#if __has_include(<libproc_private.h>)
|
||||
#include <libproc_private.h>
|
||||
#endif
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /*_LIBPROC_H_ */
|
||||
|
||||
@@ -108,7 +108,7 @@ enum {
|
||||
// are encoded in the UNWIND_X86_EBP_FRAME_REGISTERS bits as five 3-bit entries.
|
||||
// Each entry contains which register to restore.
|
||||
// UNWIND_X86_MODE_STACK_IMMD:
|
||||
// A "frameless" (EBP not used as frame pointer) function with a small
|
||||
// A "frameless" (EBP not used as frame pointer) function with a small
|
||||
// constant stack size. To return, a constant (encoded in the compact
|
||||
// unwind encoding) is added to the ESP. Then the return is done by
|
||||
// popping the stack into the pc.
|
||||
@@ -119,16 +119,16 @@ enum {
|
||||
// UNWIND_X86_FRAMELESS_STACK_REG_PERMUTATION contains which registers were
|
||||
// saved and their order.
|
||||
// UNWIND_X86_MODE_STACK_IND:
|
||||
// A "frameless" (EBP not used as frame pointer) function large constant
|
||||
// A "frameless" (EBP not used as frame pointer) function large constant
|
||||
// stack size. This case is like the previous, except the stack size is too
|
||||
// large to encode in the compact unwind encoding. Instead it requires that
|
||||
// the function contains "subl $nnnnnnnn,ESP" in its prolog. The compact
|
||||
// large to encode in the compact unwind encoding. Instead it requires that
|
||||
// the function contains "subl $nnnnnnnn,ESP" in its prolog. The compact
|
||||
// encoding contains the offset to the nnnnnnnn value in the function in
|
||||
// UNWIND_X86_FRAMELESS_STACK_SIZE.
|
||||
// UNWIND_X86_FRAMELESS_STACK_SIZE.
|
||||
// UNWIND_X86_MODE_DWARF:
|
||||
// No compact unwind encoding is available. Instead the low 24-bits of the
|
||||
// compact encoding is the offset of the DWARF FDE in the __eh_frame section.
|
||||
// This mode is never used in object files. It is only generated by the
|
||||
// This mode is never used in object files. It is only generated by the
|
||||
// linker in final linked images which have only DWARF unwind info for a
|
||||
// function.
|
||||
//
|
||||
@@ -233,36 +233,36 @@ enum {
|
||||
// For x86_64 there are four modes for the compact unwind encoding:
|
||||
// UNWIND_X86_64_MODE_RBP_FRAME:
|
||||
// RBP based frame where RBP is push on stack immediately after return address,
|
||||
// then RSP is moved to RBP. Thus, to unwind RSP is restored with the current
|
||||
// EPB value, then RBP is restored by popping off the stack, and the return
|
||||
// then RSP is moved to RBP. Thus, to unwind RSP is restored with the current
|
||||
// EPB value, then RBP is restored by popping off the stack, and the return
|
||||
// is done by popping the stack once more into the pc.
|
||||
// All non-volatile registers that need to be restored must have been saved
|
||||
// in a small range in the stack that starts RBP-8 to RBP-2040. The offset/8
|
||||
// in a small range in the stack that starts RBP-8 to RBP-2040. The offset/8
|
||||
// is encoded in the UNWIND_X86_64_RBP_FRAME_OFFSET bits. The registers saved
|
||||
// are encoded in the UNWIND_X86_64_RBP_FRAME_REGISTERS bits as five 3-bit entries.
|
||||
// Each entry contains which register to restore.
|
||||
// Each entry contains which register to restore.
|
||||
// UNWIND_X86_64_MODE_STACK_IMMD:
|
||||
// A "frameless" (RBP not used as frame pointer) function with a small
|
||||
// constant stack size. To return, a constant (encoded in the compact
|
||||
// unwind encoding) is added to the RSP. Then the return is done by
|
||||
// A "frameless" (RBP not used as frame pointer) function with a small
|
||||
// constant stack size. To return, a constant (encoded in the compact
|
||||
// unwind encoding) is added to the RSP. Then the return is done by
|
||||
// popping the stack into the pc.
|
||||
// All non-volatile registers that need to be restored must have been saved
|
||||
// on the stack immediately after the return address. The stack_size/8 is
|
||||
// encoded in the UNWIND_X86_64_FRAMELESS_STACK_SIZE (max stack size is 2048).
|
||||
// The number of registers saved is encoded in UNWIND_X86_64_FRAMELESS_STACK_REG_COUNT.
|
||||
// UNWIND_X86_64_FRAMELESS_STACK_REG_PERMUTATION contains which registers were
|
||||
// saved and their order.
|
||||
// saved and their order.
|
||||
// UNWIND_X86_64_MODE_STACK_IND:
|
||||
// A "frameless" (RBP not used as frame pointer) function large constant
|
||||
// A "frameless" (RBP not used as frame pointer) function large constant
|
||||
// stack size. This case is like the previous, except the stack size is too
|
||||
// large to encode in the compact unwind encoding. Instead it requires that
|
||||
// the function contains "subq $nnnnnnnn,RSP" in its prolog. The compact
|
||||
// large to encode in the compact unwind encoding. Instead it requires that
|
||||
// the function contains "subq $nnnnnnnn,RSP" in its prolog. The compact
|
||||
// encoding contains the offset to the nnnnnnnn value in the function in
|
||||
// UNWIND_X86_64_FRAMELESS_STACK_SIZE.
|
||||
// UNWIND_X86_64_FRAMELESS_STACK_SIZE.
|
||||
// UNWIND_X86_64_MODE_DWARF:
|
||||
// No compact unwind encoding is available. Instead the low 24-bits of the
|
||||
// compact encoding is the offset of the DWARF FDE in the __eh_frame section.
|
||||
// This mode is never used in object files. It is only generated by the
|
||||
// This mode is never used in object files. It is only generated by the
|
||||
// linker in final linked images which have only DWARF unwind info for a
|
||||
// function.
|
||||
//
|
||||
@@ -307,20 +307,20 @@ enum {
|
||||
// This is a standard arm64 prolog where FP/LR are immediately pushed on the
|
||||
// stack, then SP is copied to FP. If there are any non-volatile registers
|
||||
// saved, then are copied into the stack frame in pairs in a contiguous
|
||||
// range right below the saved FP/LR pair. Any subset of the five X pairs
|
||||
// range right below the saved FP/LR pair. Any subset of the five X pairs
|
||||
// and four D pairs can be saved, but the memory layout must be in register
|
||||
// number order.
|
||||
// number order.
|
||||
// UNWIND_ARM64_MODE_FRAMELESS:
|
||||
// A "frameless" leaf function, where FP/LR are not saved. The return address
|
||||
// A "frameless" leaf function, where FP/LR are not saved. The return address
|
||||
// remains in LR throughout the function. If any non-volatile registers
|
||||
// are saved, they must be pushed onto the stack before any stack space is
|
||||
// allocated for local variables. The stack sized (including any saved
|
||||
// non-volatile registers) divided by 16 is encoded in the bits
|
||||
// non-volatile registers) divided by 16 is encoded in the bits
|
||||
// UNWIND_ARM64_FRAMELESS_STACK_SIZE_MASK.
|
||||
// UNWIND_ARM64_MODE_DWARF:
|
||||
// No compact unwind encoding is available. Instead the low 24-bits of the
|
||||
// compact encoding is the offset of the DWARF FDE in the __eh_frame section.
|
||||
// This mode is never used in object files. It is only generated by the
|
||||
// This mode is never used in object files. It is only generated by the
|
||||
// linker in final linked images which have only DWARF unwind info for a
|
||||
// function.
|
||||
//
|
||||
@@ -393,19 +393,19 @@ enum {
|
||||
|
||||
//
|
||||
// A compiler can generated compact unwind information for a function by adding
|
||||
// a "row" to the __LD,__compact_unwind section. This section has the
|
||||
// S_ATTR_DEBUG bit set, so the section will be ignored by older linkers.
|
||||
// It is removed by the new linker, so never ends up in final executables.
|
||||
// This section is a table, initially with one row per function (that needs
|
||||
// a "row" to the __LD,__compact_unwind section. This section has the
|
||||
// S_ATTR_DEBUG bit set, so the section will be ignored by older linkers.
|
||||
// It is removed by the new linker, so never ends up in final executables.
|
||||
// This section is a table, initially with one row per function (that needs
|
||||
// unwind info). The table columns and some conceptual entries are:
|
||||
//
|
||||
// range-start pointer to start of function/range
|
||||
// range-length
|
||||
// compact-unwind-encoding 32-bit encoding
|
||||
// range-length
|
||||
// compact-unwind-encoding 32-bit encoding
|
||||
// personality-function or zero if no personality function
|
||||
// lsda or zero if no LSDA data
|
||||
//
|
||||
// The length and encoding fields are 32-bits. The other are all pointer sized.
|
||||
// The length and encoding fields are 32-bits. The other are all pointer sized.
|
||||
//
|
||||
// In x86_64 assembly, these entry would look like:
|
||||
//
|
||||
@@ -428,23 +428,23 @@ enum {
|
||||
// .quad except_tab1
|
||||
//
|
||||
//
|
||||
// Notes: There is no need for any labels in the the __compact_unwind section.
|
||||
// The use of the .set directive is to force the evaluation of the
|
||||
// Notes: There is no need for any labels in the __compact_unwind section.
|
||||
// The use of the .set directive is to force the evaluation of the
|
||||
// range-length at assembly time, instead of generating relocations.
|
||||
//
|
||||
// To support future compiler optimizations where which non-volatile registers
|
||||
// To support future compiler optimizations where which non-volatile registers
|
||||
// are saved changes within a function (e.g. delay saving non-volatiles until
|
||||
// necessary), there can by multiple lines in the __compact_unwind table for one
|
||||
// function, each with a different (non-overlapping) range and each with
|
||||
// different compact unwind encodings that correspond to the non-volatiles
|
||||
// function, each with a different (non-overlapping) range and each with
|
||||
// different compact unwind encodings that correspond to the non-volatiles
|
||||
// saved at that range of the function.
|
||||
//
|
||||
// If a particular function is so wacky that there is no compact unwind way
|
||||
// to encode it, then the compiler can emit traditional DWARF unwind info.
|
||||
// to encode it, then the compiler can emit traditional DWARF unwind info.
|
||||
// The runtime will use which ever is available.
|
||||
//
|
||||
// Runtime support for compact unwind encodings are only available on 10.6
|
||||
// and later. So, the compiler should not generate it when targeting pre-10.6.
|
||||
// Runtime support for compact unwind encodings are only available on 10.6
|
||||
// and later. So, the compiler should not generate it when targeting pre-10.6.
|
||||
|
||||
|
||||
|
||||
@@ -458,7 +458,7 @@ enum {
|
||||
//
|
||||
// The __TEXT,__unwind_info section is laid out for an efficient two level lookup.
|
||||
// The header of the section contains a coarse index that maps function address
|
||||
// to the page (4096 byte block) containing the unwind info for that function.
|
||||
// to the page (4096 byte block) containing the unwind info for that function.
|
||||
//
|
||||
|
||||
#define UNWIND_SECTION_VERSION 1
|
||||
|
||||
39
lib/libc/include/any-macos-any/mach-o/loader.h
vendored
39
lib/libc/include/any-macos-any/mach-o/loader.h
vendored
@@ -234,7 +234,12 @@ struct mach_header_64 {
|
||||
the platforms macOS, macCatalyst,
|
||||
iOSSimulator, tvOSSimulator and
|
||||
watchOSSimulator. */
|
||||
|
||||
|
||||
#define MH_IMPLICIT_PAGEZERO 0x10000000 /* main executable has no __PAGEZERO
|
||||
segment. Instead, loader (xnu)
|
||||
will load program high and block
|
||||
out all memory below it. */
|
||||
|
||||
#define MH_DYLIB_IN_CACHE 0x80000000 /* Only for use on dylibs. When this bit
|
||||
is set, the dylib is part of the dyld
|
||||
shared cache, rather than loose in
|
||||
@@ -670,7 +675,7 @@ struct fvmlib_command {
|
||||
};
|
||||
|
||||
/*
|
||||
* Dynamicly linked shared libraries are identified by two things. The
|
||||
* Dynamically linked shared libraries are identified by two things. The
|
||||
* pathname (the name of the library as found for execution), and the
|
||||
* compatibility version number. The pathname must match and the compatibility
|
||||
* number in the user of the library must be greater than or equal to the
|
||||
@@ -699,6 +704,30 @@ struct dylib_command {
|
||||
struct dylib dylib; /* the library identification */
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* An alternate encoding for: LC_LOAD_DYLIB.
|
||||
* The flags field contains independent flags DYLIB_USE_*
|
||||
* First supported in macOS 15, iOS 18.
|
||||
*/
|
||||
struct dylib_use_command {
|
||||
uint32_t cmd; /* LC_LOAD_DYLIB or LC_LOAD_WEAK_DYLIB */
|
||||
uint32_t cmdsize; /* overall size, including path */
|
||||
uint32_t nameoff; /* == 28, dylibs's path offset */
|
||||
uint32_t marker; /* == DYLIB_USE_MARKER */
|
||||
uint32_t current_version; /* dylib's current version number */
|
||||
uint32_t compat_version; /* dylib's compatibility version number */
|
||||
uint32_t flags; /* DYLIB_USE_... flags */
|
||||
};
|
||||
#define DYLIB_USE_WEAK_LINK 0x01
|
||||
#define DYLIB_USE_REEXPORT 0x02
|
||||
#define DYLIB_USE_UPWARD 0x04
|
||||
#define DYLIB_USE_DELAYED_INIT 0x08
|
||||
|
||||
#define DYLIB_USE_MARKER 0x1a741800
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* A dynamically linked shared library may be a subframework of an umbrella
|
||||
* framework. If so it will be linked with "-umbrella umbrella_name" where
|
||||
@@ -1287,6 +1316,8 @@ struct build_tool_version {
|
||||
#define PLATFORM_TVOSSIMULATOR 8
|
||||
#define PLATFORM_WATCHOSSIMULATOR 9
|
||||
#define PLATFORM_DRIVERKIT 10
|
||||
#define PLATFORM_VISIONOS 11
|
||||
#define PLATFORM_VISIONOSSIMULATOR 12
|
||||
|
||||
#ifndef __OPEN_SOURCE__
|
||||
|
||||
@@ -1299,6 +1330,10 @@ struct build_tool_version {
|
||||
|
||||
#endif /* __OPEN_SOURCE__ */
|
||||
|
||||
#ifndef __OPEN_SOURCE__
|
||||
|
||||
#endif /* __OPEN_SOURCE__ */
|
||||
|
||||
/* Known values for the tool field above. */
|
||||
#define TOOL_CLANG 1
|
||||
#define TOOL_SWIFT 2
|
||||
|
||||
@@ -202,7 +202,7 @@ struct nlist_64 {
|
||||
/*
|
||||
* To simplify stripping of objects that use are used with the dynamic link
|
||||
* editor, the static link editor marks the symbols defined an object that are
|
||||
* referenced by a dynamicly bound object (dynamic shared libraries, bundles).
|
||||
* referenced by a dynamically bound object (dynamic shared libraries, bundles).
|
||||
* With this marking strip knows not to strip these symbols.
|
||||
*/
|
||||
#define REFERENCED_DYNAMICALLY 0x0010
|
||||
|
||||
@@ -62,6 +62,12 @@ _STRUCT_ARM_EXCEPTION_STATE64
|
||||
__uint32_t __esr; /* Exception syndrome */
|
||||
__uint32_t __exception; /* number of arm exception taken */
|
||||
};
|
||||
#define _STRUCT_ARM_EXCEPTION_STATE64_V2 struct __darwin_arm_exception_state64_v2
|
||||
_STRUCT_ARM_EXCEPTION_STATE64_V2
|
||||
{
|
||||
__uint64_t __far; /* Virtual Fault Address */
|
||||
__uint64_t __esr; /* Exception syndrome */
|
||||
};
|
||||
#else /* !__DARWIN_UNIX03 */
|
||||
#define _STRUCT_ARM_EXCEPTION_STATE64 struct arm_exception_state64
|
||||
_STRUCT_ARM_EXCEPTION_STATE64
|
||||
@@ -70,6 +76,12 @@ _STRUCT_ARM_EXCEPTION_STATE64
|
||||
__uint32_t esr; /* Exception syndrome */
|
||||
__uint32_t exception; /* number of arm exception taken */
|
||||
};
|
||||
#define _STRUCT_ARM_EXCEPTION_STATE64_V2 struct arm_exception_state64_v2
|
||||
_STRUCT_ARM_EXCEPTION_STATE64_V2
|
||||
{
|
||||
__uint64_t far; /* Virtual Fault Address */
|
||||
__uint64_t esr; /* Exception syndrome */
|
||||
};
|
||||
#endif /* __DARWIN_UNIX03 */
|
||||
|
||||
#if __DARWIN_UNIX03
|
||||
@@ -241,6 +253,12 @@ _STRUCT_ARM_THREAD_STATE64
|
||||
ptrauth_key_function_pointer, 0)) : __f); \
|
||||
__tsp->__opaque_flags &= \
|
||||
~__DARWIN_ARM_THREAD_STATE64_FLAGS_KERNEL_SIGNED_PC; })
|
||||
/* Set pc field of arm_thread_state64_t to an already signed function pointer */
|
||||
#define __darwin_arm_thread_state64_set_pc_presigned_fptr(ts, presigned_fptr) \
|
||||
__extension__ ({ _STRUCT_ARM_THREAD_STATE64 *__tsp = &(ts); \
|
||||
__typeof__(presigned_fptr) __f = (presigned_fptr); __tsp->__opaque_pc = __f; \
|
||||
__tsp->__opaque_flags &= \
|
||||
~__DARWIN_ARM_THREAD_STATE64_FLAGS_KERNEL_SIGNED_PC; })
|
||||
/* Return lr field of arm_thread_state64_t as a data pointer value */
|
||||
#define __darwin_arm_thread_state64_get_lr(ts) \
|
||||
__extension__ ({ const _STRUCT_ARM_THREAD_STATE64 *__tsp = &(ts); \
|
||||
@@ -295,6 +313,12 @@ _STRUCT_ARM_THREAD_STATE64
|
||||
ptrauth_string_discriminator("lr"))) : ptrauth_auth_data(__f, \
|
||||
ptrauth_key_function_pointer, 0)) : __f); __tsp->__opaque_flags &= \
|
||||
~__DARWIN_ARM_THREAD_STATE64_FLAGS_KERNEL_SIGNED_LR; })
|
||||
/* Set lr field of arm_thread_state64_t to an already signed function pointer */
|
||||
#define __darwin_arm_thread_state64_set_lr_presigned_fptr(ts, presigned_fptr) \
|
||||
__extension__ ({ _STRUCT_ARM_THREAD_STATE64 *__tsp = &(ts); \
|
||||
__typeof__(presigned_fptr) __f = (presigned_fptr); __tsp->__opaque_lr = __f; \
|
||||
__tsp->__opaque_flags &= \
|
||||
~__DARWIN_ARM_THREAD_STATE64_FLAGS_KERNEL_SIGNED_LR & ~__DARWIN_ARM_THREAD_STATE64_FLAGS_IB_SIGNED_LR; })
|
||||
/* Return sp field of arm_thread_state64_t as a data pointer value */
|
||||
#define __darwin_arm_thread_state64_get_sp(ts) \
|
||||
__extension__ ({ const _STRUCT_ARM_THREAD_STATE64 *__tsp = &(ts); \
|
||||
@@ -368,6 +392,9 @@ _STRUCT_ARM_THREAD_STATE64
|
||||
/* Set pc field of arm_thread_state64_t to a function pointer */
|
||||
#define __darwin_arm_thread_state64_set_pc_fptr(ts, fptr) \
|
||||
((ts).__opaque_pc = (fptr))
|
||||
/* Set pc field of arm_thread_state64_t to an already signed function pointer */
|
||||
#define __darwin_arm_thread_state64_set_pc_presigned_fptr(ts, presigned_fptr) \
|
||||
((ts).__opaque_pc = (presigned_fptr))
|
||||
/* Return lr field of arm_thread_state64_t as a data pointer value */
|
||||
#define __darwin_arm_thread_state64_get_lr(ts) \
|
||||
((uintptr_t)((ts).__opaque_lr))
|
||||
@@ -377,6 +404,9 @@ _STRUCT_ARM_THREAD_STATE64
|
||||
/* Set lr field of arm_thread_state64_t to a function pointer */
|
||||
#define __darwin_arm_thread_state64_set_lr_fptr(ts, fptr) \
|
||||
((ts).__opaque_lr = (fptr))
|
||||
/* Set lr field of arm_thread_state64_t to a presigned function pointer */
|
||||
#define __darwin_arm_thread_state64_set_lr_presigned_fptr(ts, presigned_fptr) \
|
||||
((ts).__opaque_lr = (presigned_fptr))
|
||||
/* Return sp field of arm_thread_state64_t as a data pointer value */
|
||||
#define __darwin_arm_thread_state64_get_sp(ts) \
|
||||
((uintptr_t)((ts).__opaque_sp))
|
||||
@@ -405,6 +435,9 @@ _STRUCT_ARM_THREAD_STATE64
|
||||
/* Set pc field of arm_thread_state64_t to a function pointer */
|
||||
#define __darwin_arm_thread_state64_set_pc_fptr(ts, fptr) \
|
||||
((ts).__pc = (uintptr_t)(fptr))
|
||||
/* Set pc field of arm_thread_state64_t to an already signed function pointer */
|
||||
#define __darwin_arm_thread_state64_set_pc_presigned_fptr(ts, presigned_fptr) \
|
||||
((ts).__pc = (uintptr_t)(presigned_fptr))
|
||||
/* Return lr field of arm_thread_state64_t as a data pointer value */
|
||||
#define __darwin_arm_thread_state64_get_lr(ts) \
|
||||
((ts).__lr)
|
||||
@@ -414,6 +447,9 @@ _STRUCT_ARM_THREAD_STATE64
|
||||
/* Set lr field of arm_thread_state64_t to a function pointer */
|
||||
#define __darwin_arm_thread_state64_set_lr_fptr(ts, fptr) \
|
||||
((ts).__lr = (uintptr_t)(fptr))
|
||||
/* Set lr field of arm_thread_state64_t to a presigned function pointer */
|
||||
#define __darwin_arm_thread_state64_set_lr_presigned_fptr(ts, presigned_fptr) \
|
||||
((ts).__lr = ((uintptr_t)presigned_fptr))
|
||||
/* Return sp field of arm_thread_state64_t as a data pointer value */
|
||||
#define __darwin_arm_thread_state64_get_sp(ts) \
|
||||
((ts).__sp)
|
||||
@@ -441,6 +477,9 @@ _STRUCT_ARM_THREAD_STATE64
|
||||
/* Set pc field of arm_thread_state64_t to a function pointer */
|
||||
#define __darwin_arm_thread_state64_set_pc_fptr(ts, fptr) \
|
||||
((ts).pc = (uintptr_t)(fptr))
|
||||
/* Set pc field of arm_thread_state64_t to an already signed function pointer */
|
||||
#define __darwin_arm_thread_state64_set_pc_presigned_fptr(ts, presigned_fptr) \
|
||||
((ts).pc = (uintptr_t)(presigned_fptr))
|
||||
/* Return lr field of arm_thread_state64_t as a data pointer value */
|
||||
#define __darwin_arm_thread_state64_get_lr(ts) \
|
||||
((ts).lr)
|
||||
@@ -450,6 +489,9 @@ _STRUCT_ARM_THREAD_STATE64
|
||||
/* Set lr field of arm_thread_state64_t to a function pointer */
|
||||
#define __darwin_arm_thread_state64_set_lr_fptr(ts, fptr) \
|
||||
((ts).lr = (uintptr_t)(fptr))
|
||||
/* Set lr field of arm_thread_state64_t to a presigned function pointer */
|
||||
#define __darwin_arm_thread_state64_set_lr_presigned_fptr(ts, presigned_fptr) \
|
||||
((ts).lr = ((uintptr_t)presigned_fptr))
|
||||
/* Return sp field of arm_thread_state64_t as a data pointer value */
|
||||
#define __darwin_arm_thread_state64_get_sp(ts) \
|
||||
((ts).sp)
|
||||
|
||||
@@ -47,6 +47,7 @@
|
||||
*/
|
||||
|
||||
#define EXC_ARM_UNDEFINED 1 /* Undefined */
|
||||
#define EXC_ARM_SME_DISALLOWED 2 /* Current thread state prohibits use of SME resources */
|
||||
|
||||
/*
|
||||
* EXC_ARITHMETIC
|
||||
@@ -71,6 +72,7 @@
|
||||
#define EXC_ARM_SWP 0x104 /* SWP instruction */
|
||||
#define EXC_ARM_PAC_FAIL 0x105 /* PAC authentication failure */
|
||||
|
||||
|
||||
/*
|
||||
* EXC_BREAKPOINT
|
||||
*/
|
||||
|
||||
@@ -60,6 +60,7 @@
|
||||
#define ARM_EXCEPTION_STATE64 7
|
||||
// ARM_THREAD_STATE_LAST 8 /* legacy */
|
||||
#define ARM_THREAD_STATE32 9
|
||||
#define ARM_EXCEPTION_STATE64_V2 10
|
||||
|
||||
|
||||
/* API */
|
||||
@@ -73,6 +74,8 @@
|
||||
#define ARM_PAGEIN_STATE 27
|
||||
|
||||
|
||||
#define THREAD_STATE_FLAVORS 29 /* This must be updated to 1 more than the highest numerical state flavor */
|
||||
|
||||
#ifndef ARM_STATE_FLAVOR_IS_OTHER_VALID
|
||||
#define ARM_STATE_FLAVOR_IS_OTHER_VALID(_flavor_) 0
|
||||
#endif
|
||||
@@ -91,6 +94,7 @@
|
||||
(x == ARM_THREAD_STATE32) || \
|
||||
(x == ARM_THREAD_STATE64) || \
|
||||
(x == ARM_EXCEPTION_STATE64) || \
|
||||
(x == ARM_EXCEPTION_STATE64_V2) || \
|
||||
(x == ARM_NEON_STATE) || \
|
||||
(x == ARM_NEON_STATE64) || \
|
||||
(x == ARM_DEBUG_STATE32) || \
|
||||
@@ -123,6 +127,9 @@ typedef _STRUCT_ARM_THREAD_STATE64 arm_thread_state64_t;
|
||||
/* Set pc field of arm_thread_state64_t to a function pointer */
|
||||
#define arm_thread_state64_set_pc_fptr(ts, fptr) \
|
||||
__darwin_arm_thread_state64_set_pc_fptr(ts, fptr)
|
||||
/* Set pc field of arm_thread_state64_t to an already signed function pointer */
|
||||
#define arm_thread_state64_set_pc_presigned_fptr(ts, fptr) \
|
||||
__darwin_arm_thread_state64_set_pc_presigned_fptr(ts, fptr)
|
||||
/* Return lr field of arm_thread_state64_t as a data pointer value */
|
||||
#define arm_thread_state64_get_lr(ts) \
|
||||
__darwin_arm_thread_state64_get_lr(ts)
|
||||
@@ -134,6 +141,9 @@ typedef _STRUCT_ARM_THREAD_STATE64 arm_thread_state64_t;
|
||||
/* Set lr field of arm_thread_state64_t to a function pointer */
|
||||
#define arm_thread_state64_set_lr_fptr(ts, fptr) \
|
||||
__darwin_arm_thread_state64_set_lr_fptr(ts, fptr)
|
||||
/* Set lr field of arm_thread_state64_t to an already signed function pointer */
|
||||
#define arm_thread_state64_set_lr_presigned_fptr(ts, fptr) \
|
||||
__darwin_arm_thread_state64_set_lr_presigned_fptr(ts, fptr)
|
||||
/* Return sp field of arm_thread_state64_t as a data pointer value */
|
||||
#define arm_thread_state64_get_sp(ts) \
|
||||
__darwin_arm_thread_state64_get_sp(ts)
|
||||
@@ -182,6 +192,7 @@ typedef _STRUCT_ARM_NEON_STATE64 arm_neon_state64_t;
|
||||
typedef _STRUCT_ARM_EXCEPTION_STATE arm_exception_state_t;
|
||||
typedef _STRUCT_ARM_EXCEPTION_STATE arm_exception_state32_t;
|
||||
typedef _STRUCT_ARM_EXCEPTION_STATE64 arm_exception_state64_t;
|
||||
typedef _STRUCT_ARM_EXCEPTION_STATE64_V2 arm_exception_state64_v2_t;
|
||||
|
||||
typedef _STRUCT_ARM_DEBUG_STATE32 arm_debug_state32_t;
|
||||
typedef _STRUCT_ARM_DEBUG_STATE64 arm_debug_state64_t;
|
||||
@@ -209,6 +220,9 @@ typedef _STRUCT_ARM_LEGACY_DEBUG_STATE arm_debug_state_t;
|
||||
#define ARM_EXCEPTION_STATE64_COUNT ((mach_msg_type_number_t) \
|
||||
(sizeof (arm_exception_state64_t)/sizeof(uint32_t)))
|
||||
|
||||
#define ARM_EXCEPTION_STATE64_V2_COUNT ((mach_msg_type_number_t) \
|
||||
(sizeof (arm_exception_state64_v2_t)/sizeof(uint32_t)))
|
||||
|
||||
#define ARM_DEBUG_STATE_COUNT ((mach_msg_type_number_t) \
|
||||
(sizeof (arm_debug_state_t)/sizeof(uint32_t)))
|
||||
|
||||
|
||||
@@ -87,6 +87,11 @@
|
||||
#define MACH_VM_MIN_ADDRESS_RAW 0x0ULL
|
||||
#define MACH_VM_MAX_ADDRESS_RAW 0x00007FFFFE000000ULL
|
||||
|
||||
/*
|
||||
* `MACH_VM_MAX_ADDRESS` is exported to user space, but we don't want this
|
||||
* larger value for `MACH_VM_MAX_ADDRESS` to be exposed outside the kernel.
|
||||
*/
|
||||
|
||||
#define MACH_VM_MIN_ADDRESS ((mach_vm_offset_t) MACH_VM_MIN_ADDRESS_RAW)
|
||||
#define MACH_VM_MAX_ADDRESS ((mach_vm_offset_t) MACH_VM_MAX_ADDRESS_RAW)
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
*/
|
||||
typedef int alarm_type_t; /* alarm time type */
|
||||
typedef int sleep_type_t; /* sleep time type */
|
||||
typedef int clock_id_t; /* clock identification type */
|
||||
typedef int clock_id_t; /* clock identification type */
|
||||
typedef int clock_flavor_t; /* clock flavor type */
|
||||
typedef int *clock_attr_t; /* clock attribute type */
|
||||
typedef int clock_res_t; /* clock resolution type */
|
||||
@@ -60,7 +60,7 @@ typedef int clock_res_t; /* clock resolution type */
|
||||
*/
|
||||
struct mach_timespec {
|
||||
unsigned int tv_sec; /* seconds */
|
||||
clock_res_t tv_nsec; /* nanoseconds */
|
||||
clock_res_t tv_nsec; /* nanoseconds */
|
||||
};
|
||||
typedef struct mach_timespec mach_timespec_t;
|
||||
|
||||
@@ -86,39 +86,39 @@ typedef struct mach_timespec mach_timespec_t;
|
||||
#define NSEC_PER_SEC 1000000000ull /* nanoseconds per second */
|
||||
#define NSEC_PER_MSEC 1000000ull /* nanoseconds per millisecond */
|
||||
|
||||
#define BAD_MACH_TIMESPEC(t) \
|
||||
#define BAD_MACH_TIMESPEC(t) \
|
||||
((t)->tv_nsec < 0 || (t)->tv_nsec >= (long)NSEC_PER_SEC)
|
||||
|
||||
/* t1 <=> t2, also (t1 - t2) in nsec with max of +- 1 sec */
|
||||
#define CMP_MACH_TIMESPEC(t1, t2) \
|
||||
((t1)->tv_sec > (t2)->tv_sec ? (long) +NSEC_PER_SEC : \
|
||||
((t1)->tv_sec < (t2)->tv_sec ? (long) -NSEC_PER_SEC : \
|
||||
#define CMP_MACH_TIMESPEC(t1, t2) \
|
||||
((t1)->tv_sec > (t2)->tv_sec ? (long) +NSEC_PER_SEC : \
|
||||
((t1)->tv_sec < (t2)->tv_sec ? (long) -NSEC_PER_SEC : \
|
||||
(t1)->tv_nsec - (t2)->tv_nsec))
|
||||
|
||||
/* t1 += t2 */
|
||||
#define ADD_MACH_TIMESPEC(t1, t2) \
|
||||
do { \
|
||||
if (((t1)->tv_nsec += (t2)->tv_nsec) >= (long) NSEC_PER_SEC) { \
|
||||
(t1)->tv_nsec -= (long) NSEC_PER_SEC; \
|
||||
(t1)->tv_sec += 1; \
|
||||
} \
|
||||
(t1)->tv_sec += (t2)->tv_sec; \
|
||||
#define ADD_MACH_TIMESPEC(t1, t2) \
|
||||
do { \
|
||||
if (((t1)->tv_nsec += (t2)->tv_nsec) >= (long) NSEC_PER_SEC) { \
|
||||
(t1)->tv_nsec -= (long) NSEC_PER_SEC; \
|
||||
(t1)->tv_sec += 1; \
|
||||
} \
|
||||
(t1)->tv_sec += (t2)->tv_sec; \
|
||||
} while (0)
|
||||
|
||||
/* t1 -= t2 */
|
||||
#define SUB_MACH_TIMESPEC(t1, t2) \
|
||||
do { \
|
||||
if (((t1)->tv_nsec -= (t2)->tv_nsec) < 0) { \
|
||||
(t1)->tv_nsec += (long) NSEC_PER_SEC; \
|
||||
(t1)->tv_sec -= 1; \
|
||||
} \
|
||||
(t1)->tv_sec -= (t2)->tv_sec; \
|
||||
#define SUB_MACH_TIMESPEC(t1, t2) \
|
||||
do { \
|
||||
if (((t1)->tv_nsec -= (t2)->tv_nsec) < 0) { \
|
||||
(t1)->tv_nsec += (long) NSEC_PER_SEC; \
|
||||
(t1)->tv_sec -= 1; \
|
||||
} \
|
||||
(t1)->tv_sec -= (t2)->tv_sec; \
|
||||
} while (0)
|
||||
|
||||
/*
|
||||
* Alarm parameter defines.
|
||||
*/
|
||||
#define ALRMTYPE 0xff /* type (8-bit field) */
|
||||
#define ALRMTYPE 0xff /* type (8-bit field) */
|
||||
#define TIME_ABSOLUTE 0x00 /* absolute time */
|
||||
#define TIME_RELATIVE 0x01 /* relative time */
|
||||
|
||||
|
||||
3
lib/libc/include/any-macos-any/mach/error.h
vendored
3
lib/libc/include/any-macos-any/mach/error.h
vendored
@@ -99,6 +99,9 @@
|
||||
#define err_ipc err_system(0x3) /* old ipc errors */
|
||||
#define err_mach_ipc err_system(0x4) /* mach-ipc errors */
|
||||
#define err_dipc err_system(0x7) /* distributed ipc */
|
||||
#define err_vm err_system(0x8) /* virtual memory */
|
||||
/* err_system(0x37) libkern */
|
||||
/* err_system(0x38) iokit */
|
||||
#define err_local err_system(0x3e) /* user defined errors */
|
||||
#define err_ipc_compat err_system(0x3f) /* (compatibility) mach-ipc errors */
|
||||
|
||||
|
||||
@@ -126,6 +126,11 @@
|
||||
* and thread identity.
|
||||
*/
|
||||
|
||||
#define EXCEPTION_STATE_IDENTITY_PROTECTED 5
|
||||
/* Send a catch_exception_raise_state_identity_protected message including protected task
|
||||
* and thread identity plus the thread state.
|
||||
*/
|
||||
|
||||
#define MACH_EXCEPTION_BACKTRACE_PREFERRED 0x20000000
|
||||
/* Prefer sending a catch_exception_raise_backtrace message, if applicable */
|
||||
|
||||
|
||||
@@ -184,6 +184,7 @@ typedef struct host_priority_info *host_priority_info_t;
|
||||
#define HOST_EXPIRED_TASK_INFO 6 /* Statistics for expired tasks */
|
||||
|
||||
|
||||
|
||||
struct host_load_info {
|
||||
integer_t avenrun[3]; /* scaled by LOAD_SCALE */
|
||||
integer_t mach_factor[3]; /* scaled by LOAD_SCALE */
|
||||
|
||||
@@ -110,8 +110,10 @@
|
||||
#define HOST_FAIRPLAYD_PORT (24 + HOST_MAX_SPECIAL_KERNEL_PORT)
|
||||
#define HOST_IOCOMPRESSIONSTATS_PORT (25 + HOST_MAX_SPECIAL_KERNEL_PORT)
|
||||
#define HOST_MEMORY_ERROR_PORT (26 + HOST_MAX_SPECIAL_KERNEL_PORT)
|
||||
#define HOST_MANAGEDAPPDISTD_PORT (27 + HOST_MAX_SPECIAL_KERNEL_PORT)
|
||||
#define HOST_DOUBLEAGENTD_PORT (28 + HOST_MAX_SPECIAL_KERNEL_PORT)
|
||||
|
||||
#define HOST_MAX_SPECIAL_PORT HOST_MEMORY_ERROR_PORT
|
||||
#define HOST_MAX_SPECIAL_PORT HOST_DOUBLEAGENTD_PORT
|
||||
/* MAX = last since rdar://59872249 */
|
||||
|
||||
/* obsolete name */
|
||||
@@ -288,6 +290,18 @@
|
||||
#define host_set_memory_error_port(host, port) \
|
||||
(host_set_special_port((host), HOST_MEMORY_ERROR_PORT, (port)))
|
||||
|
||||
#define host_get_managedappdistd_port(host, port) \
|
||||
(host_get_special_port((host), \
|
||||
HOST_LOCAL_NODE, HOST_MANAGEDAPPDISTD_PORT, (port)))
|
||||
#define host_set_managedappdistd_port(host, port) \
|
||||
(host_set_special_port((host), HOST_MANAGEDAPPDISTD_PORT, (port)))
|
||||
|
||||
#define host_get_doubleagentd_port(host, port) \
|
||||
(host_get_special_port((host), \
|
||||
HOST_LOCAL_NODE, HOST_DOUBLEAGENTD_PORT, (port)))
|
||||
#define host_set_doubleagentd_port(host, port) \
|
||||
(host_set_special_port((host), HOST_DOUBLEAGENTD_PORT, (port)))
|
||||
|
||||
/* HOST_RESOURCE_NOTIFY_PORT doesn't #defines these conveniences.
|
||||
* All lookups go through send_resource_violation()
|
||||
*/
|
||||
|
||||
@@ -125,6 +125,7 @@
|
||||
#define x86_THREAD_FULL_STATE64 23
|
||||
#define x86_INSTRUCTION_STATE 24
|
||||
#define x86_LAST_BRANCH_STATE 25
|
||||
#define THREAD_STATE_FLAVORS 26 /* This must be updated to 1 more than the highest numerical state flavor */
|
||||
|
||||
/*
|
||||
* Largest state on this machine:
|
||||
|
||||
16
lib/libc/include/any-macos-any/mach/machine.h
vendored
16
lib/libc/include/any-macos-any/mach/machine.h
vendored
@@ -118,10 +118,11 @@ typedef integer_t cpu_threadtype_t;
|
||||
#define CPU_TYPE_POWERPC ((cpu_type_t) 18)
|
||||
#define CPU_TYPE_POWERPC64 (CPU_TYPE_POWERPC | CPU_ARCH_ABI64)
|
||||
/* skip ((cpu_type_t) 19) */
|
||||
/* skip ((cpu_type_t) 20 */
|
||||
/* skip ((cpu_type_t) 21 */
|
||||
/* skip ((cpu_type_t) 22 */
|
||||
/* skip ((cpu_type_t) 23 */
|
||||
/* skip ((cpu_type_t) 20) */
|
||||
/* skip ((cpu_type_t) 21) */
|
||||
/* skip ((cpu_type_t) 22) */
|
||||
/* skip ((cpu_type_t) 23) */
|
||||
/* skip ((cpu_type_t) 24) */
|
||||
|
||||
/*
|
||||
* Machine subtypes (these are defined here, instead of in a machine
|
||||
@@ -349,6 +350,7 @@ typedef integer_t cpu_threadtype_t;
|
||||
#define CPU_SUBTYPE_ARM64_32_ALL ((cpu_subtype_t) 0)
|
||||
#define CPU_SUBTYPE_ARM64_32_V8 ((cpu_subtype_t) 1)
|
||||
|
||||
|
||||
#endif /* !__ASSEMBLER__ */
|
||||
|
||||
/*
|
||||
@@ -396,7 +398,13 @@ typedef integer_t cpu_threadtype_t;
|
||||
#define CPUFAMILY_ARM_FIRESTORM_ICESTORM 0x1b588bb3
|
||||
#define CPUFAMILY_ARM_BLIZZARD_AVALANCHE 0xda33d83d
|
||||
#define CPUFAMILY_ARM_EVEREST_SAWTOOTH 0x8765edea
|
||||
#define CPUFAMILY_ARM_IBIZA 0xfa33415e
|
||||
#define CPUFAMILY_ARM_PALMA 0x72015832
|
||||
#define CPUFAMILY_ARM_COLL 0x2876f5b5
|
||||
#define CPUFAMILY_ARM_LOBOS 0x5f4dea93
|
||||
#define CPUFAMILY_ARM_DONAN 0x6f5129ac
|
||||
#define CPUFAMILY_ARM_TAHITI 0x75d4acb9
|
||||
#define CPUFAMILY_ARM_TUPAI 0x204526d0
|
||||
|
||||
/* Described in rdar://64125549 */
|
||||
#define CPUSUBFAMILY_UNKNOWN 0
|
||||
|
||||
@@ -279,6 +279,7 @@ typedef struct memory_object_attr_info memory_object_attr_info_data_t;
|
||||
& 0xFF000000) | ((flags) & 0xFFFFFF));
|
||||
|
||||
/* leave room for vm_prot bits (0xFF ?) */
|
||||
#define MAP_MEM_PROT_MASK 0xFF
|
||||
#define MAP_MEM_LEDGER_TAGGED 0x002000 /* object owned by a specific task and ledger */
|
||||
#define MAP_MEM_PURGABLE_KERNEL_ONLY 0x004000 /* volatility controlled by kernel */
|
||||
#define MAP_MEM_GRAB_SECLUDED 0x008000 /* can grab secluded pages */
|
||||
|
||||
18
lib/libc/include/any-macos-any/mach/message.h
vendored
18
lib/libc/include/any-macos-any/mach/message.h
vendored
@@ -71,8 +71,10 @@
|
||||
#ifndef _MACH_MESSAGE_H_
|
||||
#define _MACH_MESSAGE_H_
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <machine/limits.h>
|
||||
#include <machine/types.h> /* user_addr_t */
|
||||
#include <mach/port.h>
|
||||
#include <mach/boolean.h>
|
||||
#include <mach/kern_return.h>
|
||||
@@ -81,6 +83,9 @@
|
||||
#include <sys/cdefs.h>
|
||||
#include <sys/appleapiopts.h>
|
||||
#include <Availability.h>
|
||||
#if __has_feature(ptrauth_calls)
|
||||
#include <ptrauth.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The timeout mechanism uses mach_msg_timeout_t values,
|
||||
@@ -281,6 +286,8 @@ typedef unsigned int mach_msg_descriptor_type_t;
|
||||
|
||||
#define MACH_MSG_DESCRIPTOR_MAX MACH_MSG_GUARDED_PORT_DESCRIPTOR
|
||||
|
||||
#define __ipc_desc_sign(d)
|
||||
|
||||
#pragma pack(push, 4)
|
||||
|
||||
typedef struct {
|
||||
@@ -292,7 +299,6 @@ typedef struct {
|
||||
|
||||
typedef struct {
|
||||
mach_port_t name;
|
||||
// Pad to 8 bytes everywhere except the K64 kernel where mach_port_t is 8 bytes
|
||||
mach_msg_size_t pad1;
|
||||
unsigned int pad2 : 16;
|
||||
mach_msg_type_name_t disposition : 8;
|
||||
@@ -319,7 +325,7 @@ typedef struct {
|
||||
} mach_msg_ool_descriptor64_t;
|
||||
|
||||
typedef struct {
|
||||
void* address;
|
||||
void *address;
|
||||
#if !defined(__LP64__)
|
||||
mach_msg_size_t size;
|
||||
#endif
|
||||
@@ -351,7 +357,7 @@ typedef struct {
|
||||
} mach_msg_ool_ports_descriptor64_t;
|
||||
|
||||
typedef struct {
|
||||
void* address;
|
||||
void *address;
|
||||
#if !defined(__LP64__)
|
||||
mach_msg_size_t count;
|
||||
#endif
|
||||
@@ -398,7 +404,7 @@ typedef struct {
|
||||
* appropriate in LP64 mode because not all descriptors
|
||||
* are of the same size in that environment.
|
||||
*/
|
||||
typedef union{
|
||||
typedef union {
|
||||
mach_msg_port_descriptor_t port;
|
||||
mach_msg_ool_descriptor_t out_of_line;
|
||||
mach_msg_ool_ports_descriptor_t ool_ports;
|
||||
@@ -667,6 +673,10 @@ typedef natural_t mach_msg_type_number_t;
|
||||
(((x) >= MACH_MSG_TYPE_MOVE_SEND) && \
|
||||
((x) <= MACH_MSG_TYPE_MAKE_SEND_ONCE))
|
||||
|
||||
#define MACH_MSG_TYPE_PORT_ANY_SEND_ONCE(x) \
|
||||
(((x) == MACH_MSG_TYPE_MOVE_SEND_ONCE) || \
|
||||
((x) == MACH_MSG_TYPE_MAKE_SEND_ONCE))
|
||||
|
||||
#define MACH_MSG_TYPE_PORT_ANY_RIGHT(x) \
|
||||
(((x) >= MACH_MSG_TYPE_MOVE_RECEIVE) && \
|
||||
((x) <= MACH_MSG_TYPE_MOVE_SEND_ONCE))
|
||||
|
||||
45
lib/libc/include/any-macos-any/mach/port.h
vendored
45
lib/libc/include/any-macos-any/mach/port.h
vendored
@@ -195,40 +195,37 @@ typedef natural_t mach_port_right_t;
|
||||
#define MACH_PORT_RIGHT_LABELH ((mach_port_right_t) 5) /* obsolete right */
|
||||
#define MACH_PORT_RIGHT_NUMBER ((mach_port_right_t) 6) /* right not implemented */
|
||||
|
||||
#define MACH_PORT_TYPE(right) \
|
||||
((mach_port_type_t)(((mach_port_type_t) 1) \
|
||||
<< ((right) + ((mach_port_right_t) 16))))
|
||||
|
||||
typedef natural_t mach_port_type_t;
|
||||
typedef mach_port_type_t *mach_port_type_array_t;
|
||||
|
||||
#define MACH_PORT_TYPE(right) \
|
||||
((mach_port_type_t)(((mach_port_type_t) 1) \
|
||||
<< ((right) + ((mach_port_right_t) 16))))
|
||||
#define MACH_PORT_TYPE_NONE ((mach_port_type_t) 0L)
|
||||
#define MACH_PORT_TYPE_SEND MACH_PORT_TYPE(MACH_PORT_RIGHT_SEND)
|
||||
#define MACH_PORT_TYPE_RECEIVE MACH_PORT_TYPE(MACH_PORT_RIGHT_RECEIVE)
|
||||
#define MACH_PORT_TYPE_SEND_ONCE MACH_PORT_TYPE(MACH_PORT_RIGHT_SEND_ONCE)
|
||||
#define MACH_PORT_TYPE_PORT_SET MACH_PORT_TYPE(MACH_PORT_RIGHT_PORT_SET)
|
||||
#define MACH_PORT_TYPE_DEAD_NAME MACH_PORT_TYPE(MACH_PORT_RIGHT_DEAD_NAME)
|
||||
#define MACH_PORT_TYPE_LABELH MACH_PORT_TYPE(MACH_PORT_RIGHT_LABELH) /* obsolete */
|
||||
|
||||
#define MACH_PORT_TYPE_NONE ((mach_port_type_t) 0L)
|
||||
#define MACH_PORT_TYPE_SEND MACH_PORT_TYPE(MACH_PORT_RIGHT_SEND)
|
||||
#define MACH_PORT_TYPE_RECEIVE MACH_PORT_TYPE(MACH_PORT_RIGHT_RECEIVE)
|
||||
#define MACH_PORT_TYPE_SEND_ONCE MACH_PORT_TYPE(MACH_PORT_RIGHT_SEND_ONCE)
|
||||
#define MACH_PORT_TYPE_PORT_SET MACH_PORT_TYPE(MACH_PORT_RIGHT_PORT_SET)
|
||||
#define MACH_PORT_TYPE_DEAD_NAME MACH_PORT_TYPE(MACH_PORT_RIGHT_DEAD_NAME)
|
||||
#define MACH_PORT_TYPE_LABELH MACH_PORT_TYPE(MACH_PORT_RIGHT_LABELH) /* obsolete */
|
||||
/* Dummy type bits that mach_port_type/mach_port_names can return. */
|
||||
#define MACH_PORT_TYPE_DNREQUEST 0x80000000
|
||||
#define MACH_PORT_TYPE_SPREQUEST 0x40000000
|
||||
#define MACH_PORT_TYPE_SPREQUEST_DELAYED 0x20000000
|
||||
|
||||
/* Convenient combinations. */
|
||||
|
||||
#define MACH_PORT_TYPE_SEND_RECEIVE \
|
||||
(MACH_PORT_TYPE_SEND|MACH_PORT_TYPE_RECEIVE)
|
||||
(MACH_PORT_TYPE_SEND|MACH_PORT_TYPE_RECEIVE)
|
||||
#define MACH_PORT_TYPE_SEND_RIGHTS \
|
||||
(MACH_PORT_TYPE_SEND|MACH_PORT_TYPE_SEND_ONCE)
|
||||
(MACH_PORT_TYPE_SEND|MACH_PORT_TYPE_SEND_ONCE)
|
||||
#define MACH_PORT_TYPE_PORT_RIGHTS \
|
||||
(MACH_PORT_TYPE_SEND_RIGHTS|MACH_PORT_TYPE_RECEIVE)
|
||||
(MACH_PORT_TYPE_SEND_RIGHTS|MACH_PORT_TYPE_RECEIVE)
|
||||
#define MACH_PORT_TYPE_PORT_OR_DEAD \
|
||||
(MACH_PORT_TYPE_PORT_RIGHTS|MACH_PORT_TYPE_DEAD_NAME)
|
||||
(MACH_PORT_TYPE_PORT_RIGHTS|MACH_PORT_TYPE_DEAD_NAME)
|
||||
#define MACH_PORT_TYPE_ALL_RIGHTS \
|
||||
(MACH_PORT_TYPE_PORT_OR_DEAD|MACH_PORT_TYPE_PORT_SET)
|
||||
|
||||
/* Dummy type bits that mach_port_type/mach_port_names can return. */
|
||||
|
||||
#define MACH_PORT_TYPE_DNREQUEST 0x80000000
|
||||
#define MACH_PORT_TYPE_SPREQUEST 0x40000000
|
||||
#define MACH_PORT_TYPE_SPREQUEST_DELAYED 0x20000000
|
||||
(MACH_PORT_TYPE_PORT_OR_DEAD|MACH_PORT_TYPE_PORT_SET)
|
||||
|
||||
/* User-references for capabilities. */
|
||||
|
||||
@@ -368,7 +365,7 @@ typedef struct mach_service_port_info * mach_service_port_info_t;
|
||||
#define MPO_REPLY_PORT 0x1000 /* Designate port as a reply port. */
|
||||
#define MPO_ENFORCE_REPLY_PORT_SEMANTICS 0x2000 /* When talking to this port, local port of mach msg needs to follow reply port semantics.*/
|
||||
#define MPO_PROVISIONAL_REPLY_PORT 0x4000 /* Designate port as a provisional reply port. */
|
||||
#define MPO_PROVISIONAL_ID_PROT_OPTOUT 0x8000 /* Opted out of EXCEPTION_IDENTITY_PROTECTED violation for now */
|
||||
#define MPO_EXCEPTION_PORT 0x8000 /* Used for hardened exceptions - immovable */
|
||||
|
||||
|
||||
/*
|
||||
@@ -404,6 +401,7 @@ enum mach_port_guard_exception_codes {
|
||||
kGUARD_EXC_INVALID_OPTIONS = 3,
|
||||
kGUARD_EXC_SET_CONTEXT = 4,
|
||||
kGUARD_EXC_THREAD_SET_STATE = 5,
|
||||
kGUARD_EXC_EXCEPTION_BEHAVIOR_ENFORCE= 6,
|
||||
kGUARD_EXC_UNGUARDED = 1u << 3,
|
||||
kGUARD_EXC_INCORRECT_GUARD = 1u << 4,
|
||||
kGUARD_EXC_IMMOVABLE = 1u << 5,
|
||||
@@ -427,7 +425,6 @@ enum mach_port_guard_exception_codes {
|
||||
kGUARD_EXC_MOD_REFS_NON_FATAL = 1u << 21,
|
||||
kGUARD_EXC_IMMOVABLE_NON_FATAL = 1u << 22,
|
||||
kGUARD_EXC_REQUIRE_REPLY_PORT_SEMANTICS = 1u << 23,
|
||||
kGUARD_EXC_EXCEPTION_BEHAVIOR_ENFORCE = 1u << 24,
|
||||
};
|
||||
|
||||
#define MAX_FATAL_kGUARD_EXC_CODE (1u << 7)
|
||||
|
||||
59
lib/libc/include/any-macos-any/mach/task.h
vendored
59
lib/libc/include/any-macos-any/mach/task.h
vendored
@@ -52,7 +52,7 @@ typedef function_table_entry *function_table_t;
|
||||
#endif /* AUTOTEST */
|
||||
|
||||
#ifndef task_MSG_COUNT
|
||||
#define task_MSG_COUNT 65
|
||||
#define task_MSG_COUNT 66
|
||||
#endif /* task_MSG_COUNT */
|
||||
|
||||
#include <Availability.h>
|
||||
@@ -933,6 +933,23 @@ kern_return_t task_map_kcdata_object_64
|
||||
mach_vm_size_t *kcd_size
|
||||
);
|
||||
|
||||
/* Routine task_register_hardened_exception_handler */
|
||||
#ifdef mig_external
|
||||
mig_external
|
||||
#else
|
||||
extern
|
||||
#endif /* mig_external */
|
||||
__TVOS_PROHIBITED __WATCHOS_PROHIBITED
|
||||
kern_return_t task_register_hardened_exception_handler
|
||||
(
|
||||
task_t task,
|
||||
uint32_t signed_pc_key,
|
||||
exception_mask_t exceptions_allowed,
|
||||
exception_behavior_t behaviors_allowed,
|
||||
thread_state_flavor_t flavors_allowed,
|
||||
mach_port_t new_exception_port
|
||||
);
|
||||
|
||||
__END_DECLS
|
||||
|
||||
/********************** Caution **************************/
|
||||
@@ -1035,7 +1052,7 @@ __END_DECLS
|
||||
NDR_record_t NDR;
|
||||
task_flavor_t flavor;
|
||||
mach_msg_type_number_t task_info_inCnt;
|
||||
integer_t task_info_in[90];
|
||||
integer_t task_info_in[94];
|
||||
} __Request__task_set_info_t __attribute__((unused));
|
||||
#ifdef __MigPackStructs
|
||||
#pragma pack(pop)
|
||||
@@ -1773,6 +1790,25 @@ __END_DECLS
|
||||
#ifdef __MigPackStructs
|
||||
#pragma pack(pop)
|
||||
#endif
|
||||
|
||||
#ifdef __MigPackStructs
|
||||
#pragma pack(push, 4)
|
||||
#endif
|
||||
typedef struct {
|
||||
mach_msg_header_t Head;
|
||||
/* start of the kernel processed data */
|
||||
mach_msg_body_t msgh_body;
|
||||
mach_msg_port_descriptor_t new_exception_port;
|
||||
/* end of the kernel processed data */
|
||||
NDR_record_t NDR;
|
||||
uint32_t signed_pc_key;
|
||||
exception_mask_t exceptions_allowed;
|
||||
exception_behavior_t behaviors_allowed;
|
||||
thread_state_flavor_t flavors_allowed;
|
||||
} __Request__task_register_hardened_exception_handler_t __attribute__((unused));
|
||||
#ifdef __MigPackStructs
|
||||
#pragma pack(pop)
|
||||
#endif
|
||||
#endif /* !__Request__task_subsystem__defined */
|
||||
|
||||
/* union of all requests */
|
||||
@@ -1843,6 +1879,7 @@ union __RequestUnion__task_subsystem {
|
||||
__Request__task_set_corpse_forking_behavior_t Request_task_set_corpse_forking_behavior;
|
||||
__Request__task_test_async_upcall_propagation_t Request_task_test_async_upcall_propagation;
|
||||
__Request__task_map_kcdata_object_64_t Request_task_map_kcdata_object_64;
|
||||
__Request__task_register_hardened_exception_handler_t Request_task_register_hardened_exception_handler;
|
||||
};
|
||||
#endif /* !__RequestUnion__task_subsystem__defined */
|
||||
/* typedefs for all replies */
|
||||
@@ -1928,7 +1965,7 @@ union __RequestUnion__task_subsystem {
|
||||
NDR_record_t NDR;
|
||||
kern_return_t RetCode;
|
||||
mach_msg_type_number_t task_info_outCnt;
|
||||
integer_t task_info_out[90];
|
||||
integer_t task_info_out[94];
|
||||
} __Reply__task_info_t __attribute__((unused));
|
||||
#ifdef __MigPackStructs
|
||||
#pragma pack(pop)
|
||||
@@ -2692,6 +2729,18 @@ union __RequestUnion__task_subsystem {
|
||||
#ifdef __MigPackStructs
|
||||
#pragma pack(pop)
|
||||
#endif
|
||||
|
||||
#ifdef __MigPackStructs
|
||||
#pragma pack(push, 4)
|
||||
#endif
|
||||
typedef struct {
|
||||
mach_msg_header_t Head;
|
||||
NDR_record_t NDR;
|
||||
kern_return_t RetCode;
|
||||
} __Reply__task_register_hardened_exception_handler_t __attribute__((unused));
|
||||
#ifdef __MigPackStructs
|
||||
#pragma pack(pop)
|
||||
#endif
|
||||
#endif /* !__Reply__task_subsystem__defined */
|
||||
|
||||
/* union of all replies */
|
||||
@@ -2762,6 +2811,7 @@ union __ReplyUnion__task_subsystem {
|
||||
__Reply__task_set_corpse_forking_behavior_t Reply_task_set_corpse_forking_behavior;
|
||||
__Reply__task_test_async_upcall_propagation_t Reply_task_test_async_upcall_propagation;
|
||||
__Reply__task_map_kcdata_object_64_t Reply_task_map_kcdata_object_64;
|
||||
__Reply__task_register_hardened_exception_handler_t Reply_task_register_hardened_exception_handler;
|
||||
};
|
||||
#endif /* !__RequestUnion__task_subsystem__defined */
|
||||
|
||||
@@ -2829,7 +2879,8 @@ union __ReplyUnion__task_subsystem {
|
||||
{ "task_test_sync_upcall", 3461 },\
|
||||
{ "task_set_corpse_forking_behavior", 3462 },\
|
||||
{ "task_test_async_upcall_propagation", 3463 },\
|
||||
{ "task_map_kcdata_object_64", 3464 }
|
||||
{ "task_map_kcdata_object_64", 3464 },\
|
||||
{ "task_register_hardened_exception_handler", 3465 }
|
||||
#endif
|
||||
|
||||
#ifdef __AfterMigUserHeader
|
||||
|
||||
11
lib/libc/include/any-macos-any/mach/task_info.h
vendored
11
lib/libc/include/any-macos-any/mach/task_info.h
vendored
@@ -403,12 +403,21 @@ struct task_vm_info {
|
||||
|
||||
/* added for rev6 */
|
||||
int64_t ledger_swapins;
|
||||
|
||||
/* added for rev7 */
|
||||
int64_t ledger_tag_neural_nofootprint_total;
|
||||
int64_t ledger_tag_neural_nofootprint_peak;
|
||||
};
|
||||
typedef struct task_vm_info task_vm_info_data_t;
|
||||
typedef struct task_vm_info *task_vm_info_t;
|
||||
#define TASK_VM_INFO_COUNT ((mach_msg_type_number_t) \
|
||||
(sizeof (task_vm_info_data_t) / sizeof (natural_t)))
|
||||
#define TASK_VM_INFO_REV6_COUNT TASK_VM_INFO_COUNT
|
||||
/*
|
||||
* The capacity of task_info_t in mach_types.defs also needs to be adjusted
|
||||
*/
|
||||
#define TASK_VM_INFO_REV7_COUNT TASK_VM_INFO_COUNT
|
||||
#define TASK_VM_INFO_REV6_COUNT /* doesn't include neural total and peak */ \
|
||||
((mach_msg_type_number_t) (TASK_VM_INFO_REV7_COUNT - 4))
|
||||
#define TASK_VM_INFO_REV5_COUNT /* doesn't include ledger swapins */ \
|
||||
((mach_msg_type_number_t) (TASK_VM_INFO_REV6_COUNT - 2))
|
||||
#define TASK_VM_INFO_REV4_COUNT /* doesn't include decompressions */ \
|
||||
|
||||
53
lib/libc/include/any-macos-any/mach/thread_act.h
vendored
53
lib/libc/include/any-macos-any/mach/thread_act.h
vendored
@@ -52,7 +52,7 @@ typedef function_table_entry *function_table_t;
|
||||
#endif /* AUTOTEST */
|
||||
|
||||
#ifndef thread_act_MSG_COUNT
|
||||
#define thread_act_MSG_COUNT 31
|
||||
#define thread_act_MSG_COUNT 32
|
||||
#endif /* thread_act_MSG_COUNT */
|
||||
|
||||
#include <Availability.h>
|
||||
@@ -493,6 +493,22 @@ kern_return_t thread_get_exception_ports_info
|
||||
exception_flavor_array_t old_flavors
|
||||
);
|
||||
|
||||
/* Routine thread_adopt_exception_handler */
|
||||
#ifdef mig_external
|
||||
mig_external
|
||||
#else
|
||||
extern
|
||||
#endif /* mig_external */
|
||||
__TVOS_PROHIBITED __WATCHOS_PROHIBITED
|
||||
kern_return_t thread_adopt_exception_handler
|
||||
(
|
||||
thread_t thread,
|
||||
mach_port_t exc_port,
|
||||
exception_mask_t exc_mask,
|
||||
exception_behavior_t behavior_mask,
|
||||
thread_state_flavor_t flavor_mask
|
||||
);
|
||||
|
||||
__END_DECLS
|
||||
|
||||
/********************** Caution **************************/
|
||||
@@ -905,6 +921,24 @@ __END_DECLS
|
||||
#ifdef __MigPackStructs
|
||||
#pragma pack(pop)
|
||||
#endif
|
||||
|
||||
#ifdef __MigPackStructs
|
||||
#pragma pack(push, 4)
|
||||
#endif
|
||||
typedef struct {
|
||||
mach_msg_header_t Head;
|
||||
/* start of the kernel processed data */
|
||||
mach_msg_body_t msgh_body;
|
||||
mach_msg_port_descriptor_t exc_port;
|
||||
/* end of the kernel processed data */
|
||||
NDR_record_t NDR;
|
||||
exception_mask_t exc_mask;
|
||||
exception_behavior_t behavior_mask;
|
||||
thread_state_flavor_t flavor_mask;
|
||||
} __Request__thread_adopt_exception_handler_t __attribute__((unused));
|
||||
#ifdef __MigPackStructs
|
||||
#pragma pack(pop)
|
||||
#endif
|
||||
#endif /* !__Request__thread_act_subsystem__defined */
|
||||
|
||||
/* union of all requests */
|
||||
@@ -942,6 +976,7 @@ union __RequestUnion__thread_act_subsystem {
|
||||
__Request__thread_swap_mach_voucher_t Request_thread_swap_mach_voucher;
|
||||
__Request__thread_convert_thread_state_t Request_thread_convert_thread_state;
|
||||
__Request__thread_get_exception_ports_info_t Request_thread_get_exception_ports_info;
|
||||
__Request__thread_adopt_exception_handler_t Request_thread_adopt_exception_handler;
|
||||
};
|
||||
#endif /* !__RequestUnion__thread_act_subsystem__defined */
|
||||
/* typedefs for all replies */
|
||||
@@ -1346,6 +1381,18 @@ union __RequestUnion__thread_act_subsystem {
|
||||
#ifdef __MigPackStructs
|
||||
#pragma pack(pop)
|
||||
#endif
|
||||
|
||||
#ifdef __MigPackStructs
|
||||
#pragma pack(push, 4)
|
||||
#endif
|
||||
typedef struct {
|
||||
mach_msg_header_t Head;
|
||||
NDR_record_t NDR;
|
||||
kern_return_t RetCode;
|
||||
} __Reply__thread_adopt_exception_handler_t __attribute__((unused));
|
||||
#ifdef __MigPackStructs
|
||||
#pragma pack(pop)
|
||||
#endif
|
||||
#endif /* !__Reply__thread_act_subsystem__defined */
|
||||
|
||||
/* union of all replies */
|
||||
@@ -1383,6 +1430,7 @@ union __ReplyUnion__thread_act_subsystem {
|
||||
__Reply__thread_swap_mach_voucher_t Reply_thread_swap_mach_voucher;
|
||||
__Reply__thread_convert_thread_state_t Reply_thread_convert_thread_state;
|
||||
__Reply__thread_get_exception_ports_info_t Reply_thread_get_exception_ports_info;
|
||||
__Reply__thread_adopt_exception_handler_t Reply_thread_adopt_exception_handler;
|
||||
};
|
||||
#endif /* !__RequestUnion__thread_act_subsystem__defined */
|
||||
|
||||
@@ -1417,7 +1465,8 @@ union __ReplyUnion__thread_act_subsystem {
|
||||
{ "thread_set_mach_voucher", 3626 },\
|
||||
{ "thread_swap_mach_voucher", 3627 },\
|
||||
{ "thread_convert_thread_state", 3628 },\
|
||||
{ "thread_get_exception_ports_info", 3630 }
|
||||
{ "thread_get_exception_ports_info", 3630 },\
|
||||
{ "thread_adopt_exception_handler", 3631 }
|
||||
#endif
|
||||
|
||||
#ifdef __AfterMigUserHeader
|
||||
|
||||
@@ -75,5 +75,6 @@ typedef int vm_behavior_t;
|
||||
#define VM_BEHAVIOR_REUSE ((vm_behavior_t) 9)
|
||||
#define VM_BEHAVIOR_CAN_REUSE ((vm_behavior_t) 10)
|
||||
#define VM_BEHAVIOR_PAGEOUT ((vm_behavior_t) 11)
|
||||
#define VM_BEHAVIOR_ZERO ((vm_behavior_t) 12) /* zero pages without faulting in additional pages */
|
||||
|
||||
#endif /*_MACH_VM_BEHAVIOR_H_*/
|
||||
|
||||
@@ -71,6 +71,7 @@ typedef int *vm_region_recurse_info_64_t;
|
||||
typedef int vm_region_flavor_t;
|
||||
typedef int vm_region_info_data_t[VM_REGION_INFO_MAX];
|
||||
|
||||
|
||||
#define VM_REGION_BASIC_INFO_64 9
|
||||
struct vm_region_basic_info_64 {
|
||||
vm_prot_t protection;
|
||||
|
||||
@@ -352,10 +352,12 @@ enum virtual_memory_guard_exception_codes {
|
||||
#define VM_LEDGER_TAG_UNCHANGED ((int)-1)
|
||||
|
||||
/* individual bits: */
|
||||
#define VM_LEDGER_FLAG_NO_FOOTPRINT (1 << 0)
|
||||
#define VM_LEDGER_FLAG_NO_FOOTPRINT (1 << 0)
|
||||
#define VM_LEDGER_FLAG_NO_FOOTPRINT_FOR_DEBUG (1 << 1)
|
||||
#define VM_LEDGER_FLAGS (VM_LEDGER_FLAG_NO_FOOTPRINT | VM_LEDGER_FLAG_NO_FOOTPRINT_FOR_DEBUG)
|
||||
#define VM_LEDGER_FLAG_FROM_KERNEL (1 << 2)
|
||||
|
||||
#define VM_LEDGER_FLAGS_USER (VM_LEDGER_FLAG_NO_FOOTPRINT | VM_LEDGER_FLAG_NO_FOOTPRINT_FOR_DEBUG)
|
||||
#define VM_LEDGER_FLAGS_ALL (VM_LEDGER_FLAGS_USER | VM_LEDGER_FLAG_FROM_KERNEL)
|
||||
|
||||
#define VM_MEMORY_MALLOC 1
|
||||
#define VM_MEMORY_MALLOC_SMALL 2
|
||||
|
||||
42
lib/libc/include/any-macos-any/machine/_endian.h
vendored
Normal file
42
lib/libc/include/any-macos-any/machine/_endian.h
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* Copyright (c) 2000-2023 Apple Inc. All rights reserved.
|
||||
*
|
||||
* @APPLE_OSREFERENCE_LICENSE_HEADER_START@
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original Code
|
||||
* as defined in and that are subject to the Apple Public Source License
|
||||
* Version 2.0 (the 'License'). You may not use this file except in
|
||||
* compliance with the License. The rights granted to you under the License
|
||||
* may not be used to create, or enable the creation or redistribution of,
|
||||
* unlawful or unlicensed copies of an Apple operating system, or to
|
||||
* circumvent, violate, or enable the circumvention or violation of, any
|
||||
* terms of an Apple operating system software license agreement.
|
||||
*
|
||||
* Please obtain a copy of the License at
|
||||
* http://www.opensource.apple.com/apsl/ and read it before using this file.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
|
||||
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
|
||||
* Please see the License for the specific language governing rights and
|
||||
* limitations under the License.
|
||||
*
|
||||
* @APPLE_OSREFERENCE_LICENSE_HEADER_END@
|
||||
*/
|
||||
/*
|
||||
* Copyright 1995 NeXT Computer, Inc. All rights reserved.
|
||||
*/
|
||||
#ifndef _BSD_MACHINE__ENDIAN_H_
|
||||
#define _BSD_MACHINE__ENDIAN_H_
|
||||
|
||||
#if defined (__i386__) || defined(__x86_64__)
|
||||
#include <i386/_endian.h>
|
||||
#elif defined (__arm__) || defined (__arm64__)
|
||||
#include <arm/_endian.h>
|
||||
#else
|
||||
#error architecture not supported
|
||||
#endif
|
||||
|
||||
#endif /* _BSD_MACHINE__ENDIAN_H_ */
|
||||
31
lib/libc/include/any-macos-any/malloc/_malloc.h
vendored
31
lib/libc/include/any-macos-any/malloc/_malloc.h
vendored
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2018 Apple Computer, Inc. All rights reserved.
|
||||
* Copyright (c) 2018-2023 Apple Computer, Inc. All rights reserved.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_START@
|
||||
*
|
||||
@@ -32,29 +32,40 @@
|
||||
|
||||
#include <Availability.h>
|
||||
#include <sys/cdefs.h>
|
||||
#include <_types.h>
|
||||
#if __has_include(<sys/_types/_size_t.h>)
|
||||
#include <sys/_types/_size_t.h>
|
||||
#else
|
||||
#define __need_size_t
|
||||
#include <stddef.h>
|
||||
#undef __need_size_t
|
||||
#endif
|
||||
|
||||
#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
|
||||
#include <malloc/_malloc_type.h>
|
||||
#else
|
||||
#define _MALLOC_TYPED(override, type_param_pos)
|
||||
#endif
|
||||
|
||||
#include <malloc/_ptrcheck.h>
|
||||
__ptrcheck_abi_assume_single()
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
void *malloc(size_t __size) __result_use_check __alloc_size(1) _MALLOC_TYPED(malloc_type_malloc, 1);
|
||||
void *calloc(size_t __count, size_t __size) __result_use_check __alloc_size(1,2) _MALLOC_TYPED(malloc_type_calloc, 2);
|
||||
void free(void *);
|
||||
void *realloc(void *__ptr, size_t __size) __result_use_check __alloc_size(2) _MALLOC_TYPED(malloc_type_realloc, 2);
|
||||
void * __sized_by_or_null(__size) malloc(size_t __size) __result_use_check __alloc_size(1) _MALLOC_TYPED(malloc_type_malloc, 1);
|
||||
void * __sized_by_or_null(__count * __size) calloc(size_t __count, size_t __size) __result_use_check __alloc_size(1,2) _MALLOC_TYPED(malloc_type_calloc, 2);
|
||||
void free(void * __unsafe_indexable);
|
||||
void * __sized_by_or_null(__size) realloc(void * __unsafe_indexable __ptr, size_t __size) __result_use_check __alloc_size(2) _MALLOC_TYPED(malloc_type_realloc, 2);
|
||||
void * __sized_by_or_null(__size) reallocf(void * __unsafe_indexable __ptr, size_t __size) __result_use_check __alloc_size(2);
|
||||
#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
|
||||
void *valloc(size_t) __alloc_size(1) _MALLOC_TYPED(malloc_type_valloc, 1);
|
||||
void * __sized_by_or_null(__size) valloc(size_t __size) __result_use_check __alloc_size(1) _MALLOC_TYPED(malloc_type_valloc, 1);
|
||||
#endif /* !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) */
|
||||
#if (__DARWIN_C_LEVEL >= __DARWIN_C_FULL) || \
|
||||
#if (defined(__DARWIN_C_LEVEL) && defined(__DARWIN_C_FULL) && __DARWIN_C_LEVEL >= __DARWIN_C_FULL) || \
|
||||
(defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || \
|
||||
(defined(__cplusplus) && __cplusplus >= 201703L)
|
||||
void *aligned_alloc(size_t __alignment, size_t __size) __result_use_check __alloc_size(2) _MALLOC_TYPED(malloc_type_aligned_alloc, 2) __OSX_AVAILABLE(10.15) __IOS_AVAILABLE(13.0) __TVOS_AVAILABLE(13.0) __WATCHOS_AVAILABLE(6.0);
|
||||
void * __sized_by_or_null(__size) aligned_alloc(size_t __alignment, size_t __size) __result_use_check __alloc_align(1) __alloc_size(2) _MALLOC_TYPED(malloc_type_aligned_alloc, 2) __OSX_AVAILABLE(10.15) __IOS_AVAILABLE(13.0) __TVOS_AVAILABLE(13.0) __WATCHOS_AVAILABLE(6.0);
|
||||
#endif
|
||||
int posix_memalign(void **__memptr, size_t __alignment, size_t __size) /*__alloc_size(3)*/ _MALLOC_TYPED(malloc_type_posix_memalign, 3) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0);
|
||||
/* rdar://120689514 */
|
||||
int posix_memalign(void * __unsafe_indexable *__memptr, size_t __alignment, size_t __size) _MALLOC_TYPED(malloc_type_posix_memalign, 3) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0);
|
||||
|
||||
__END_DECLS
|
||||
|
||||
|
||||
@@ -24,55 +24,59 @@
|
||||
#ifndef _MALLOC_UNDERSCORE_MALLOC_TYPE_H_
|
||||
#define _MALLOC_UNDERSCORE_MALLOC_TYPE_H_
|
||||
|
||||
/* !!!!!!!!!!!!!!!!!!!!! WARNING WARNING WARNING WARNING !!!!!!!!!!!!!!!!!!!!!
|
||||
* Typed Memory Operations and malloc_type_* functions constitute a private,
|
||||
* unstable interface. Don't use it, don't depend on it.
|
||||
* !!!!!!!!!!!!!!!!!!!!! WARNING WARNING WARNING WARNING !!!!!!!!!!!!!!!!!!!!!
|
||||
*/
|
||||
#include <malloc/_ptrcheck.h>
|
||||
__ptrcheck_abi_assume_single()
|
||||
|
||||
typedef unsigned long long malloc_type_id_t;
|
||||
|
||||
#if defined(__LP64__) /* MALLOC_TARGET_64BIT */
|
||||
|
||||
/* Included from <malloc/_malloc.h> so carefully manage what we include here. */
|
||||
// Included from <malloc/_malloc.h> so carefully manage what we include here.
|
||||
#include <Availability.h> /* __SPI_AVAILABLE */
|
||||
#include <sys/_types/_size_t.h> /* size_t */
|
||||
#if __has_include(<sys/_types/_size_t.h>)
|
||||
#include <sys/_types/_size_t.h>
|
||||
#else
|
||||
#define __need_size_t
|
||||
#include <stddef.h>
|
||||
#undef __need_size_t
|
||||
#endif
|
||||
#include <sys/cdefs.h> /* __BEGIN_DECLS */
|
||||
|
||||
#define _MALLOC_TYPE_AVAILABILITY __API_UNAVAILABLE(macos, ios, tvos, watchos, visionos)
|
||||
#define _MALLOC_TYPE_AVAILABILITY __API_AVAILABLE(macos(14.0), ios(17.0), tvos(17.0), watchos(10.0), visionos(1.0), driverkit(23.0))
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* <malloc/_malloc.h> */
|
||||
|
||||
typedef unsigned long long malloc_type_id_t;
|
||||
|
||||
_MALLOC_TYPE_AVAILABILITY void *malloc_type_malloc(size_t size, malloc_type_id_t type_id) __result_use_check __alloc_size(1);
|
||||
_MALLOC_TYPE_AVAILABILITY void *malloc_type_calloc(size_t count, size_t size, malloc_type_id_t type_id) __result_use_check __alloc_size(1,2);
|
||||
_MALLOC_TYPE_AVAILABILITY void malloc_type_free(void *ptr, malloc_type_id_t type_id);
|
||||
_MALLOC_TYPE_AVAILABILITY void *malloc_type_realloc(void *ptr, size_t size, malloc_type_id_t type_id) __result_use_check __alloc_size(2);
|
||||
_MALLOC_TYPE_AVAILABILITY void *malloc_type_valloc(size_t size, malloc_type_id_t type_id) __result_use_check __alloc_size(1);
|
||||
_MALLOC_TYPE_AVAILABILITY void *malloc_type_aligned_alloc(size_t alignment, size_t size, malloc_type_id_t type_id) __result_use_check __alloc_size(2);
|
||||
_MALLOC_TYPE_AVAILABILITY int malloc_type_posix_memalign(void **memptr, size_t alignment, size_t size, malloc_type_id_t type_id) /*__alloc_size(3)*/;
|
||||
_MALLOC_TYPE_AVAILABILITY void * __sized_by_or_null(size) malloc_type_malloc(size_t size, malloc_type_id_t type_id) __result_use_check __alloc_size(1);
|
||||
_MALLOC_TYPE_AVAILABILITY void * __sized_by_or_null(count * size) malloc_type_calloc(size_t count, size_t size, malloc_type_id_t type_id) __result_use_check __alloc_size(1,2);
|
||||
_MALLOC_TYPE_AVAILABILITY void malloc_type_free(void * __unsafe_indexable ptr, malloc_type_id_t type_id);
|
||||
_MALLOC_TYPE_AVAILABILITY void * __sized_by_or_null(size) malloc_type_realloc(void * __unsafe_indexable ptr, size_t size, malloc_type_id_t type_id) __result_use_check __alloc_size(2);
|
||||
_MALLOC_TYPE_AVAILABILITY void * __sized_by_or_null(size) malloc_type_valloc(size_t size, malloc_type_id_t type_id) __result_use_check __alloc_size(1);
|
||||
_MALLOC_TYPE_AVAILABILITY void * __sized_by_or_null(size) malloc_type_aligned_alloc(size_t alignment, size_t size, malloc_type_id_t type_id) __result_use_check __alloc_size(2);
|
||||
/* rdar://120689514 */
|
||||
_MALLOC_TYPE_AVAILABILITY int malloc_type_posix_memalign(void * __unsafe_indexable *memptr, size_t alignment, size_t size, malloc_type_id_t type_id) /*__alloc_size(3)*/;
|
||||
|
||||
|
||||
/* <malloc/malloc.h> */
|
||||
|
||||
typedef struct _malloc_zone_t malloc_zone_t;
|
||||
|
||||
_MALLOC_TYPE_AVAILABILITY void *malloc_type_zone_malloc(malloc_zone_t *zone, size_t size, malloc_type_id_t type_id) __result_use_check __alloc_size(2);
|
||||
_MALLOC_TYPE_AVAILABILITY void *malloc_type_zone_calloc(malloc_zone_t *zone, size_t count, size_t size, malloc_type_id_t type_id) __result_use_check __alloc_size(2,3);
|
||||
_MALLOC_TYPE_AVAILABILITY void malloc_type_zone_free(malloc_zone_t *zone, void *ptr, malloc_type_id_t type_id);
|
||||
_MALLOC_TYPE_AVAILABILITY void *malloc_type_zone_realloc(malloc_zone_t *zone, void *ptr, size_t size, malloc_type_id_t type_id) __result_use_check __alloc_size(3);
|
||||
_MALLOC_TYPE_AVAILABILITY void *malloc_type_zone_valloc(malloc_zone_t *zone, size_t size, malloc_type_id_t type_id) __result_use_check __alloc_size(2);
|
||||
_MALLOC_TYPE_AVAILABILITY void *malloc_type_zone_memalign(malloc_zone_t *zone, size_t alignment, size_t size, malloc_type_id_t type_id) __result_use_check __alloc_size(3);
|
||||
_MALLOC_TYPE_AVAILABILITY void * __sized_by_or_null(size) malloc_type_zone_malloc(malloc_zone_t *zone, size_t size, malloc_type_id_t type_id) __result_use_check __alloc_size(2);
|
||||
_MALLOC_TYPE_AVAILABILITY void * __sized_by_or_null(count * size) malloc_type_zone_calloc(malloc_zone_t *zone, size_t count, size_t size, malloc_type_id_t type_id) __result_use_check __alloc_size(2,3);
|
||||
_MALLOC_TYPE_AVAILABILITY void malloc_type_zone_free(malloc_zone_t *zone, void * __unsafe_indexable ptr, malloc_type_id_t type_id);
|
||||
_MALLOC_TYPE_AVAILABILITY void * __sized_by_or_null(size) malloc_type_zone_realloc(malloc_zone_t *zone, void * __unsafe_indexable ptr, size_t size, malloc_type_id_t type_id) __result_use_check __alloc_size(3);
|
||||
_MALLOC_TYPE_AVAILABILITY void *__sized_by_or_null(size) malloc_type_zone_valloc(malloc_zone_t *zone, size_t size, malloc_type_id_t type_id) __result_use_check __alloc_size(2);
|
||||
_MALLOC_TYPE_AVAILABILITY void *__sized_by_or_null(size) malloc_type_zone_memalign(malloc_zone_t *zone, size_t alignment, size_t size, malloc_type_id_t type_id) __result_use_check __alloc_size(3);
|
||||
|
||||
__END_DECLS
|
||||
|
||||
/* Rewrite enablement */
|
||||
#if defined(__has_feature) && __has_feature(typed_memory_operations)
|
||||
#if __has_builtin(__is_target_os) && __is_target_os(ios)
|
||||
#if __has_builtin(__is_target_os) && (__is_target_os(ios) || __is_target_os(driverkit) || __is_target_os(macos) || (__has_builtin(__is_target_environment) && (__is_target_environment(exclavekit) || __is_target_environment(exclavecore))))
|
||||
#define _MALLOC_TYPED(override, type_param_pos) __attribute__((typed_memory_operation(override, type_param_pos)))
|
||||
#define _MALLOC_TYPE_ENABLED 1
|
||||
#endif
|
||||
#endif
|
||||
#endif /* defined(__has_feature) && __has_feature(typed_memory_operations) */
|
||||
|
||||
#endif /* MALLOC_TARGET_64BIT */
|
||||
|
||||
80
lib/libc/include/any-macos-any/malloc/_platform.h
vendored
Normal file
80
lib/libc/include/any-macos-any/malloc/_platform.h
vendored
Normal file
@@ -0,0 +1,80 @@
|
||||
/*
|
||||
* Copyright (c) 2023 Apple Inc. All rights reserved.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_START@
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original Code
|
||||
* as defined in and that are subject to the Apple Public Source License
|
||||
* Version 2.0 (the 'License'). You may not use this file except in
|
||||
* compliance with the License. Please obtain a copy of the License at
|
||||
* http://www.opensource.apple.com/apsl/ and read it before using this
|
||||
* file.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
|
||||
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
|
||||
* Please see the License for the specific language governing rights and
|
||||
* limitations under the License.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_END@
|
||||
*/
|
||||
|
||||
#ifndef _MALLOC_UNDERSCORE_PLATFORM_H
|
||||
#define _MALLOC_UNDERSCORE_PLATFORM_H
|
||||
|
||||
#include <malloc/_ptrcheck.h>
|
||||
__ptrcheck_abi_assume_single()
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef __DARWIN_EXTSN
|
||||
#define __DARWIN_EXTSN(x)
|
||||
#endif /* __DARWIN_EXTSN */
|
||||
|
||||
#if __has_include(<mach/boolean.h>)
|
||||
#include <mach/boolean.h>
|
||||
#else
|
||||
typedef int boolean_t;
|
||||
#endif /* __has_include(<mach/boolean.h>) */
|
||||
|
||||
#if __has_include(<mach/kern_return.h>)
|
||||
#include <mach/kern_return.h>
|
||||
#else
|
||||
typedef int kern_return_t;
|
||||
#endif /* __has_include(<mach/kern_return.h>) */
|
||||
|
||||
#if __has_include(<mach/port.h>)
|
||||
#include <mach/port.h>
|
||||
#else
|
||||
typedef void * __single mach_port_t;
|
||||
#endif /* __has_include(<mach/port.h>) */
|
||||
|
||||
#if __has_include(<mach/mach_types.h>)
|
||||
#include <mach/mach_types.h>
|
||||
#else
|
||||
typedef mach_port_t task_t;
|
||||
#endif /* __has_include(<mach/mach_types.h>) */
|
||||
|
||||
#if __has_include(<mach/vm_types.h>)
|
||||
#include <mach/vm_types.h>
|
||||
#else
|
||||
typedef uint64_t mach_vm_address_t;
|
||||
typedef uint64_t mach_vm_offset_t;
|
||||
typedef uint64_t mach_vm_size_t;
|
||||
typedef uintptr_t vm_offset_t;
|
||||
typedef vm_offset_t vm_address_t;
|
||||
typedef uintptr_t vm_size_t;
|
||||
#endif /* __has_include(<mach/vm_types.h>) */
|
||||
|
||||
#if __has_include(<malloc/_malloc_type.h>) && !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
|
||||
#include <malloc/_malloc_type.h>
|
||||
#else
|
||||
#define _MALLOC_TYPED(override, type_param_pos)
|
||||
#endif
|
||||
|
||||
#endif /* _MALLOC_UNDERSCORE_PLATFORM_H */
|
||||
43
lib/libc/include/any-macos-any/malloc/_ptrcheck.h
vendored
Normal file
43
lib/libc/include/any-macos-any/malloc/_ptrcheck.h
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
* Copyright (c) 2023 Apple Computer, Inc. All rights reserved.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_START@
|
||||
*
|
||||
* This file contains Original Code and/or Modifications of Original Code
|
||||
* as defined in and that are subject to the Apple Public Source License
|
||||
* Version 2.0 (the 'License'). You may not use this file except in
|
||||
* compliance with the License. Please obtain a copy of the License at
|
||||
* http://www.opensource.apple.com/apsl/ and read it before using this
|
||||
* file.
|
||||
*
|
||||
* The Original Code and all software distributed under the License are
|
||||
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
|
||||
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
|
||||
* Please see the License for the specific language governing rights and
|
||||
* limitations under the License.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_END@
|
||||
*/
|
||||
|
||||
#ifndef _MALLOC_UNDERSCORE_PTRCHECK_H_
|
||||
#define _MALLOC_UNDERSCORE_PTRCHECK_H_
|
||||
|
||||
#if __has_include(<ptrcheck.h>)
|
||||
#include <ptrcheck.h>
|
||||
#else
|
||||
#define __has_ptrcheck 0
|
||||
#define __single
|
||||
#define __unsafe_indexable
|
||||
#define __counted_by(N)
|
||||
#define __counted_by_or_null(N)
|
||||
#define __sized_by(N)
|
||||
#define __sized_by_or_null(N)
|
||||
#define __ended_by(E)
|
||||
#define __terminated_by(T)
|
||||
#define __null_terminated
|
||||
#define __ptrcheck_abi_assume_single()
|
||||
#endif
|
||||
|
||||
#endif /* _MALLOC_UNDERSCORE_PTRCHECK_H_ */
|
||||
552
lib/libc/include/any-macos-any/malloc/malloc.h
vendored
552
lib/libc/include/any-macos-any/malloc/malloc.h
vendored
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
|
||||
* Copyright (c) 1999-2023 Apple Computer, Inc. All rights reserved.
|
||||
*
|
||||
* @APPLE_LICENSE_HEADER_START@
|
||||
*
|
||||
@@ -24,15 +24,13 @@
|
||||
#ifndef _MALLOC_MALLOC_H_
|
||||
#define _MALLOC_MALLOC_H_
|
||||
|
||||
#include <stddef.h>
|
||||
#include <mach/mach_types.h>
|
||||
#include <sys/cdefs.h>
|
||||
#include <TargetConditionals.h>
|
||||
#include <malloc/_platform.h>
|
||||
#include <Availability.h>
|
||||
#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
|
||||
#include <malloc/_malloc_type.h>
|
||||
#else
|
||||
#define _MALLOC_TYPED(override, type_param_pos)
|
||||
#endif
|
||||
#include <os/availability.h>
|
||||
|
||||
#include <malloc/_ptrcheck.h>
|
||||
__ptrcheck_abi_assume_single()
|
||||
|
||||
#if __has_feature(ptrauth_calls)
|
||||
#include <ptrauth.h>
|
||||
@@ -41,19 +39,19 @@
|
||||
// the zone can be copied). Process-independent because the zone structure may
|
||||
// be in the shared library cache.
|
||||
#define MALLOC_ZONE_FN_PTR(fn) __ptrauth(ptrauth_key_process_independent_code, \
|
||||
FALSE, ptrauth_string_discriminator("malloc_zone_fn." #fn)) fn
|
||||
0, ptrauth_string_discriminator("malloc_zone_fn." #fn)) fn
|
||||
|
||||
// Introspection function pointer, address- and type-diversified.
|
||||
// Process-independent because the malloc_introspection_t structure that contains
|
||||
// these pointers may be in the shared library cache.
|
||||
#define MALLOC_INTROSPECT_FN_PTR(fn) __ptrauth(ptrauth_key_process_independent_code, \
|
||||
TRUE, ptrauth_string_discriminator("malloc_introspect_fn." #fn)) fn
|
||||
1, ptrauth_string_discriminator("malloc_introspect_fn." #fn)) fn
|
||||
|
||||
// Pointer to the introspection pointer table, type-diversified but not
|
||||
// address-diversified (because the zone can be copied).
|
||||
// Process-independent because the table pointer may be in the shared library cache.
|
||||
#define MALLOC_INTROSPECT_TBL_PTR(ptr) __ptrauth(ptrauth_key_process_independent_data,\
|
||||
FALSE, ptrauth_string_discriminator("malloc_introspect_tbl")) ptr
|
||||
0, ptrauth_string_discriminator("malloc_introspect_tbl")) ptr
|
||||
|
||||
#endif // __has_feature(ptrauth_calls)
|
||||
|
||||
@@ -66,155 +64,393 @@
|
||||
__BEGIN_DECLS
|
||||
/********* Type definitions ************/
|
||||
|
||||
/*
|
||||
* Only zone implementors should depend on the layout of this structure;
|
||||
* Regular callers should use the access functions below
|
||||
*/
|
||||
typedef struct _malloc_zone_t {
|
||||
/* Only zone implementors should depend on the layout of this structure;
|
||||
Regular callers should use the access functions below */
|
||||
void *reserved1; /* RESERVED FOR CFAllocator DO NOT USE */
|
||||
void *reserved2; /* RESERVED FOR CFAllocator DO NOT USE */
|
||||
size_t (* MALLOC_ZONE_FN_PTR(size))(struct _malloc_zone_t *zone, const void *ptr); /* returns the size of a block or 0 if not in this zone; must be fast, especially for negative answers */
|
||||
void *(* MALLOC_ZONE_FN_PTR(malloc))(struct _malloc_zone_t *zone, size_t size);
|
||||
void *(* MALLOC_ZONE_FN_PTR(calloc))(struct _malloc_zone_t *zone, size_t num_items, size_t size); /* same as malloc, but block returned is set to zero */
|
||||
void *(* MALLOC_ZONE_FN_PTR(valloc))(struct _malloc_zone_t *zone, size_t size); /* same as malloc, but block returned is set to zero and is guaranteed to be page aligned */
|
||||
void (* MALLOC_ZONE_FN_PTR(free))(struct _malloc_zone_t *zone, void *ptr);
|
||||
void *(* MALLOC_ZONE_FN_PTR(realloc))(struct _malloc_zone_t *zone, void *ptr, size_t size);
|
||||
void (* MALLOC_ZONE_FN_PTR(destroy))(struct _malloc_zone_t *zone); /* zone is destroyed and all memory reclaimed */
|
||||
const char *zone_name;
|
||||
|
||||
/* Optional batch callbacks; these may be NULL */
|
||||
unsigned (* MALLOC_ZONE_FN_PTR(batch_malloc))(struct _malloc_zone_t *zone, size_t size, void **results, unsigned num_requested); /* given a size, returns pointers capable of holding that size; returns the number of pointers allocated (maybe 0 or less than num_requested) */
|
||||
void (* MALLOC_ZONE_FN_PTR(batch_free))(struct _malloc_zone_t *zone, void **to_be_freed, unsigned num_to_be_freed); /* frees all the pointers in to_be_freed; note that to_be_freed may be overwritten during the process */
|
||||
|
||||
struct malloc_introspection_t * MALLOC_INTROSPECT_TBL_PTR(introspect);
|
||||
unsigned version;
|
||||
|
||||
/* aligned memory allocation. The callback may be NULL. Present in version >= 5. */
|
||||
void *(* MALLOC_ZONE_FN_PTR(memalign))(struct _malloc_zone_t *zone, size_t alignment, size_t size);
|
||||
|
||||
/* free a pointer known to be in zone and known to have the given size. The callback may be NULL. Present in version >= 6.*/
|
||||
void (* MALLOC_ZONE_FN_PTR(free_definite_size))(struct _malloc_zone_t *zone, void *ptr, size_t size);
|
||||
|
||||
/* Empty out caches in the face of memory pressure. The callback may be NULL. Present in version >= 8. */
|
||||
size_t (* MALLOC_ZONE_FN_PTR(pressure_relief))(struct _malloc_zone_t *zone, size_t goal);
|
||||
void *reserved1; /* RESERVED FOR CFAllocator DO NOT USE */
|
||||
void *reserved2; /* RESERVED FOR CFAllocator DO NOT USE */
|
||||
|
||||
/*
|
||||
* Checks whether an address might belong to the zone. May be NULL. Present in version >= 10.
|
||||
* False positives are allowed (e.g. the pointer was freed, or it's in zone space that has
|
||||
* not yet been allocated. False negatives are not allowed.
|
||||
* Returns the size of a block or 0 if not in this zone; must be fast,
|
||||
* especially for negative answers.
|
||||
*/
|
||||
boolean_t (* MALLOC_ZONE_FN_PTR(claimed_address))(struct _malloc_zone_t *zone, void *ptr);
|
||||
size_t (* MALLOC_ZONE_FN_PTR(size))(struct _malloc_zone_t *zone,
|
||||
const void * __unsafe_indexable ptr);
|
||||
|
||||
/* For zone 0 implementations: try to free ptr, promising to call find_zone_and_free
|
||||
* if it turns out not to belong to us */
|
||||
void (* MALLOC_ZONE_FN_PTR(try_free_default))(struct _malloc_zone_t *zone, void *ptr);
|
||||
void * __sized_by_or_null(size) (* MALLOC_ZONE_FN_PTR(malloc))(
|
||||
struct _malloc_zone_t *zone, size_t size);
|
||||
|
||||
/* Same as malloc, but block returned is set to zero */
|
||||
void * __sized_by_or_null(num_items * size) (* MALLOC_ZONE_FN_PTR(calloc))(
|
||||
struct _malloc_zone_t *zone, size_t num_items, size_t size);
|
||||
|
||||
/* Same as malloc, but block returned is guaranteed to be page-aligned */
|
||||
void * __sized_by_or_null(size) (* MALLOC_ZONE_FN_PTR(valloc))(
|
||||
struct _malloc_zone_t *zone, size_t size);
|
||||
|
||||
void (* MALLOC_ZONE_FN_PTR(free))(struct _malloc_zone_t *zone,
|
||||
void * __unsafe_indexable ptr);
|
||||
|
||||
void * __sized_by_or_null(size) (* MALLOC_ZONE_FN_PTR(realloc))(
|
||||
struct _malloc_zone_t *zone, void * __unsafe_indexable ptr,
|
||||
size_t size);
|
||||
|
||||
/* Zone is destroyed and all memory reclaimed */
|
||||
void (* MALLOC_ZONE_FN_PTR(destroy))(struct _malloc_zone_t *zone);
|
||||
|
||||
const char * __null_terminated zone_name;
|
||||
|
||||
/* Optional batch callbacks; these may be NULL */
|
||||
|
||||
/*
|
||||
* Given a size, returns pointers capable of holding that size; returns the
|
||||
* number of pointers allocated (maybe 0 or less than num_requested)
|
||||
*/
|
||||
unsigned (* MALLOC_ZONE_FN_PTR(batch_malloc))(struct _malloc_zone_t *zone,
|
||||
size_t size,
|
||||
void * __unsafe_indexable * __counted_by(num_requested) results,
|
||||
unsigned num_requested);
|
||||
|
||||
/*
|
||||
* Frees all the pointers in to_be_freed; note that to_be_freed may be
|
||||
* overwritten during the process
|
||||
*/
|
||||
void (* MALLOC_ZONE_FN_PTR(batch_free))(struct _malloc_zone_t *zone,
|
||||
void * __unsafe_indexable * __counted_by(num_to_be_freed) to_be_freed,
|
||||
unsigned num_to_be_freed);
|
||||
|
||||
struct malloc_introspection_t * MALLOC_INTROSPECT_TBL_PTR(introspect);
|
||||
unsigned version;
|
||||
|
||||
/* Aligned memory allocation. May be NULL. Present in version >= 5. */
|
||||
void * __sized_by_or_null(size) (* MALLOC_ZONE_FN_PTR(memalign))(
|
||||
struct _malloc_zone_t *zone, size_t alignment, size_t size);
|
||||
|
||||
/*
|
||||
* Free a pointer known to be in zone and known to have the given size.
|
||||
* May be NULL. Present in version >= 6.
|
||||
*/
|
||||
void (* MALLOC_ZONE_FN_PTR(free_definite_size))(struct _malloc_zone_t *zone,
|
||||
void * __sized_by(size) ptr, size_t size);
|
||||
|
||||
/*
|
||||
* Empty out caches in the face of memory pressure. May be NULL.
|
||||
* Present in version >= 8.
|
||||
*/
|
||||
size_t (* MALLOC_ZONE_FN_PTR(pressure_relief))(struct _malloc_zone_t *zone,
|
||||
size_t goal);
|
||||
|
||||
/*
|
||||
* Checks whether an address might belong to the zone. May be NULL. Present
|
||||
* in version >= 10. False positives are allowed (e.g. the pointer was
|
||||
* freed, or it's in zone space that has not yet been allocated. False
|
||||
* negatives are not allowed.
|
||||
*/
|
||||
boolean_t (* MALLOC_ZONE_FN_PTR(claimed_address))(
|
||||
struct _malloc_zone_t *zone, void * __unsafe_indexable ptr);
|
||||
|
||||
/*
|
||||
* For libmalloc-internal zone 0 implementations only: try to free ptr,
|
||||
* promising to call find_zone_and_free if it turns out not to belong to us.
|
||||
* May be present in version >= 13.
|
||||
*/
|
||||
void (* MALLOC_ZONE_FN_PTR(try_free_default))(struct _malloc_zone_t *zone,
|
||||
void * __unsafe_indexable ptr);
|
||||
|
||||
/*
|
||||
* Memory allocation with an extensible binary flags option. Currently for
|
||||
* libmalloc-internal zone implementations only - should be NULL otherwise.
|
||||
* Added in version >= 15.
|
||||
*/
|
||||
void * __sized_by_or_null(size) (* MALLOC_ZONE_FN_PTR(malloc_with_options))(
|
||||
struct _malloc_zone_t *zone, size_t align, size_t size,
|
||||
uint64_t options);
|
||||
|
||||
/*
|
||||
* Typed Memory Operations versions of zone functions. Present in
|
||||
* version >= 16.
|
||||
*/
|
||||
|
||||
void * __sized_by_or_null(size) (* MALLOC_ZONE_FN_PTR(malloc_type_malloc))(
|
||||
struct _malloc_zone_t *zone, size_t size, malloc_type_id_t type_id);
|
||||
|
||||
void * __sized_by_or_null(count * size) (* MALLOC_ZONE_FN_PTR(malloc_type_calloc))(
|
||||
struct _malloc_zone_t *zone, size_t count, size_t size,
|
||||
malloc_type_id_t type_id);
|
||||
|
||||
void * __sized_by_or_null(size) (* MALLOC_ZONE_FN_PTR(malloc_type_realloc))(
|
||||
struct _malloc_zone_t *zone, void * __unsafe_indexable ptr,
|
||||
size_t size, malloc_type_id_t type_id);
|
||||
|
||||
void * __sized_by_or_null(size) (* MALLOC_ZONE_FN_PTR(malloc_type_memalign))(
|
||||
struct _malloc_zone_t *zone, size_t alignment, size_t size,
|
||||
malloc_type_id_t type_id);
|
||||
|
||||
/* Must be NULL for non-libmalloc zone implementations */
|
||||
void * __sized_by_or_null(size) (* MALLOC_ZONE_FN_PTR(malloc_type_malloc_with_options))(
|
||||
struct _malloc_zone_t *zone, size_t align, size_t size, uint64_t options,
|
||||
malloc_type_id_t type_id);
|
||||
} malloc_zone_t;
|
||||
|
||||
/*!
|
||||
* @enum malloc_type_callsite_flags_v0_t
|
||||
*
|
||||
* Information about where and how malloc was called
|
||||
*
|
||||
* @constant MALLOC_TYPE_CALLSITE_FLAGS_V0_FIXED_SIZE
|
||||
* Set in malloc_type_summary_v0_t if the call to malloc was called with a fixed
|
||||
* size. Note that, at present, this bit is set in all callsites where the
|
||||
* compiler rewrites a call to malloc
|
||||
*
|
||||
* @constant MALLOC_TYPE_CALLSITE_FLAGS_V0_ARRAY
|
||||
* Set in malloc_type_summary_v0_t if the type being allocated is an array, e.g.
|
||||
* allocated via new[] or calloc(count, size)
|
||||
*/
|
||||
typedef enum {
|
||||
MALLOC_TYPE_CALLSITE_FLAGS_V0_NONE = 0,
|
||||
MALLOC_TYPE_CALLSITE_FLAGS_V0_FIXED_SIZE = 1 << 0,
|
||||
MALLOC_TYPE_CALLSITE_FLAGS_V0_ARRAY = 1 << 1,
|
||||
} malloc_type_callsite_flags_v0_t;
|
||||
|
||||
/*!
|
||||
* @enum malloc_type_kind_v0_t
|
||||
*
|
||||
* @constant MALLOC_TYPE_KIND_V0_OTHER
|
||||
* Default allocation type, used for most calls to malloc
|
||||
*
|
||||
* @constant MALLOC_TYPE_KIND_V0_OBJC
|
||||
* Marks a type allocated by libobjc
|
||||
*
|
||||
* @constant MALLOC_TYPE_KIND_V0_SWIFT
|
||||
* Marks a type allocated by the Swift runtime
|
||||
*
|
||||
* @constant MALLOC_TYPE_KIND_V0_CXX
|
||||
* Marks a type allocated by the C++ runtime's operator new
|
||||
*/
|
||||
typedef enum {
|
||||
MALLOC_TYPE_KIND_V0_OTHER = 0,
|
||||
MALLOC_TYPE_KIND_V0_OBJC = 1,
|
||||
MALLOC_TYPE_KIND_V0_SWIFT = 2,
|
||||
MALLOC_TYPE_KIND_V0_CXX = 3
|
||||
} malloc_type_kind_v0_t;
|
||||
|
||||
/*!
|
||||
* @struct malloc_type_layout_semantics_v0_t
|
||||
*
|
||||
* @field contains_data_pointer
|
||||
* True if the allocated type or any of its fields is a pointer
|
||||
* to a data type (i.e. the pointee contains no pointers)
|
||||
*
|
||||
* @field contains_struct_pointer
|
||||
* True if the allocated type or any of its fields is a pointer
|
||||
* to a struct or union
|
||||
*
|
||||
* @field contains_immutable_pointer
|
||||
* True if the allocated type or any of its fields is a const pointer
|
||||
*
|
||||
* @field contains_anonymous_pointer
|
||||
* True if the allocated type or any of its fields is a pointer
|
||||
* to something other than a struct or data type
|
||||
*
|
||||
* @field is_reference_counted
|
||||
* True if the allocated type is reference counted
|
||||
*
|
||||
* @field contains_generic_data
|
||||
* True if the allocated type or any of its fields are not pointers
|
||||
*/
|
||||
typedef struct {
|
||||
bool contains_data_pointer : 1;
|
||||
bool contains_struct_pointer : 1;
|
||||
bool contains_immutable_pointer : 1;
|
||||
bool contains_anonymous_pointer : 1;
|
||||
bool is_reference_counted : 1;
|
||||
uint16_t reserved_0 : 3;
|
||||
bool contains_generic_data : 1;
|
||||
uint16_t reserved_1 : 7;
|
||||
} malloc_type_layout_semantics_v0_t;
|
||||
|
||||
/*!
|
||||
* @struct malloc_type_summary_v0_t
|
||||
*
|
||||
* @field version
|
||||
* Versioning field of the type summary. Set to 0 for the current verison. New
|
||||
* fields can be added where the reserved fields currently are without
|
||||
* incrementing the version, as long as they are non-breaking.
|
||||
*
|
||||
* @field callsite_flags
|
||||
* Details from the callsite of malloc inferred by the compiler
|
||||
*
|
||||
* @field type_kind
|
||||
* Details about the runtime making the allocation
|
||||
*
|
||||
* @field layout_semantics
|
||||
* Details about what kinds of data are contained in the type being allocated
|
||||
*
|
||||
* @discussion
|
||||
* The reserved fields should not be read from or written to, and may be
|
||||
* used for additional fields and information in future versions
|
||||
*/
|
||||
typedef struct {
|
||||
uint32_t version : 4;
|
||||
uint32_t reserved_0 : 2;
|
||||
malloc_type_callsite_flags_v0_t callsite_flags : 4;
|
||||
malloc_type_kind_v0_t type_kind : 2;
|
||||
uint32_t reserved_1 : 4;
|
||||
malloc_type_layout_semantics_v0_t layout_semantics;
|
||||
} malloc_type_summary_v0_t;
|
||||
|
||||
/*!
|
||||
* @union malloc_type_descriptor_v0_t
|
||||
*
|
||||
* @field hash
|
||||
* Hash of the type layout of the allocated type, or if type inference failed,
|
||||
* the hash of the callsite's file, line and column. The hash allows the
|
||||
* allocator to disambiguate between different types with the same summary, e.g.
|
||||
* types that have the same fields in different orders.
|
||||
*
|
||||
* @field summary
|
||||
* Details of the type being allocated
|
||||
*
|
||||
* @field type_id
|
||||
* opaque type used for punning
|
||||
*
|
||||
* @discussion
|
||||
* Use malloc_type_descriptor_v0_t to decode the opaque malloc_type_id_t with
|
||||
* version == 0 into a malloc_type_summary_v0_t:
|
||||
*
|
||||
* <code>
|
||||
* malloc_type_descriptor_v0_t desc = (malloc_type_descriptor_v0_t){ .type_id = id };
|
||||
* </code>
|
||||
*
|
||||
* See LLVM documentation for more details
|
||||
*/
|
||||
typedef union {
|
||||
struct {
|
||||
uint32_t hash;
|
||||
malloc_type_summary_v0_t summary;
|
||||
};
|
||||
malloc_type_id_t type_id;
|
||||
} malloc_type_descriptor_v0_t;
|
||||
|
||||
/********* Creation and destruction ************/
|
||||
|
||||
extern malloc_zone_t *malloc_default_zone(void);
|
||||
/* The initial zone */
|
||||
/* The initial zone */
|
||||
|
||||
#if !0 && !0
|
||||
extern malloc_zone_t *malloc_create_zone(vm_size_t start_size, unsigned flags);
|
||||
/* Creates a new zone with default behavior and registers it */
|
||||
/* Creates a new zone with default behavior and registers it */
|
||||
|
||||
extern void malloc_destroy_zone(malloc_zone_t *zone);
|
||||
/* Destroys zone and everything it allocated */
|
||||
/* Destroys zone and everything it allocated */
|
||||
#endif
|
||||
|
||||
/********* Block creation and manipulation ************/
|
||||
|
||||
extern void *malloc_zone_malloc(malloc_zone_t *zone, size_t size) __alloc_size(2) _MALLOC_TYPED(malloc_type_zone_malloc, 2);
|
||||
/* Allocates a new pointer of size size; zone must be non-NULL */
|
||||
extern void * __sized_by_or_null(size) malloc_zone_malloc(malloc_zone_t *zone, size_t size) __alloc_size(2) _MALLOC_TYPED(malloc_type_zone_malloc, 2);
|
||||
/* Allocates a new pointer of size size; zone must be non-NULL */
|
||||
|
||||
extern void *malloc_zone_calloc(malloc_zone_t *zone, size_t num_items, size_t size) __alloc_size(2,3) _MALLOC_TYPED(malloc_type_zone_calloc, 3);
|
||||
/* Allocates a new pointer of size num_items * size; block is cleared; zone must be non-NULL */
|
||||
extern void * __sized_by_or_null(num_items * size) malloc_zone_calloc(malloc_zone_t *zone, size_t num_items, size_t size) __alloc_size(2,3) _MALLOC_TYPED(malloc_type_zone_calloc, 3);
|
||||
/* Allocates a new pointer of size num_items * size; block is cleared; zone must be non-NULL */
|
||||
|
||||
extern void *malloc_zone_valloc(malloc_zone_t *zone, size_t size) __alloc_size(2) _MALLOC_TYPED(malloc_type_zone_valloc, 2);
|
||||
/* Allocates a new pointer of size size; zone must be non-NULL; Pointer is guaranteed to be page-aligned and block is cleared */
|
||||
extern void * __sized_by_or_null(size) malloc_zone_valloc(malloc_zone_t *zone, size_t size) __alloc_size(2) _MALLOC_TYPED(malloc_type_zone_valloc, 2);
|
||||
/* Allocates a new pointer of size size; zone must be non-NULL; Pointer is guaranteed to be page-aligned and block is cleared */
|
||||
|
||||
extern void malloc_zone_free(malloc_zone_t *zone, void *ptr);
|
||||
/* Frees pointer in zone; zone must be non-NULL */
|
||||
extern void malloc_zone_free(malloc_zone_t *zone, void * __unsafe_indexable ptr);
|
||||
/* Frees pointer in zone; zone must be non-NULL */
|
||||
|
||||
extern void *malloc_zone_realloc(malloc_zone_t *zone, void *ptr, size_t size) __alloc_size(3) _MALLOC_TYPED(malloc_type_zone_realloc, 3);
|
||||
/* Enlarges block if necessary; zone must be non-NULL */
|
||||
extern void * __sized_by_or_null(size) malloc_zone_realloc(malloc_zone_t *zone, void * __unsafe_indexable ptr, size_t size) __alloc_size(3) _MALLOC_TYPED(malloc_type_zone_realloc, 3);
|
||||
/* Enlarges block if necessary; zone must be non-NULL */
|
||||
|
||||
extern malloc_zone_t *malloc_zone_from_ptr(const void *ptr);
|
||||
/* Returns the zone for a pointer, or NULL if not in any zone.
|
||||
The ptr must have been returned from a malloc or realloc call. */
|
||||
extern malloc_zone_t *malloc_zone_from_ptr(const void * __unsafe_indexable ptr);
|
||||
/* Returns the zone for a pointer, or NULL if not in any zone.
|
||||
The ptr must have been returned from a malloc or realloc call. */
|
||||
|
||||
extern size_t malloc_size(const void *ptr);
|
||||
/* Returns size of given ptr, including any padding inserted by the allocator */
|
||||
extern size_t malloc_size(const void * __unsafe_indexable ptr);
|
||||
/* Returns size of given ptr, including any padding inserted by the allocator */
|
||||
|
||||
extern size_t malloc_good_size(size_t size);
|
||||
/* Returns number of bytes greater than or equal to size that can be allocated without padding */
|
||||
/* Returns number of bytes greater than or equal to size that can be allocated without padding */
|
||||
|
||||
extern void *malloc_zone_memalign(malloc_zone_t *zone, size_t alignment, size_t size) __alloc_size(3) _MALLOC_TYPED(malloc_type_zone_memalign, 3) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0);
|
||||
/*
|
||||
* Allocates a new pointer of size size whose address is an exact multiple of alignment.
|
||||
* alignment must be a power of two and at least as large as sizeof(void *).
|
||||
* zone must be non-NULL.
|
||||
*/
|
||||
extern void * __sized_by_or_null(size) malloc_zone_memalign(malloc_zone_t *zone, size_t alignment, size_t size) __alloc_align(2) __alloc_size(3) _MALLOC_TYPED(malloc_type_zone_memalign, 3) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0);
|
||||
/*
|
||||
* Allocates a new pointer of size size whose address is an exact multiple of alignment.
|
||||
* alignment must be a power of two and at least as large as sizeof(void *).
|
||||
* zone must be non-NULL.
|
||||
*/
|
||||
|
||||
/********* Batch methods ************/
|
||||
|
||||
extern unsigned malloc_zone_batch_malloc(malloc_zone_t *zone, size_t size, void **results, unsigned num_requested);
|
||||
/* Allocates num blocks of the same size; Returns the number truly allocated (may be 0) */
|
||||
#if !0 && !0
|
||||
extern unsigned malloc_zone_batch_malloc(malloc_zone_t *zone, size_t size, void * __unsafe_indexable * __counted_by(num_requested) results, unsigned num_requested);
|
||||
/* Allocates num blocks of the same size; Returns the number truly allocated (may be 0) */
|
||||
|
||||
extern void malloc_zone_batch_free(malloc_zone_t *zone, void **to_be_freed, unsigned num);
|
||||
/* frees all the pointers in to_be_freed; note that to_be_freed may be overwritten during the process; This function will always free even if the zone has no batch callback */
|
||||
extern void malloc_zone_batch_free(malloc_zone_t *zone, void * __unsafe_indexable * __counted_by(num) to_be_freed, unsigned num);
|
||||
/* frees all the pointers in to_be_freed; note that to_be_freed may be overwritten during the process; This function will always free even if the zone has no batch callback */
|
||||
#endif
|
||||
|
||||
/********* Functions for libcache ************/
|
||||
|
||||
#if !0 && !0
|
||||
extern malloc_zone_t *malloc_default_purgeable_zone(void) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0);
|
||||
/* Returns a pointer to the default purgeable_zone. */
|
||||
/* Returns a pointer to the default purgeable_zone. */
|
||||
|
||||
extern void malloc_make_purgeable(void *ptr) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0);
|
||||
/* Make an allocation from the purgeable zone purgeable if possible. */
|
||||
extern void malloc_make_purgeable(void * __unsafe_indexable ptr) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0);
|
||||
/* Make an allocation from the purgeable zone purgeable if possible. */
|
||||
|
||||
extern int malloc_make_nonpurgeable(void *ptr) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0);
|
||||
/* Makes an allocation from the purgeable zone nonpurgeable.
|
||||
* Returns zero if the contents were not purged since the last
|
||||
* call to malloc_make_purgeable, else returns non-zero. */
|
||||
extern int malloc_make_nonpurgeable(void * __unsafe_indexable ptr) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0);
|
||||
/* Makes an allocation from the purgeable zone nonpurgeable.
|
||||
* Returns zero if the contents were not purged since the last
|
||||
* call to malloc_make_purgeable, else returns non-zero. */
|
||||
#endif
|
||||
|
||||
/********* Functions for zone implementors ************/
|
||||
|
||||
#if !0 && !0
|
||||
extern void malloc_zone_register(malloc_zone_t *zone);
|
||||
/* Registers a custom malloc zone; Should typically be called after a
|
||||
* malloc_zone_t has been filled in with custom methods by a client. See
|
||||
* malloc_create_zone for creating additional malloc zones with the
|
||||
* default allocation and free behavior. */
|
||||
/* Registers a custom malloc zone; Should typically be called after a
|
||||
* malloc_zone_t has been filled in with custom methods by a client. See
|
||||
* malloc_create_zone for creating additional malloc zones with the
|
||||
* default allocation and free behavior. */
|
||||
|
||||
extern void malloc_zone_unregister(malloc_zone_t *zone);
|
||||
/* De-registers a zone
|
||||
Should typically be called before calling the zone destruction routine */
|
||||
/* De-registers a zone
|
||||
Should typically be called before calling the zone destruction routine */
|
||||
#endif
|
||||
|
||||
extern void malloc_set_zone_name(malloc_zone_t *zone, const char *name);
|
||||
/* Sets the name of a zone */
|
||||
extern void malloc_set_zone_name(malloc_zone_t *zone, const char * __null_terminated name);
|
||||
/* Sets the name of a zone */
|
||||
|
||||
extern const char *malloc_get_zone_name(malloc_zone_t *zone);
|
||||
/* Returns the name of a zone */
|
||||
/* Returns the name of a zone */
|
||||
|
||||
#if !0 && !0
|
||||
size_t malloc_zone_pressure_relief(malloc_zone_t *zone, size_t goal) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
|
||||
/* malloc_zone_pressure_relief() advises the malloc subsystem that the process is under memory pressure and
|
||||
* that the subsystem should make its best effort towards releasing (i.e. munmap()-ing) "goal" bytes from "zone".
|
||||
* If "goal" is passed as zero, the malloc subsystem will attempt to achieve maximal pressure relief in "zone".
|
||||
* If "zone" is passed as NULL, all zones are examined for pressure relief opportunities.
|
||||
* malloc_zone_pressure_relief() returns the number of bytes released.
|
||||
*/
|
||||
/* malloc_zone_pressure_relief() advises the malloc subsystem that the process is under memory pressure and
|
||||
* that the subsystem should make its best effort towards releasing (i.e. munmap()-ing) "goal" bytes from "zone".
|
||||
* If "goal" is passed as zero, the malloc subsystem will attempt to achieve maximal pressure relief in "zone".
|
||||
* If "zone" is passed as NULL, all zones are examined for pressure relief opportunities.
|
||||
* malloc_zone_pressure_relief() returns the number of bytes released.
|
||||
*/
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
vm_address_t address;
|
||||
vm_size_t size;
|
||||
vm_address_t address;
|
||||
vm_size_t size;
|
||||
} vm_range_t;
|
||||
|
||||
typedef struct malloc_statistics_t {
|
||||
unsigned blocks_in_use;
|
||||
size_t size_in_use;
|
||||
size_t max_size_in_use; /* high water mark of touched memory */
|
||||
size_t size_allocated; /* reserved in memory */
|
||||
unsigned blocks_in_use;
|
||||
size_t size_in_use;
|
||||
size_t max_size_in_use; /* high water mark of touched memory */
|
||||
size_t size_allocated; /* reserved in memory */
|
||||
} malloc_statistics_t;
|
||||
|
||||
typedef kern_return_t memory_reader_t(task_t remote_task, vm_address_t remote_address, vm_size_t size, void **local_memory);
|
||||
/* given a task, "reads" the memory at the given address and size
|
||||
local_memory: set to a contiguous chunk of memory; validity of local_memory is assumed to be limited (until next call) */
|
||||
typedef kern_return_t memory_reader_t(task_t remote_task, vm_address_t remote_address, vm_size_t size, void * __sized_by(size) *local_memory);
|
||||
/* given a task, "reads" the memory at the given address and size
|
||||
local_memory: set to a contiguous chunk of memory; validity of local_memory is assumed to be limited (until next call) */
|
||||
|
||||
#define MALLOC_PTR_IN_USE_RANGE_TYPE 1 /* for allocated pointers */
|
||||
#define MALLOC_PTR_REGION_RANGE_TYPE 2 /* for region containing pointers */
|
||||
@@ -222,102 +458,112 @@ local_memory: set to a contiguous chunk of memory; validity of local_memory is a
|
||||
#define MALLOC_ZONE_SPECIFIC_FLAGS 0xff00 /* bits reserved for zone-specific purposes */
|
||||
|
||||
typedef void vm_range_recorder_t(task_t, void *, unsigned type, vm_range_t *, unsigned);
|
||||
/* given a task and context, "records" the specified addresses */
|
||||
/* given a task and context, "records" the specified addresses */
|
||||
|
||||
/* Print function for the print_task() operation. */
|
||||
typedef void print_task_printer_t(const char *fmt, ...) __printflike(1,2);
|
||||
typedef void print_task_printer_t(const char * __null_terminated fmt, ...) __printflike(1,2);
|
||||
|
||||
typedef struct malloc_introspection_t {
|
||||
kern_return_t (* MALLOC_INTROSPECT_FN_PTR(enumerator))(task_t task, void *, unsigned type_mask, vm_address_t zone_address, memory_reader_t reader, vm_range_recorder_t recorder); /* enumerates all the malloc pointers in use */
|
||||
size_t (* MALLOC_INTROSPECT_FN_PTR(good_size))(malloc_zone_t *zone, size_t size);
|
||||
boolean_t (* MALLOC_INTROSPECT_FN_PTR(check))(malloc_zone_t *zone); /* Consistency checker */
|
||||
void (* MALLOC_INTROSPECT_FN_PTR(print))(malloc_zone_t *zone, boolean_t verbose); /* Prints zone */
|
||||
void (* MALLOC_INTROSPECT_FN_PTR(log))(malloc_zone_t *zone, void *address); /* Enables logging of activity */
|
||||
void (* MALLOC_INTROSPECT_FN_PTR(print))(malloc_zone_t *zone, boolean_t verbose); /* Prints zone */
|
||||
void (* MALLOC_INTROSPECT_FN_PTR(log))(malloc_zone_t *zone, void * __unsafe_indexable address); /* Enables logging of activity */
|
||||
void (* MALLOC_INTROSPECT_FN_PTR(force_lock))(malloc_zone_t *zone); /* Forces locking zone */
|
||||
void (* MALLOC_INTROSPECT_FN_PTR(force_unlock))(malloc_zone_t *zone); /* Forces unlocking zone */
|
||||
void (* MALLOC_INTROSPECT_FN_PTR(statistics))(malloc_zone_t *zone, malloc_statistics_t *stats); /* Fills statistics */
|
||||
boolean_t (* MALLOC_INTROSPECT_FN_PTR(zone_locked))(malloc_zone_t *zone); /* Are any zone locks held */
|
||||
boolean_t (* MALLOC_INTROSPECT_FN_PTR(zone_locked))(malloc_zone_t *zone); /* Are any zone locks held */
|
||||
|
||||
/* Discharge checking. Present in version >= 7. */
|
||||
/* Discharge checking. Present in version >= 7. */
|
||||
boolean_t (* MALLOC_INTROSPECT_FN_PTR(enable_discharge_checking))(malloc_zone_t *zone);
|
||||
void (* MALLOC_INTROSPECT_FN_PTR(disable_discharge_checking))(malloc_zone_t *zone);
|
||||
void (* MALLOC_INTROSPECT_FN_PTR(discharge))(malloc_zone_t *zone, void *memory);
|
||||
void (* MALLOC_INTROSPECT_FN_PTR(discharge))(malloc_zone_t *zone, void * __unsafe_indexable memory);
|
||||
#ifdef __BLOCKS__
|
||||
void (* MALLOC_INTROSPECT_FN_PTR(enumerate_discharged_pointers))(malloc_zone_t *zone, void (^report_discharged)(void *memory, void *info));
|
||||
void (* MALLOC_INTROSPECT_FN_PTR(enumerate_discharged_pointers))(malloc_zone_t *zone, void (^report_discharged)(void *memory, void *info));
|
||||
#else
|
||||
void *enumerate_unavailable_without_blocks;
|
||||
void *enumerate_unavailable_without_blocks;
|
||||
#endif /* __BLOCKS__ */
|
||||
void (* MALLOC_INTROSPECT_FN_PTR(reinit_lock))(malloc_zone_t *zone); /* Reinitialize zone locks, called only from atfork_child handler. Present in version >= 9. */
|
||||
void (* MALLOC_INTROSPECT_FN_PTR(print_task))(task_t task, unsigned level, vm_address_t zone_address, memory_reader_t reader, print_task_printer_t printer); /* debug print for another process. Present in version >= 11. */
|
||||
void (* MALLOC_INTROSPECT_FN_PTR(task_statistics))(task_t task, vm_address_t zone_address, memory_reader_t reader, malloc_statistics_t *stats); /* Present in version >= 12. */
|
||||
unsigned zone_type; /* Identifies the zone type. 0 means unknown/undefined zone type. Present in version >= 14. */
|
||||
unsigned zone_type; /* Identifies the zone type. 0 means unknown/undefined zone type. Present in version >= 14. */
|
||||
} malloc_introspection_t;
|
||||
|
||||
// The value of "level" when passed to print_task() that corresponds to
|
||||
// verbose passed to print()
|
||||
#define MALLOC_VERBOSE_PRINT_LEVEL 2
|
||||
|
||||
extern void malloc_printf(const char *format, ...);
|
||||
/* Convenience for logging errors and warnings;
|
||||
No allocation is performed during execution of this function;
|
||||
Only understands usual %p %d %s formats, and %y that expresses a number of bytes (5b,10KB,1MB...)
|
||||
*/
|
||||
#if !0 && !0
|
||||
extern void malloc_printf(const char * __null_terminated format, ...) __printflike(1,2);
|
||||
/* Convenience for logging errors and warnings;
|
||||
No allocation is performed during execution of this function;
|
||||
Only understands usual %p %d %s formats, and %y that expresses a number of bytes (5b,10KB,1MB...)
|
||||
*/
|
||||
#endif
|
||||
|
||||
/********* Functions for performance tools ************/
|
||||
|
||||
extern kern_return_t malloc_get_all_zones(task_t task, memory_reader_t reader, vm_address_t **addresses, unsigned *count);
|
||||
/* Fills addresses and count with the addresses of the zones in task;
|
||||
Note that the validity of the addresses returned correspond to the validity of the memory returned by reader */
|
||||
#if !0 && !0
|
||||
extern kern_return_t malloc_get_all_zones(task_t task, memory_reader_t reader, vm_address_t * __single * __counted_by(*count) addresses, unsigned *count);
|
||||
/* Fills addresses and count with the addresses of the zones in task;
|
||||
Note that the validity of the addresses returned correspond to the validity reader */
|
||||
#endif
|
||||
|
||||
/********* Debug helpers ************/
|
||||
|
||||
extern void malloc_zone_print_ptr_info(void *ptr);
|
||||
/* print to stdout if this pointer is in the malloc heap, free status, and size */
|
||||
extern void malloc_zone_print_ptr_info(void * __unsafe_indexable ptr);
|
||||
/* print to stdout if this pointer is in the malloc heap, free status, and size */
|
||||
|
||||
extern boolean_t malloc_zone_check(malloc_zone_t *zone);
|
||||
/* Checks zone is well formed; if !zone, checks all zones */
|
||||
/* Checks zone is well formed; if !zone, checks all zones */
|
||||
|
||||
extern void malloc_zone_print(malloc_zone_t *zone, boolean_t verbose);
|
||||
/* Prints summary on zone; if !zone, prints all zones */
|
||||
/* Prints summary on zone; if !zone, prints all zones */
|
||||
|
||||
#if !0 && !0
|
||||
extern void malloc_zone_statistics(malloc_zone_t *zone, malloc_statistics_t *stats);
|
||||
/* Fills statistics for zone; if !zone, sums up all zones */
|
||||
/* Fills statistics for zone; if !zone, sums up all zones */
|
||||
|
||||
extern void malloc_zone_log(malloc_zone_t *zone, void *address);
|
||||
/* Controls logging of all activity; if !zone, for all zones;
|
||||
If address==0 nothing is logged;
|
||||
If address==-1 all activity is logged;
|
||||
Else only the activity regarding address is logged */
|
||||
extern void malloc_zone_log(malloc_zone_t *zone, void * __unsafe_indexable address);
|
||||
/* Controls logging of all activity; if !zone, for all zones;
|
||||
If address==0 nothing is logged;
|
||||
If address==-1 all activity is logged;
|
||||
Else only the activity regarding address is logged */
|
||||
#endif
|
||||
|
||||
struct mstats {
|
||||
size_t bytes_total;
|
||||
size_t chunks_used;
|
||||
size_t bytes_used;
|
||||
size_t chunks_free;
|
||||
size_t bytes_free;
|
||||
size_t bytes_total;
|
||||
size_t chunks_used;
|
||||
size_t bytes_used;
|
||||
size_t chunks_free;
|
||||
size_t bytes_free;
|
||||
};
|
||||
|
||||
#if !0 && !0
|
||||
extern struct mstats mstats(void);
|
||||
|
||||
extern boolean_t malloc_zone_enable_discharge_checking(malloc_zone_t *zone) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
|
||||
/* Increment the discharge checking enabled counter for a zone. Returns true if the zone supports checking, false if it does not. */
|
||||
/* Increment the discharge checking enabled counter for a zone. Returns true if the zone supports checking, false if it does not. */
|
||||
|
||||
extern void malloc_zone_disable_discharge_checking(malloc_zone_t *zone) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
|
||||
/* Decrement the discharge checking enabled counter for a zone. */
|
||||
|
||||
extern void malloc_zone_discharge(malloc_zone_t *zone, void *memory) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
|
||||
/* Register memory that the programmer expects to be freed soon.
|
||||
zone may be NULL in which case the zone is determined using malloc_zone_from_ptr().
|
||||
If discharge checking is off for the zone this function is a no-op. */
|
||||
|
||||
extern void malloc_zone_discharge(malloc_zone_t *zone, void * __unsafe_indexable memory) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
|
||||
/* Register memory that the programmer expects to be freed soon.
|
||||
zone may be NULL in which case the zone is determined using malloc_zone_from_ptr().
|
||||
If discharge checking is off for the zone this function is a no-op. */
|
||||
#endif
|
||||
|
||||
#if !0 && !0
|
||||
#ifdef __BLOCKS__
|
||||
extern void malloc_zone_enumerate_discharged_pointers(malloc_zone_t *zone, void (^report_discharged)(void *memory, void *info)) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
|
||||
/* Calls report_discharged for each block that was registered using malloc_zone_discharge() but has not yet been freed.
|
||||
info is used to provide zone defined information about the memory block.
|
||||
If zone is NULL then the enumeration covers all zones. */
|
||||
/* Calls report_discharged for each block that was registered using malloc_zone_discharge() but has not yet been freed.
|
||||
info is used to provide zone defined information about the memory block.
|
||||
If zone is NULL then the enumeration covers all zones. */
|
||||
#else
|
||||
extern void malloc_zone_enumerate_discharged_pointers(malloc_zone_t *zone, void *) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
|
||||
#endif /* __BLOCKS__ */
|
||||
#endif
|
||||
|
||||
/********* Zone version summary ************/
|
||||
// Version 0, but optional:
|
||||
@@ -347,6 +593,14 @@ extern void malloc_zone_enumerate_discharged_pointers(malloc_zone_t *zone, void
|
||||
// - malloc_zone_t::try_free_default
|
||||
// Version 14:
|
||||
// malloc_introspection_t::zone_type
|
||||
// Version 15:
|
||||
// malloc_zone_t::malloc_with_options
|
||||
// Version 16:
|
||||
// malloc_zone_t::malloc_type_malloc
|
||||
// malloc_zone_t::malloc_type_calloc
|
||||
// malloc_zone_t::malloc_type_realloc
|
||||
// malloc_zone_t::malloc_type_memalign
|
||||
// malloc_zone_t::malloc_type_malloc_with_options
|
||||
|
||||
// These functions are optional and calling them requires two checks:
|
||||
// * Check zone version to ensure zone struct is large enough to include the member.
|
||||
|
||||
21
lib/libc/include/any-macos-any/math.h
vendored
21
lib/libc/include/any-macos-any/math.h
vendored
@@ -79,7 +79,7 @@ __BEGIN_DECLS
|
||||
#define FP_SUBNORMAL 5
|
||||
#define FP_SUPERNORMAL 6 /* legacy PowerPC support; this is otherwise unused */
|
||||
|
||||
#if defined __arm64__ || defined __ARM_VFPV4__
|
||||
#if defined __arm64__ || defined __aarch64__ || defined __ARM_VFPV4__
|
||||
/* On these architectures, fma(), fmaf( ), and fmal( ) are generally about as
|
||||
fast as (or faster than) separate multiply and add of the same operands. */
|
||||
# define FP_FAST_FMA 1
|
||||
@@ -564,12 +564,12 @@ __API_DEPRECATED("use `NAN` instead", macos(10.0, 10.14)) __API_UNAVAILABLE(ios,
|
||||
* Reentrant variants of lgamma[fl] *
|
||||
******************************************************************************/
|
||||
|
||||
#ifdef _REENTRANT
|
||||
#if defined(_REENTRANT) || defined(__swift__)
|
||||
/* Reentrant variants of the lgamma[fl] functions. */
|
||||
extern float lgammaf_r(float, int *) __API_AVAILABLE(macos(10.6), ios(3.1));
|
||||
extern double lgamma_r(double, int *) __API_AVAILABLE(macos(10.6), ios(3.1));
|
||||
extern long double lgammal_r(long double, int *) __API_AVAILABLE(macos(10.6), ios(3.1));
|
||||
#endif /* _REENTRANT */
|
||||
#endif /* _REENTRANT || __swift__ */
|
||||
|
||||
/******************************************************************************
|
||||
* Apple extensions to the C standard *
|
||||
@@ -610,6 +610,21 @@ extern double __sinpi(double) __API_AVAILABLE(macos(10.9), ios(7.0));
|
||||
extern float __tanpif(float) __API_AVAILABLE(macos(10.9), ios(7.0));
|
||||
extern double __tanpi(double) __API_AVAILABLE(macos(10.9), ios(7.0));
|
||||
|
||||
/* half precision math functions */
|
||||
extern _Float16 __fabsf16(_Float16) __API_AVAILABLE(macos(15.0), ios(18.0), watchos(11.0), tvos(18.0));
|
||||
extern _Float16 __hypotf16(_Float16, _Float16) __API_AVAILABLE(macos(15.0), ios(18.0), watchos(11.0), tvos(18.0));
|
||||
extern _Float16 __sqrtf16(_Float16) __API_AVAILABLE(macos(15.0), ios(18.0), watchos(11.0), tvos(18.0));
|
||||
extern _Float16 __ceilf16(_Float16) __API_AVAILABLE(macos(15.0), ios(18.0), watchos(11.0), tvos(18.0));
|
||||
extern _Float16 __floorf16(_Float16) __API_AVAILABLE(macos(15.0), ios(18.0), watchos(11.0), tvos(18.0));
|
||||
extern _Float16 __rintf16(_Float16) __API_AVAILABLE(macos(15.0), ios(18.0), watchos(11.0), tvos(18.0));
|
||||
extern _Float16 __roundf16(_Float16) __API_AVAILABLE(macos(15.0), ios(18.0), watchos(11.0), tvos(18.0));
|
||||
extern _Float16 __truncf16(_Float16) __API_AVAILABLE(macos(15.0), ios(18.0), watchos(11.0), tvos(18.0));
|
||||
extern _Float16 __copysignf16(_Float16, _Float16) __API_AVAILABLE(macos(15.0), ios(18.0), watchos(11.0), tvos(18.0));
|
||||
extern _Float16 __nextafterf16(_Float16, _Float16) __API_AVAILABLE(macos(15.0), ios(18.0), watchos(11.0), tvos(18.0));
|
||||
extern _Float16 __fmaxf16(_Float16, _Float16) __API_AVAILABLE(macos(15.0), ios(18.0), watchos(11.0), tvos(18.0));
|
||||
extern _Float16 __fminf16(_Float16, _Float16) __API_AVAILABLE(macos(15.0), ios(18.0), watchos(11.0), tvos(18.0));
|
||||
extern _Float16 __fmaf16(_Float16, _Float16, _Float16) __API_AVAILABLE(macos(15.0), ios(18.0), watchos(11.0), tvos(18.0));
|
||||
|
||||
#if (defined __MAC_OS_X_VERSION_MIN_REQUIRED && __MAC_OS_X_VERSION_MIN_REQUIRED < 1090) || \
|
||||
(defined __IPHONE_OS_VERSION_MIN_REQUIRED && __IPHONE_OS_VERSION_MIN_REQUIRED < 70000)
|
||||
/* __sincos and __sincosf were introduced in OSX 10.9 and iOS 7.0. When
|
||||
|
||||
14
lib/libc/include/any-macos-any/monetary.h
vendored
14
lib/libc/include/any-macos-any/monetary.h
vendored
@@ -26,20 +26,8 @@
|
||||
* $FreeBSD: /repoman/r/ncvs/src/include/monetary.h,v 1.7 2002/09/20 08:22:48 mike Exp $
|
||||
*/
|
||||
|
||||
#ifndef _MONETARY_H_
|
||||
#define _MONETARY_H_
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#include <_types.h>
|
||||
#include <sys/_types/_size_t.h>
|
||||
#include <sys/_types/_ssize_t.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
ssize_t strfmon(char *, size_t, const char *, ...);
|
||||
__END_DECLS
|
||||
#include <_monetary.h>
|
||||
|
||||
#ifdef _USE_EXTENDED_LOCALES_
|
||||
#include <xlocale/_monetary.h>
|
||||
#endif /* _USE_EXTENDED_LOCALES_ */
|
||||
|
||||
#endif /* !_MONETARY_H_ */
|
||||
|
||||
7
lib/libc/include/any-macos-any/net/if.h
vendored
7
lib/libc/include/any-macos-any/net/if.h
vendored
@@ -72,6 +72,9 @@
|
||||
|
||||
#include <net/if_var.h>
|
||||
#include <net/net_kev.h>
|
||||
#if __has_ptrcheck
|
||||
#include <netinet/in.h>
|
||||
#endif
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
|
||||
@@ -139,6 +142,7 @@ struct if_clonereq {
|
||||
#define IFCAP_SW_TIMESTAMP 0x01000 /* Time stamping in software */
|
||||
#define IFCAP_CSUM_PARTIAL 0x02000 /* can offload partial checksum */
|
||||
#define IFCAP_CSUM_ZERO_INVERT 0x04000 /* can invert 0 to -0 (0xffff) */
|
||||
#define IFCAP_LRO_NUM_SEG 0x08000 /* NIC & driver can set the num of segments a LRO-packet is built of */
|
||||
|
||||
#define IFCAP_HWCSUM (IFCAP_RXCSUM | IFCAP_TXCSUM)
|
||||
#define IFCAP_TSO (IFCAP_TSO4 | IFCAP_TSO6)
|
||||
@@ -315,6 +319,7 @@ struct ifreq {
|
||||
u_int32_t ifru_route_refcnt;
|
||||
int ifru_cap[2];
|
||||
u_int32_t ifru_functional_type;
|
||||
u_int32_t ifru_peer_egress_functional_type;
|
||||
#define IFRTYPE_FUNCTIONAL_UNKNOWN 0
|
||||
#define IFRTYPE_FUNCTIONAL_LOOPBACK 1
|
||||
#define IFRTYPE_FUNCTIONAL_WIRED 2
|
||||
@@ -325,6 +330,8 @@ struct ifreq {
|
||||
#define IFRTYPE_FUNCTIONAL_COMPANIONLINK 7
|
||||
#define IFRTYPE_FUNCTIONAL_MANAGEMENT 8
|
||||
#define IFRTYPE_FUNCTIONAL_LAST 8
|
||||
u_int8_t ifru_is_directlink;
|
||||
u_int8_t ifru_is_vpn;
|
||||
} ifr_ifru;
|
||||
#define ifr_addr ifr_ifru.ifru_addr /* address */
|
||||
#define ifr_dstaddr ifr_ifru.ifru_dstaddr /* other end of p-to-p link */
|
||||
|
||||
11
lib/libc/include/any-macos-any/net/if_dl.h
vendored
11
lib/libc/include/any-macos-any/net/if_dl.h
vendored
@@ -65,6 +65,7 @@
|
||||
#define _NET_IF_DL_H_
|
||||
#include <sys/appleapiopts.h>
|
||||
|
||||
#include <sys/_types.h> /* __offsetof() */
|
||||
#include <sys/types.h>
|
||||
|
||||
|
||||
@@ -89,12 +90,6 @@
|
||||
/*
|
||||
* Structure of a Link-Level sockaddr:
|
||||
*/
|
||||
#if __has_ptrcheck
|
||||
#define DLIL_SDLDATACOUNT __counted_by(sdl_len - 8)
|
||||
#else
|
||||
#define DLIL_SDLDATACOUNT 12
|
||||
#endif
|
||||
|
||||
struct sockaddr_dl {
|
||||
u_char sdl_len; /* Total length of sockaddr */
|
||||
u_char sdl_family; /* AF_LINK */
|
||||
@@ -103,7 +98,7 @@ struct sockaddr_dl {
|
||||
u_char sdl_nlen; /* interface name length, no trailing 0 reqd. */
|
||||
u_char sdl_alen; /* link level address length */
|
||||
u_char sdl_slen; /* link layer selector length */
|
||||
char sdl_data[DLIL_SDLDATACOUNT];
|
||||
char sdl_data[12];
|
||||
/* minimum work area, can be larger;
|
||||
* contains both if name and ll address */
|
||||
#ifndef __APPLE__
|
||||
@@ -113,7 +108,7 @@ struct sockaddr_dl {
|
||||
#endif
|
||||
};
|
||||
|
||||
#define LLADDR(s) ((caddr_t)((s)->sdl_data + (s)->sdl_nlen))
|
||||
#define LLADDR(s) ((caddr_t)(s) + __offsetof(struct sockaddr_dl, sdl_data) + (s)->sdl_nlen)
|
||||
|
||||
|
||||
|
||||
|
||||
25
lib/libc/include/any-macos-any/net/route.h
vendored
25
lib/libc/include/any-macos-any/net/route.h
vendored
@@ -83,8 +83,7 @@ struct rt_metrics {
|
||||
u_int32_t rmx_rtt; /* estimated round trip time */
|
||||
u_int32_t rmx_rttvar; /* estimated rtt variance */
|
||||
u_int32_t rmx_pksent; /* packets sent using this route */
|
||||
u_int32_t rmx_state; /* route state */
|
||||
u_int32_t rmx_filler[3]; /* will be used for TCP's peer-MSS cache */
|
||||
u_int32_t rmx_filler[4]; /* will be used for TCP's peer-MSS cache */
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -102,9 +101,7 @@ struct rt_metrics {
|
||||
#define RTF_DELCLONE 0x80 /* delete cloned route */
|
||||
#define RTF_CLONING 0x100 /* generate new routes on use */
|
||||
#define RTF_XRESOLVE 0x200 /* external daemon resolves name */
|
||||
#define RTF_LLINFO 0x400 /* DEPRECATED - exists ONLY for backward
|
||||
* compatibility */
|
||||
#define RTF_LLDATA 0x400 /* used by apps to add/del L2 entries */
|
||||
#define RTF_LLINFO 0x400 /* generated by link layer (e.g. ARP) */
|
||||
#define RTF_STATIC 0x800 /* manually added */
|
||||
#define RTF_BLACKHOLE 0x1000 /* just discard pkts (during updates) */
|
||||
#define RTF_NOIFREF 0x2000 /* not eligible for RTF_IFREF */
|
||||
@@ -129,12 +126,6 @@ struct rt_metrics {
|
||||
/* 0x80000000 unassigned */
|
||||
|
||||
#define RTPRF_OURS RTF_PROTO3 /* set on routes we manage */
|
||||
#define RTF_BITS \
|
||||
"\020\1UP\2GATEWAY\3HOST\4REJECT\5DYNAMIC\6MODIFIED\7DONE" \
|
||||
"\10DELCLONE\11CLONING\12XRESOLVE\13LLINFO\14STATIC\15BLACKHOLE" \
|
||||
"\16NOIFREF\17PROTO2\20PROTO1\21PRCLONING\22WASCLONED\23PROTO3" \
|
||||
"\25PINNED\26LOCAL\27BROADCAST\30MULTICAST\31IFSCOPE\32CONDEMNED" \
|
||||
"\33IFREF\34PROXY\35ROUTER\37GLOBAL"
|
||||
|
||||
#define IS_DIRECT_HOSTROUTE(rt) \
|
||||
(((rt)->rt_flags & (RTF_HOST | RTF_GATEWAY)) == RTF_HOST)
|
||||
@@ -143,10 +134,16 @@ struct rt_metrics {
|
||||
(((rt)->rt_flags & (RTF_CLONING | RTF_PRCLONING | RTF_HOST | RTF_LLINFO |\
|
||||
RTF_WASCLONED | RTF_GATEWAY)) ==\
|
||||
(RTF_HOST | RTF_LLINFO | RTF_WASCLONED))
|
||||
|
||||
#define IS_LOCALNET_ROUTE(rt) \
|
||||
(!((rt)->rt_flags & RTF_LOCAL) && \
|
||||
((((rt)->rt_flags & (RTF_HOST | RTF_GATEWAY)) == RTF_HOST) || \
|
||||
((rt)->rt_flags & (RTF_MULTICAST | RTF_BROADCAST))))
|
||||
|
||||
/*
|
||||
* Routing statistics.
|
||||
*/
|
||||
struct rtstat {
|
||||
struct rtstat {
|
||||
short rts_badredirect; /* bogus redirect calls */
|
||||
short rts_dynamic; /* routes created by redirects */
|
||||
short rts_newgateway; /* routes modified by redirects */
|
||||
@@ -188,6 +185,10 @@ struct rt_msghdr2 {
|
||||
struct rt_metrics rtm_rmx; /* metrics themselves */
|
||||
};
|
||||
|
||||
struct rt_msghdr_prelude {
|
||||
u_short rtm_msglen; /* to skip over non-understood messages */
|
||||
};
|
||||
|
||||
#define RTM_VERSION 5 /* Up the ante and ignore older versions */
|
||||
|
||||
/*
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#define _OBJC_NSOBJCRUNTIME_H_
|
||||
|
||||
#include <TargetConditionals.h>
|
||||
#include <limits.h>
|
||||
#include <objc/objc.h>
|
||||
|
||||
#if __LP64__ || NS_BUILD_32_LIKE_64
|
||||
|
||||
@@ -301,4 +301,10 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if __has_attribute(not_tail_called)
|
||||
# define OBJC_NOT_TAIL_CALLED __attribute__((not_tail_called))
|
||||
#else
|
||||
# define OBJC_NOT_TAIL_CALLED
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
7
lib/libc/include/any-macos-any/objc/objc.h
vendored
7
lib/libc/include/any-macos-any/objc/objc.h
vendored
@@ -46,6 +46,13 @@ struct objc_object {
|
||||
typedef struct objc_object *id;
|
||||
#endif
|
||||
|
||||
/// An opaque type that represents an Objective-C protocol.
|
||||
#ifdef __OBJC__
|
||||
@class Protocol;
|
||||
#else
|
||||
typedef struct objc_object Protocol;
|
||||
#endif
|
||||
|
||||
/// An opaque type that represents a method selector.
|
||||
typedef struct objc_selector *SEL;
|
||||
|
||||
|
||||
39
lib/libc/include/any-macos-any/objc/runtime.h
vendored
39
lib/libc/include/any-macos-any/objc/runtime.h
vendored
@@ -54,12 +54,6 @@ typedef struct objc_property *objc_property_t;
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef __OBJC__
|
||||
@class Protocol;
|
||||
#else
|
||||
typedef struct objc_object Protocol;
|
||||
#endif
|
||||
|
||||
/// Defines a method
|
||||
struct objc_method_description {
|
||||
SEL _Nullable name; /**< The name of the method */
|
||||
@@ -367,6 +361,7 @@ objc_copyClassList(unsigned int * _Nullable outCount)
|
||||
*
|
||||
*/
|
||||
#define OBJC_DYNAMIC_CLASSES ((const void *)-1)
|
||||
#ifdef __BLOCKS__
|
||||
OBJC_EXPORT void
|
||||
objc_enumerateClasses(const void * _Nullable image,
|
||||
const char * _Nullable namePrefix,
|
||||
@@ -375,7 +370,9 @@ objc_enumerateClasses(const void * _Nullable image,
|
||||
void (^ _Nonnull block)(Class _Nonnull aClass, BOOL * _Nonnull stop)
|
||||
OBJC_NOESCAPE)
|
||||
OBJC_AVAILABLE(13.0, 16.0, 16.0, 9.0, 7.0)
|
||||
OBJC_REFINED_FOR_SWIFT;
|
||||
OBJC_REFINED_FOR_SWIFT
|
||||
OBJC_NOT_TAIL_CALLED;
|
||||
#endif
|
||||
|
||||
/* Working with Classes */
|
||||
|
||||
@@ -1480,34 +1477,6 @@ objc_copyClassNamesForImage(const char * _Nonnull image,
|
||||
|
||||
/* Working with Selectors */
|
||||
|
||||
/**
|
||||
* Returns the name of the method specified by a given selector.
|
||||
*
|
||||
* @param sel A pointer of type \c SEL. Pass the selector whose name you wish to determine.
|
||||
*
|
||||
* @return A C string indicating the name of the selector.
|
||||
*/
|
||||
OBJC_EXPORT const char * _Nonnull
|
||||
sel_getName(SEL _Nonnull sel)
|
||||
OBJC_AVAILABLE(10.0, 2.0, 9.0, 1.0, 2.0);
|
||||
|
||||
|
||||
/**
|
||||
* Registers a method with the Objective-C runtime system, maps the method
|
||||
* name to a selector, and returns the selector value.
|
||||
*
|
||||
* @param str A pointer to a C string. Pass the name of the method you wish to register.
|
||||
*
|
||||
* @return A pointer of type SEL specifying the selector for the named method.
|
||||
*
|
||||
* @note You must register a method name with the Objective-C runtime system to obtain the
|
||||
* method’s selector before you can add the method to a class definition. If the method name
|
||||
* has already been registered, this function simply returns the selector.
|
||||
*/
|
||||
OBJC_EXPORT SEL _Nonnull
|
||||
sel_registerName(const char * _Nonnull str)
|
||||
OBJC_AVAILABLE(10.0, 2.0, 9.0, 1.0, 2.0);
|
||||
|
||||
/**
|
||||
* Returns a Boolean value that indicates whether two selectors are equal.
|
||||
*
|
||||
|
||||
36
lib/libc/include/any-macos-any/os/availability.h
vendored
36
lib/libc/include/any-macos-any/os/availability.h
vendored
@@ -65,11 +65,19 @@
|
||||
#define API_TO_BE_DEPRECATED_DRIVERKIT 100000
|
||||
#endif
|
||||
|
||||
#ifndef API_TO_BE_DEPRECATED_XROS
|
||||
#define API_TO_BE_DEPRECATED_XROS 100000
|
||||
#ifndef API_TO_BE_DEPRECATEDC_VISIONOS
|
||||
#define API_TO_BE_DEPRECATED_VISIONOS 100000
|
||||
#endif
|
||||
|
||||
#ifndef __OPEN_SOURCE__
|
||||
|
||||
#endif /* __OPEN_SOURCE__ */
|
||||
|
||||
#include <AvailabilityInternal.h>
|
||||
#include <AvailabilityInternalLegacy.h>
|
||||
#if __has_include(<AvailabilityInternalPrivate.h>)
|
||||
#include <AvailabilityInternalPrivate.h>
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -90,8 +98,8 @@
|
||||
* API_AVAILABLE(macos(10.4), ios(8.0), watchos(2.0), tvos(10.0))
|
||||
*/
|
||||
|
||||
#define API_AVAILABLE(...) __API_AVAILABLE_GET_MACRO(__VA_ARGS__,__API_AVAILABLE7,__API_AVAILABLE6,__API_AVAILABLE5,__API_AVAILABLE4,__API_AVAILABLE3,__API_AVAILABLE2,__API_AVAILABLE1,__API_AVAILABLE0,0)(__VA_ARGS__)
|
||||
#define API_AVAILABLE_BEGIN(...) _Pragma("clang attribute push") __API_AVAILABLE_BEGIN_GET_MACRO(__VA_ARGS__,__API_AVAILABLE_BEGIN7,__API_AVAILABLE_BEGIN6,__API_AVAILABLE_BEGIN5,__API_AVAILABLE_BEGIN4,__API_AVAILABLE_BEGIN3,__API_AVAILABLE_BEGIN2,__API_AVAILABLE_BEGIN1,__API_AVAILABLE_BEGIN0,0)(__VA_ARGS__)
|
||||
#define API_AVAILABLE(...) __API_AVAILABLE_GET_MACRO(__VA_ARGS__,__API_AVAILABLE8,__API_AVAILABLE7,__API_AVAILABLE6,__API_AVAILABLE5,__API_AVAILABLE4,__API_AVAILABLE3,__API_AVAILABLE2,__API_AVAILABLE1,__API_AVAILABLE0,0)(__VA_ARGS__)
|
||||
#define API_AVAILABLE_BEGIN(...) _Pragma("clang attribute push") __API_AVAILABLE_BEGIN_GET_MACRO(__VA_ARGS__,__API_AVAILABLE_BEGIN8,__API_AVAILABLE_BEGIN7,__API_AVAILABLE_BEGIN6,__API_AVAILABLE_BEGIN5,__API_AVAILABLE_BEGIN4,__API_AVAILABLE_BEGIN3,__API_AVAILABLE_BEGIN2,__API_AVAILABLE_BEGIN1,__API_AVAILABLE_BEGIN0,0)(__VA_ARGS__)
|
||||
#define API_AVAILABLE_END _Pragma("clang attribute pop")
|
||||
|
||||
/*
|
||||
@@ -111,13 +119,13 @@
|
||||
* API_DEPRECATED_WITH_REPLACEMENT("SomeClassName", macos(10.4, 10.6), watchos(2.0, 3.0))
|
||||
*/
|
||||
|
||||
#define API_DEPRECATED(...) __API_DEPRECATED_MSG_GET_MACRO(__VA_ARGS__,__API_DEPRECATED_MSG7,__API_DEPRECATED_MSG6,__API_DEPRECATED_MSG5,__API_DEPRECATED_MSG4,__API_DEPRECATED_MSG3,__API_DEPRECATED_MSG2,__API_DEPRECATED_MSG1,__API_DEPRECATED_MSG0,0,0)(__VA_ARGS__)
|
||||
#define API_DEPRECATED_WITH_REPLACEMENT(...) __API_DEPRECATED_REP_GET_MACRO(__VA_ARGS__,__API_DEPRECATED_REP7,__API_DEPRECATED_REP6,__API_DEPRECATED_REP5,__API_DEPRECATED_REP4,__API_DEPRECATED_REP3,__API_DEPRECATED_REP2,__API_DEPRECATED_REP1,__API_DEPRECATED_REP0,0,0)(__VA_ARGS__)
|
||||
#define API_DEPRECATED(...) __API_DEPRECATED_MSG_GET_MACRO(__VA_ARGS__,__API_DEPRECATED_MSG8,__API_DEPRECATED_MSG7,__API_DEPRECATED_MSG6,__API_DEPRECATED_MSG5,__API_DEPRECATED_MSG4,__API_DEPRECATED_MSG3,__API_DEPRECATED_MSG2,__API_DEPRECATED_MSG1,__API_DEPRECATED_MSG0,0,0)(__VA_ARGS__)
|
||||
#define API_DEPRECATED_WITH_REPLACEMENT(...) __API_DEPRECATED_REP_GET_MACRO(__VA_ARGS__,__API_DEPRECATED_REP8,__API_DEPRECATED_REP7,__API_DEPRECATED_REP6,__API_DEPRECATED_REP5,__API_DEPRECATED_REP4,__API_DEPRECATED_REP3,__API_DEPRECATED_REP2,__API_DEPRECATED_REP1,__API_DEPRECATED_REP0,0,0)(__VA_ARGS__)
|
||||
|
||||
#define API_DEPRECATED_BEGIN(...) _Pragma("clang attribute push") __API_DEPRECATED_BEGIN_GET_MACRO(__VA_ARGS__,__API_DEPRECATED_BEGIN7,__API_DEPRECATED_BEGIN6,__API_DEPRECATED_BEGIN5,__API_DEPRECATED_BEGIN4,__API_DEPRECATED_BEGIN3,__API_DEPRECATED_BEGIN2,__API_DEPRECATED_BEGIN1,__API_DEPRECATED_BEGIN0,0,0)(__VA_ARGS__)
|
||||
#define API_DEPRECATED_BEGIN(...) _Pragma("clang attribute push") __API_DEPRECATED_BEGIN_GET_MACRO(__VA_ARGS__,__API_DEPRECATED_BEGIN8,__API_DEPRECATED_BEGIN7,__API_DEPRECATED_BEGIN6,__API_DEPRECATED_BEGIN5,__API_DEPRECATED_BEGIN4,__API_DEPRECATED_BEGIN3,__API_DEPRECATED_BEGIN2,__API_DEPRECATED_BEGIN1,__API_DEPRECATED_BEGIN0,0,0)(__VA_ARGS__)
|
||||
#define API_DEPRECATED_END _Pragma("clang attribute pop")
|
||||
|
||||
#define API_DEPRECATED_WITH_REPLACEMENT_BEGIN(...) _Pragma("clang attribute push") __API_DEPRECATED_WITH_REPLACEMENT_BEGIN_GET_MACRO(__VA_ARGS__,__API_DEPRECATED_WITH_REPLACEMENT_BEGIN7,__API_DEPRECATED_WITH_REPLACEMENT_BEGIN6,__API_DEPRECATED_WITH_REPLACEMENT_BEGIN5,__API_DEPRECATED_WITH_REPLACEMENT_BEGIN4,__API_DEPRECATED_WITH_REPLACEMENT_BEGIN3,__API_DEPRECATED_WITH_REPLACEMENT_BEGIN2,__API_DEPRECATED_WITH_REPLACEMENT_BEGIN1,__API_DEPRECATED_WITH_REPLACEMENT_BEGIN0,0,0)(__VA_ARGS__)
|
||||
#define API_DEPRECATED_WITH_REPLACEMENT_BEGIN(...) _Pragma("clang attribute push") __API_DEPRECATED_WITH_REPLACEMENT_BEGIN_GET_MACRO(__VA_ARGS__,__API_DEPRECATED_WITH_REPLACEMENT_BEGIN8,__API_DEPRECATED_WITH_REPLACEMENT_BEGIN7,__API_DEPRECATED_WITH_REPLACEMENT_BEGIN6,__API_DEPRECATED_WITH_REPLACEMENT_BEGIN5,__API_DEPRECATED_WITH_REPLACEMENT_BEGIN4,__API_DEPRECATED_WITH_REPLACEMENT_BEGIN3,__API_DEPRECATED_WITH_REPLACEMENT_BEGIN2,__API_DEPRECATED_WITH_REPLACEMENT_BEGIN1,__API_DEPRECATED_WITH_REPLACEMENT_BEGIN0,0,0)(__VA_ARGS__)
|
||||
#define API_DEPRECATED_WITH_REPLACEMENT_END _Pragma("clang attribute pop")
|
||||
|
||||
/*
|
||||
@@ -129,9 +137,9 @@
|
||||
* API_UNAVAILABLE(watchos, tvos)
|
||||
*/
|
||||
|
||||
#define API_UNAVAILABLE(...) __API_UNAVAILABLE_GET_MACRO(__VA_ARGS__,__API_UNAVAILABLE7,__API_UNAVAILABLE6,__API_UNAVAILABLE5,__API_UNAVAILABLE4,__API_UNAVAILABLE3,__API_UNAVAILABLE2,__API_UNAVAILABLE1,__API_UNAVAILABLE0,0)(__VA_ARGS__)
|
||||
#define API_UNAVAILABLE(...) __API_UNAVAILABLE_GET_MACRO(__VA_ARGS__,__API_UNAVAILABLE8,__API_UNAVAILABLE7,__API_UNAVAILABLE6,__API_UNAVAILABLE5,__API_UNAVAILABLE4,__API_UNAVAILABLE3,__API_UNAVAILABLE2,__API_UNAVAILABLE1,__API_UNAVAILABLE0,0)(__VA_ARGS__)
|
||||
|
||||
#define API_UNAVAILABLE_BEGIN(...) _Pragma("clang attribute push") __API_UNAVAILABLE_BEGIN_GET_MACRO(__VA_ARGS__,__API_UNAVAILABLE_BEGIN7,__API_UNAVAILABLE_BEGIN6,__API_UNAVAILABLE_BEGIN5,__API_UNAVAILABLE_BEGIN4,__API_UNAVAILABLE_BEGIN3,__API_UNAVAILABLE_BEGIN2,__API_UNAVAILABLE_BEGIN1,__API_UNAVAILABLE_BEGIN0,0)(__VA_ARGS__)
|
||||
#define API_UNAVAILABLE_BEGIN(...) _Pragma("clang attribute push") __API_UNAVAILABLE_BEGIN_GET_MACRO(__VA_ARGS__,__API_UNAVAILABLE_BEGIN8,__API_UNAVAILABLE_BEGIN7,__API_UNAVAILABLE_BEGIN6,__API_UNAVAILABLE_BEGIN5,__API_UNAVAILABLE_BEGIN4,__API_UNAVAILABLE_BEGIN3,__API_UNAVAILABLE_BEGIN2,__API_UNAVAILABLE_BEGIN1,__API_UNAVAILABLE_BEGIN0,0)(__VA_ARGS__)
|
||||
#define API_UNAVAILABLE_END _Pragma("clang attribute pop")
|
||||
#endif /* __has_attribute(availability) */
|
||||
#endif /* #if defined(__has_feature) && defined(__has_attribute) */
|
||||
@@ -200,6 +208,14 @@
|
||||
#define SPI_AVAILABLE(...)
|
||||
#endif
|
||||
|
||||
#ifndef SPI_AVAILABLE_BEGIN
|
||||
#define SPI_AVAILABLE_BEGIN(...)
|
||||
#endif
|
||||
|
||||
#ifndef SPI_AVAILABLE_END
|
||||
#define SPI_AVAILABLE_END(...)
|
||||
#endif
|
||||
|
||||
#ifndef SPI_DEPRECATED
|
||||
#define SPI_DEPRECATED(...)
|
||||
#endif
|
||||
|
||||
4
lib/libc/include/any-macos-any/os/base.h
vendored
4
lib/libc/include/any-macos-any/os/base.h
vendored
@@ -246,8 +246,12 @@
|
||||
#if __has_attribute(__swift_attr__)
|
||||
#define OS_SWIFT_UNAVAILABLE_FROM_ASYNC(msg) \
|
||||
__attribute__((__swift_attr__("@_unavailableFromAsync(message: \"" msg "\")")))
|
||||
#define OS_SWIFT_NONISOLATED __attribute__((__swift_attr__("nonisolated")))
|
||||
#define OS_SWIFT_NONISOLATED_UNSAFE __attribute__((__swift_attr__("nonisolated(unsafe)")))
|
||||
#else
|
||||
#define OS_SWIFT_UNAVAILABLE_FROM_ASYNC(msg)
|
||||
#define OS_SWIFT_NONISOLATED
|
||||
#define OS_SWIFT_NONISOLATED_UNSAFE
|
||||
#endif
|
||||
|
||||
#if __has_attribute(swift_private)
|
||||
|
||||
41
lib/libc/include/any-macos-any/os/lock.h
vendored
41
lib/libc/include/any-macos-any/os/lock.h
vendored
@@ -195,6 +195,47 @@ OS_UNFAIR_LOCK_AVAILABILITY
|
||||
OS_EXPORT OS_NOTHROW OS_NONNULL_ALL
|
||||
void os_unfair_lock_assert_not_owner(const os_unfair_lock *lock);
|
||||
|
||||
/*!
|
||||
* @typedef os_unfair_lock_flags_t
|
||||
*
|
||||
* @const OS_UNFAIR_LOCK_FLAG_ADAPTIVE_SPIN
|
||||
* This flag allows the caller of os_unfair_lock_lock_with_flags API to spin
|
||||
* temporarily before blocking, particularly useful when the holder of the
|
||||
* lock is on core. This should only be used for locks where the protected
|
||||
* critical section is always extremely short.
|
||||
*/
|
||||
OS_REFINED_FOR_SWIFT
|
||||
OS_OPTIONS(os_unfair_lock_flags, uint32_t,
|
||||
OS_UNFAIR_LOCK_FLAG_NONE
|
||||
__API_AVAILABLE(macos(15.0), ios(18.0),
|
||||
tvos(18.0), watchos(11.0), visionos(2.0))
|
||||
OS_SWIFT_UNAVAILABLE("Use OSAllocatedUnfairLock APIs that do not require flags.")
|
||||
= 0x00000000,
|
||||
OS_UNFAIR_LOCK_FLAG_ADAPTIVE_SPIN
|
||||
__API_AVAILABLE(macos(15.0), ios(18.0),
|
||||
tvos(18.0), watchos(11.0), visionos(2.0))
|
||||
OS_SWIFT_UNAVAILABLE("Use OSAllocatedUnfairLockFlags.AdaptiveSpin")
|
||||
= 0x00040000,
|
||||
);
|
||||
|
||||
/*!
|
||||
* @function os_unfair_lock_lock_with_flags
|
||||
*
|
||||
* @abstract
|
||||
* Locks an os_unfair_lock.
|
||||
*
|
||||
* @param lock
|
||||
* Pointer to an os_unfair_lock.
|
||||
*
|
||||
* @param flags
|
||||
* Flags to alter the behavior of the lock. See os_unfair_lock_flags_t.
|
||||
*/
|
||||
__API_AVAILABLE(macos(15.0), ios(18.0), tvos(18.0), watchos(11.0), visionos(2.0))
|
||||
OS_EXPORT OS_NOTHROW OS_NONNULL_ALL
|
||||
OS_SWIFT_UNAVAILABLE_FROM_ASYNC("Use OSAllocatedUnfairLock for async-safe scoped locking")
|
||||
void os_unfair_lock_lock_with_flags(os_unfair_lock_t lock,
|
||||
os_unfair_lock_flags_t flags);
|
||||
|
||||
__END_DECLS
|
||||
|
||||
OS_ASSUME_NONNULL_END
|
||||
|
||||
12
lib/libc/include/any-macos-any/pthread.h
vendored
12
lib/libc/include/any-macos-any/pthread.h
vendored
@@ -587,8 +587,8 @@ __API_AVAILABLE(macos(11.0))
|
||||
__API_UNAVAILABLE(ios, tvos, watchos, driverkit)
|
||||
void pthread_jit_write_protect_np(int enabled);
|
||||
|
||||
__API_AVAILABLE(macos(11.0))
|
||||
__API_UNAVAILABLE(ios, tvos, watchos, driverkit)
|
||||
__API_AVAILABLE(macos(11.0), ios(17.4))
|
||||
__API_UNAVAILABLE(tvos, watchos, driverkit, visionos)
|
||||
int pthread_jit_write_protect_supported_np(void);
|
||||
|
||||
/*!
|
||||
@@ -691,8 +691,8 @@ typedef int (*pthread_jit_write_callback_t)(void * _Nullable ctx);
|
||||
* abort(3), the latter being encumbered by various conformance requirements) or
|
||||
* return a result indicating failure.
|
||||
*/
|
||||
__API_AVAILABLE(macos(11.4))
|
||||
__API_UNAVAILABLE(ios, tvos, watchos, driverkit)
|
||||
__API_AVAILABLE(macos(11.4), ios(17.4))
|
||||
__API_UNAVAILABLE(tvos, watchos, driverkit, visionos)
|
||||
__SWIFT_UNAVAILABLE_MSG("This interface cannot be safely used from Swift")
|
||||
int pthread_jit_write_with_callback_np(
|
||||
pthread_jit_write_callback_t _Nonnull callback, void * _Nullable ctx);
|
||||
@@ -722,8 +722,8 @@ int pthread_jit_write_with_callback_np(
|
||||
* this function, as this allows the runtime to automatically freeze the set of
|
||||
* allowed callbacks early in process initialization.
|
||||
*/
|
||||
__API_AVAILABLE(macos(12.1))
|
||||
__API_UNAVAILABLE(ios, tvos, watchos, driverkit)
|
||||
__API_AVAILABLE(macos(12.1), ios(17.4))
|
||||
__API_UNAVAILABLE(tvos, watchos, driverkit, visionos)
|
||||
void pthread_jit_write_freeze_callbacks_np(void);
|
||||
|
||||
/*!
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user