mirror of
https://github.com/AntelopeIO/cdt-libcxx.git
synced 2026-07-21 13:53:36 +00:00
added support for Mac OSX
This commit is contained in:
@@ -0,0 +1,470 @@
|
||||
/*
|
||||
* Copyright (c) 2007-2016 by 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 __AVAILABILITY__
|
||||
#define __AVAILABILITY__
|
||||
/*
|
||||
These macros are for use in OS header files. They enable function prototypes
|
||||
and Objective-C methods to be tagged with the OS version in which they
|
||||
were first available; and, if applicable, the OS version in which they
|
||||
became deprecated.
|
||||
|
||||
The desktop Mac OS X and iOS each have different version numbers.
|
||||
The __OSX_AVAILABLE_STARTING() macro allows you to specify both the desktop
|
||||
and iOS version numbers. For instance:
|
||||
__OSX_AVAILABLE_STARTING(__MAC_10_2,__IPHONE_2_0)
|
||||
means the function/method was first available on Mac OS X 10.2 on the desktop
|
||||
and first available in iOS 2.0 on the iPhone.
|
||||
|
||||
If a function is available on one platform, but not the other a _NA (not
|
||||
applicable) parameter is used. For instance:
|
||||
__OSX_AVAILABLE_STARTING(__MAC_10_3,__IPHONE_NA)
|
||||
means that the function/method was first available on Mac OS X 10.3, and it
|
||||
currently not implemented on the iPhone.
|
||||
|
||||
At some point, a function/method may be deprecated. That means Apple
|
||||
recommends applications stop using the function, either because there is a
|
||||
better replacement or the functionality is being phased out. Deprecated
|
||||
functions/methods can be tagged with a __OSX_AVAILABLE_BUT_DEPRECATED()
|
||||
macro which specifies the OS version where the function became available
|
||||
as well as the OS version in which it became deprecated. For instance:
|
||||
__OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0,__MAC_10_5,__IPHONE_NA,__IPHONE_NA)
|
||||
means that the function/method was introduced in Mac OS X 10.0, then
|
||||
became deprecated beginning in Mac OS X 10.5. On iOS the function
|
||||
has never been available.
|
||||
|
||||
For these macros to function properly, a program must specify the OS version range
|
||||
it is targeting. The min OS version is specified as an option to the compiler:
|
||||
-mmacosx-version-min=10.x when building for Mac OS X, and -miphoneos-version-min=y.z
|
||||
when building for the iPhone. The upper bound for the OS version is rarely needed,
|
||||
but it can be set on the command line via: -D__MAC_OS_X_VERSION_MAX_ALLOWED=10x0 for
|
||||
Mac OS X and __IPHONE_OS_VERSION_MAX_ALLOWED = y0z00 for iOS.
|
||||
|
||||
Examples:
|
||||
|
||||
A function available in Mac OS X 10.5 and later, but not on the phone:
|
||||
|
||||
extern void mymacfunc() __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_NA);
|
||||
|
||||
|
||||
An Objective-C method in Mac OS X 10.5 and later, but not on the phone:
|
||||
|
||||
@interface MyClass : NSObject
|
||||
-(void) mymacmethod __OSX_AVAILABLE_STARTING(__MAC_10_5,__IPHONE_NA);
|
||||
@end
|
||||
|
||||
|
||||
An enum available on the phone, but not available on Mac OS X:
|
||||
|
||||
#if __IPHONE_OS_VERSION_MIN_REQUIRED
|
||||
enum { myEnum = 1 };
|
||||
#endif
|
||||
Note: this works when targeting the Mac OS X platform because
|
||||
__IPHONE_OS_VERSION_MIN_REQUIRED is undefined which evaluates to zero.
|
||||
|
||||
|
||||
An enum with values added in different iPhoneOS versions:
|
||||
|
||||
enum {
|
||||
myX = 1, // Usable on iPhoneOS 2.1 and later
|
||||
myY = 2, // Usable on iPhoneOS 3.0 and later
|
||||
myZ = 3, // Usable on iPhoneOS 3.0 and later
|
||||
...
|
||||
Note: you do not want to use #if with enumeration values
|
||||
when a client needs to see all values at compile time
|
||||
and use runtime logic to only use the viable values.
|
||||
|
||||
|
||||
It is also possible to use the *_VERSION_MIN_REQUIRED in source code to make one
|
||||
source base that can be compiled to target a range of OS versions. It is best
|
||||
to not use the _MAC_* and __IPHONE_* macros for comparisons, but rather their values.
|
||||
That is because you might get compiled on an old OS that does not define a later
|
||||
OS version macro, and in the C preprocessor undefined values evaluate to zero
|
||||
in expresssions, which could cause the #if expression to evaluate in an unexpected
|
||||
way.
|
||||
|
||||
#ifdef __MAC_OS_X_VERSION_MIN_REQUIRED
|
||||
// code only compiled when targeting Mac OS X and not iPhone
|
||||
// note use of 1050 instead of __MAC_10_5
|
||||
#if __MAC_OS_X_VERSION_MIN_REQUIRED < 1050
|
||||
// code in here might run on pre-Leopard OS
|
||||
#else
|
||||
// code here can assume Leopard or later
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
*/
|
||||
|
||||
#define __MAC_10_0 1000
|
||||
#define __MAC_10_1 1010
|
||||
#define __MAC_10_2 1020
|
||||
#define __MAC_10_3 1030
|
||||
#define __MAC_10_4 1040
|
||||
#define __MAC_10_5 1050
|
||||
#define __MAC_10_6 1060
|
||||
#define __MAC_10_7 1070
|
||||
#define __MAC_10_8 1080
|
||||
#define __MAC_10_9 1090
|
||||
#define __MAC_10_10 101000
|
||||
#define __MAC_10_10_2 101002
|
||||
#define __MAC_10_10_3 101003
|
||||
#define __MAC_10_11 101100
|
||||
#define __MAC_10_11_2 101102
|
||||
#define __MAC_10_11_3 101103
|
||||
#define __MAC_10_11_4 101104
|
||||
#define __MAC_10_12 101200
|
||||
#define __MAC_10_12_1 101201
|
||||
#define __MAC_10_12_2 101202
|
||||
#define __MAC_10_12_4 101204
|
||||
#define __MAC_10_13 101300
|
||||
#define __MAC_10_13_1 101301
|
||||
#define __MAC_10_13_2 101302
|
||||
#define __MAC_10_13_4 101304
|
||||
/* __MAC_NA is not defined to a value but is uses as a token by macros to indicate that the API is unavailable */
|
||||
|
||||
#define __IPHONE_2_0 20000
|
||||
#define __IPHONE_2_1 20100
|
||||
#define __IPHONE_2_2 20200
|
||||
#define __IPHONE_3_0 30000
|
||||
#define __IPHONE_3_1 30100
|
||||
#define __IPHONE_3_2 30200
|
||||
#define __IPHONE_4_0 40000
|
||||
#define __IPHONE_4_1 40100
|
||||
#define __IPHONE_4_2 40200
|
||||
#define __IPHONE_4_3 40300
|
||||
#define __IPHONE_5_0 50000
|
||||
#define __IPHONE_5_1 50100
|
||||
#define __IPHONE_6_0 60000
|
||||
#define __IPHONE_6_1 60100
|
||||
#define __IPHONE_7_0 70000
|
||||
#define __IPHONE_7_1 70100
|
||||
#define __IPHONE_8_0 80000
|
||||
#define __IPHONE_8_1 80100
|
||||
#define __IPHONE_8_2 80200
|
||||
#define __IPHONE_8_3 80300
|
||||
#define __IPHONE_8_4 80400
|
||||
#define __IPHONE_9_0 90000
|
||||
#define __IPHONE_9_1 90100
|
||||
#define __IPHONE_9_2 90200
|
||||
#define __IPHONE_9_3 90300
|
||||
#define __IPHONE_10_0 100000
|
||||
#define __IPHONE_10_1 100100
|
||||
#define __IPHONE_10_2 100200
|
||||
#define __IPHONE_10_3 100300
|
||||
#define __IPHONE_11_0 110000
|
||||
#define __IPHONE_11_1 110100
|
||||
#define __IPHONE_11_2 110200
|
||||
#define __IPHONE_11_3 110300
|
||||
/* __IPHONE_NA is not defined to a value but is uses as a token by macros to indicate that the API is unavailable */
|
||||
|
||||
#define __TVOS_9_0 90000
|
||||
#define __TVOS_9_1 90100
|
||||
#define __TVOS_9_2 90200
|
||||
#define __TVOS_10_0 100000
|
||||
#define __TVOS_10_0_1 100001
|
||||
#define __TVOS_10_1 100100
|
||||
#define __TVOS_10_2 100200
|
||||
#define __TVOS_11_0 110000
|
||||
#define __TVOS_11_1 110100
|
||||
#define __TVOS_11_2 110200
|
||||
#define __TVOS_11_3 110300
|
||||
|
||||
#define __WATCHOS_1_0 10000
|
||||
#define __WATCHOS_2_0 20000
|
||||
#define __WATCHOS_2_1 20100
|
||||
#define __WATCHOS_2_2 20200
|
||||
#define __WATCHOS_3_0 30000
|
||||
#define __WATCHOS_3_1 30100
|
||||
#define __WATCHOS_3_1_1 30101
|
||||
#define __WATCHOS_3_2 30200
|
||||
#define __WATCHOS_4_0 40000
|
||||
#define __WATCHOS_4_1 40100
|
||||
#define __WATCHOS_4_2 40200
|
||||
#define __WATCHOS_4_3 40300
|
||||
|
||||
#include <AvailabilityInternal.h>
|
||||
|
||||
#ifdef __IPHONE_OS_VERSION_MIN_REQUIRED
|
||||
#define __OSX_AVAILABLE_STARTING(_osx, _ios) __AVAILABILITY_INTERNAL##_ios
|
||||
#define __OSX_AVAILABLE_BUT_DEPRECATED(_osxIntro, _osxDep, _iosIntro, _iosDep) \
|
||||
__AVAILABILITY_INTERNAL##_iosIntro##_DEP##_iosDep
|
||||
#define __OSX_AVAILABLE_BUT_DEPRECATED_MSG(_osxIntro, _osxDep, _iosIntro, _iosDep, _msg) \
|
||||
__AVAILABILITY_INTERNAL##_iosIntro##_DEP##_iosDep##_MSG(_msg)
|
||||
|
||||
#elif defined(__MAC_OS_X_VERSION_MIN_REQUIRED)
|
||||
#define __OSX_AVAILABLE_STARTING(_osx, _ios) __AVAILABILITY_INTERNAL##_osx
|
||||
#define __OSX_AVAILABLE_BUT_DEPRECATED(_osxIntro, _osxDep, _iosIntro, _iosDep) \
|
||||
__AVAILABILITY_INTERNAL##_osxIntro##_DEP##_osxDep
|
||||
#define __OSX_AVAILABLE_BUT_DEPRECATED_MSG(_osxIntro, _osxDep, _iosIntro, _iosDep, _msg) \
|
||||
__AVAILABILITY_INTERNAL##_osxIntro##_DEP##_osxDep##_MSG(_msg)
|
||||
|
||||
#else
|
||||
#define __OSX_AVAILABLE_STARTING(_osx, _ios)
|
||||
#define __OSX_AVAILABLE_BUT_DEPRECATED(_osxIntro, _osxDep, _iosIntro, _iosDep)
|
||||
#define __OSX_AVAILABLE_BUT_DEPRECATED_MSG(_osxIntro, _osxDep, _iosIntro, _iosDep, _msg)
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__has_feature)
|
||||
#if __has_feature(attribute_availability_with_message)
|
||||
#define __OS_AVAILABILITY(_target, _availability) __attribute__((availability(_target,_availability)))
|
||||
#define __OS_AVAILABILITY_MSG(_target, _availability, _msg) __attribute__((availability(_target,_availability,message=_msg)))
|
||||
#elif __has_feature(attribute_availability)
|
||||
#define __OS_AVAILABILITY(_target, _availability) __attribute__((availability(_target,_availability)))
|
||||
#define __OS_AVAILABILITY_MSG(_target, _availability, _msg) __attribute__((availability(_target,_availability)))
|
||||
#else
|
||||
#define __OS_AVAILABILITY(_target, _availability)
|
||||
#define __OS_AVAILABILITY_MSG(_target, _availability, _msg)
|
||||
#endif
|
||||
#else
|
||||
#define __OS_AVAILABILITY(_target, _availability)
|
||||
#define __OS_AVAILABILITY_MSG(_target, _availability, _msg)
|
||||
#endif
|
||||
|
||||
|
||||
/* for use to document app extension usage */
|
||||
#if defined(__has_feature)
|
||||
#if __has_feature(attribute_availability_app_extension)
|
||||
#define __OSX_EXTENSION_UNAVAILABLE(_msg) __OS_AVAILABILITY_MSG(macosx_app_extension,unavailable,_msg)
|
||||
#define __IOS_EXTENSION_UNAVAILABLE(_msg) __OS_AVAILABILITY_MSG(ios_app_extension,unavailable,_msg)
|
||||
#else
|
||||
#define __OSX_EXTENSION_UNAVAILABLE(_msg)
|
||||
#define __IOS_EXTENSION_UNAVAILABLE(_msg)
|
||||
#endif
|
||||
#else
|
||||
#define __OSX_EXTENSION_UNAVAILABLE(_msg)
|
||||
#define __IOS_EXTENSION_UNAVAILABLE(_msg)
|
||||
#endif
|
||||
|
||||
#define __OS_EXTENSION_UNAVAILABLE(_msg) __OSX_EXTENSION_UNAVAILABLE(_msg) __IOS_EXTENSION_UNAVAILABLE(_msg)
|
||||
|
||||
|
||||
|
||||
/* for use marking APIs available info for Mac OSX */
|
||||
#if defined(__has_attribute)
|
||||
#if __has_attribute(availability)
|
||||
#define __OSX_UNAVAILABLE __OS_AVAILABILITY(macosx,unavailable)
|
||||
#define __OSX_AVAILABLE(_vers) __OS_AVAILABILITY(macosx,introduced=_vers)
|
||||
#define __OSX_DEPRECATED(_start, _dep, _msg) __OSX_AVAILABLE(_start) __OS_AVAILABILITY_MSG(macosx,deprecated=_dep,_msg)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef __OSX_UNAVAILABLE
|
||||
#define __OSX_UNAVAILABLE
|
||||
#endif
|
||||
|
||||
#ifndef __OSX_AVAILABLE
|
||||
#define __OSX_AVAILABLE(_vers)
|
||||
#endif
|
||||
|
||||
#ifndef __OSX_DEPRECATED
|
||||
#define __OSX_DEPRECATED(_start, _dep, _msg)
|
||||
#endif
|
||||
|
||||
|
||||
/* for use marking APIs available info for iOS */
|
||||
#if defined(__has_attribute)
|
||||
#if __has_attribute(availability)
|
||||
#define __IOS_UNAVAILABLE __OS_AVAILABILITY(ios,unavailable)
|
||||
#define __IOS_PROHIBITED __OS_AVAILABILITY(ios,unavailable)
|
||||
#define __IOS_AVAILABLE(_vers) __OS_AVAILABILITY(ios,introduced=_vers)
|
||||
#define __IOS_DEPRECATED(_start, _dep, _msg) __IOS_AVAILABLE(_start) __OS_AVAILABILITY_MSG(ios,deprecated=_dep,_msg)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef __IOS_UNAVAILABLE
|
||||
#define __IOS_UNAVAILABLE
|
||||
#endif
|
||||
|
||||
#ifndef __IOS_PROHIBITED
|
||||
#define __IOS_PROHIBITED
|
||||
#endif
|
||||
|
||||
#ifndef __IOS_AVAILABLE
|
||||
#define __IOS_AVAILABLE(_vers)
|
||||
#endif
|
||||
|
||||
#ifndef __IOS_DEPRECATED
|
||||
#define __IOS_DEPRECATED(_start, _dep, _msg)
|
||||
#endif
|
||||
|
||||
|
||||
/* for use marking APIs available info for tvOS */
|
||||
#if defined(__has_feature)
|
||||
#if __has_feature(attribute_availability_tvos)
|
||||
#define __TVOS_UNAVAILABLE __OS_AVAILABILITY(tvos,unavailable)
|
||||
#define __TVOS_PROHIBITED __OS_AVAILABILITY(tvos,unavailable)
|
||||
#define __TVOS_AVAILABLE(_vers) __OS_AVAILABILITY(tvos,introduced=_vers)
|
||||
#define __TVOS_DEPRECATED(_start, _dep, _msg) __TVOS_AVAILABLE(_start) __OS_AVAILABILITY_MSG(tvos,deprecated=_dep,_msg)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef __TVOS_UNAVAILABLE
|
||||
#define __TVOS_UNAVAILABLE
|
||||
#endif
|
||||
|
||||
#ifndef __TVOS_PROHIBITED
|
||||
#define __TVOS_PROHIBITED
|
||||
#endif
|
||||
|
||||
#ifndef __TVOS_AVAILABLE
|
||||
#define __TVOS_AVAILABLE(_vers)
|
||||
#endif
|
||||
|
||||
#ifndef __TVOS_DEPRECATED
|
||||
#define __TVOS_DEPRECATED(_start, _dep, _msg)
|
||||
#endif
|
||||
|
||||
|
||||
/* for use marking APIs available info for Watch OS */
|
||||
#if defined(__has_feature)
|
||||
#if __has_feature(attribute_availability_watchos)
|
||||
#define __WATCHOS_UNAVAILABLE __OS_AVAILABILITY(watchos,unavailable)
|
||||
#define __WATCHOS_PROHIBITED __OS_AVAILABILITY(watchos,unavailable)
|
||||
#define __WATCHOS_AVAILABLE(_vers) __OS_AVAILABILITY(watchos,introduced=_vers)
|
||||
#define __WATCHOS_DEPRECATED(_start, _dep, _msg) __WATCHOS_AVAILABLE(_start) __OS_AVAILABILITY_MSG(watchos,deprecated=_dep,_msg)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef __WATCHOS_UNAVAILABLE
|
||||
#define __WATCHOS_UNAVAILABLE
|
||||
#endif
|
||||
|
||||
#ifndef __WATCHOS_PROHIBITED
|
||||
#define __WATCHOS_PROHIBITED
|
||||
#endif
|
||||
|
||||
#ifndef __WATCHOS_AVAILABLE
|
||||
#define __WATCHOS_AVAILABLE(_vers)
|
||||
#endif
|
||||
|
||||
#ifndef __WATCHOS_DEPRECATED
|
||||
#define __WATCHOS_DEPRECATED(_start, _dep, _msg)
|
||||
#endif
|
||||
|
||||
|
||||
/* for use marking APIs unavailable for swift */
|
||||
#if defined(__has_feature)
|
||||
#if __has_feature(attribute_availability_swift)
|
||||
#define __SWIFT_UNAVAILABLE __OS_AVAILABILITY(swift,unavailable)
|
||||
#define __SWIFT_UNAVAILABLE_MSG(_msg) __OS_AVAILABILITY_MSG(swift,unavailable,_msg)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef __SWIFT_UNAVAILABLE
|
||||
#define __SWIFT_UNAVAILABLE
|
||||
#endif
|
||||
|
||||
#ifndef __SWIFT_UNAVAILABLE_MSG
|
||||
#define __SWIFT_UNAVAILABLE_MSG(_msg)
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
Macros for defining which versions/platform a given symbol can be used.
|
||||
|
||||
@see http://clang.llvm.org/docs/AttributeReference.html#availability
|
||||
|
||||
* Note that these macros are only compatible with clang compilers that
|
||||
* support the following target selection options:
|
||||
*
|
||||
* -mmacosx-version-min
|
||||
* -miphoneos-version-min
|
||||
* -mwatchos-version-min
|
||||
* -mtvos-version-min
|
||||
* -mbridgeos-version-min
|
||||
*/
|
||||
|
||||
#if defined(__has_feature) && defined(__has_attribute)
|
||||
#if __has_attribute(availability)
|
||||
|
||||
/*
|
||||
* API Introductions
|
||||
*
|
||||
* Use to specify the release that a particular API became available.
|
||||
*
|
||||
* Platform names:
|
||||
* macos, ios, tvos, watchos
|
||||
*
|
||||
* Examples:
|
||||
* __API_AVAILABLE(macos(10.10))
|
||||
* __API_AVAILABLE(macos(10.9), ios(10.0))
|
||||
* __API_AVAILABLE(macos(10.4), ios(8.0), watchos(2.0), tvos(10.0))
|
||||
*/
|
||||
#define __API_AVAILABLE(...) __API_AVAILABLE_GET_MACRO(__VA_ARGS__,__API_AVAILABLE5, __API_AVAILABLE4, __API_AVAILABLE3, __API_AVAILABLE2, __API_AVAILABLE1)(__VA_ARGS__)
|
||||
|
||||
|
||||
/*
|
||||
* API Deprecations
|
||||
*
|
||||
* Use to specify the release that a particular API became unavailable.
|
||||
*
|
||||
* Platform names:
|
||||
* macos, ios, tvos, watchos
|
||||
*
|
||||
* Examples:
|
||||
*
|
||||
* __API_DEPRECATED("No longer supported", macos(10.4, 10.8))
|
||||
* __API_DEPRECATED("No longer supported", macos(10.4, 10.8), ios(2.0, 3.0), watchos(2.0, 3.0), tvos(9.0, 10.0))
|
||||
*
|
||||
* __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_MSG6,__API_DEPRECATED_MSG5,__API_DEPRECATED_MSG4,__API_DEPRECATED_MSG3,__API_DEPRECATED_MSG2,__API_DEPRECATED_MSG1)(__VA_ARGS__)
|
||||
#define __API_DEPRECATED_WITH_REPLACEMENT(...) __API_DEPRECATED_REP_GET_MACRO(__VA_ARGS__,__API_DEPRECATED_REP6,__API_DEPRECATED_REP5,__API_DEPRECATED_REP4,__API_DEPRECATED_REP3,__API_DEPRECATED_REP2,__API_DEPRECATED_REP1)(__VA_ARGS__)
|
||||
|
||||
/*
|
||||
* API Unavailability
|
||||
* Use to specify that an API is unavailable for a particular platform.
|
||||
*
|
||||
* Example:
|
||||
* __API_UNAVAILABLE(macos)
|
||||
* __API_UNAVAILABLE(watchos, tvos)
|
||||
*/
|
||||
#define __API_UNAVAILABLE(...) __API_UNAVAILABLE_GET_MACRO(__VA_ARGS__,__API_UNAVAILABLE4,__API_UNAVAILABLE3,__API_UNAVAILABLE2,__API_UNAVAILABLE1)(__VA_ARGS__)
|
||||
#else
|
||||
|
||||
/*
|
||||
* Evaluate to nothing for compilers that don't support availability.
|
||||
*/
|
||||
|
||||
#define __API_AVAILABLE(...)
|
||||
#define __API_DEPRECATED(...)
|
||||
#define __API_DEPRECATED_WITH_REPLACEMENT(...)
|
||||
#define __API_UNAVAILABLE(...)
|
||||
#endif /* __has_attribute(availability) */
|
||||
#else
|
||||
|
||||
/*
|
||||
* Evaluate to nothing for compilers that don't support clang language extensions.
|
||||
*/
|
||||
|
||||
#define __API_AVAILABLE(...)
|
||||
#define __API_DEPRECATED(...)
|
||||
#define __API_DEPRECATED_WITH_REPLACEMENT(...)
|
||||
#define __API_UNAVAILABLE(...)
|
||||
#endif /* #if defined(__has_feature) && defined(__has_attribute) */
|
||||
|
||||
#endif /* __AVAILABILITY__ */
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
+146
-1
@@ -36,7 +36,152 @@
|
||||
# include <support/newlib/xlocale.h>
|
||||
#elif (defined(__APPLE__) || defined(__FreeBSD__) \
|
||||
|| defined(__EMSCRIPTEN__) || defined(__IBMCPP__))
|
||||
# include <xlocale.h>
|
||||
#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_ALL_MASK LC_COLLATE_MASK | LC_CTYPE_MASK | LC_MESSAGES_MASK | LC_MONETARY_MASK | LC_NUMERIC_MASK | LC_TIME_MASK
|
||||
typedef unsigned int __uint32_t;
|
||||
#define _CTYPE_A 0x00000100L /* Alpha */
|
||||
#define _CTYPE_C 0x00000200L /* Control */
|
||||
#define _CTYPE_D 0x00000400L /* Digit */
|
||||
#define _CTYPE_G 0x00000800L /* Graph */
|
||||
#define _CTYPE_L 0x00001000L /* Lower */
|
||||
#define _CTYPE_P 0x00002000L /* Punct */
|
||||
#define _CTYPE_S 0x00004000L /* Space */
|
||||
#define _CTYPE_U 0x00008000L /* Upper */
|
||||
#define _CTYPE_X 0x00010000L /* X digit */
|
||||
#define _CTYPE_B 0x00020000L /* Blank */
|
||||
#define _CTYPE_R 0x00040000L /* Print */
|
||||
#define _CTYPE_I 0x00080000L /* Ideogram */
|
||||
#define _CTYPE_T 0x00100000L /* Special */
|
||||
#define _CTYPE_Q 0x00200000L /* Phonogram */
|
||||
#define _CTYPE_SW0 0x20000000L /* 0 width character */
|
||||
#define _CTYPE_SW1 0x40000000L /* 1 width character */
|
||||
#define _CTYPE_SW2 0x80000000L /* 2 width character */
|
||||
#define _CTYPE_SW3 0xc0000000L /* 3 width character */
|
||||
#define _CTYPE_SWM 0xe0000000L /* Mask for screen width data */
|
||||
#define _CTYPE_SWS 30 /* Bits to shift to get width */
|
||||
# include <support/musl/xlocale.h>
|
||||
int isascii(int);
|
||||
int toascii(int);
|
||||
int isalnum_l(int, locale_t);
|
||||
int isalpha_l(int, locale_t);
|
||||
int isblank_l(int, locale_t);
|
||||
int iscntrl_l(int, locale_t);
|
||||
int isdigit_l(int, locale_t);
|
||||
int isgraph_l(int, locale_t);
|
||||
int islower_l(int, locale_t);
|
||||
int isprint_l(int, locale_t);
|
||||
int ispunct_l(int, locale_t);
|
||||
int isspace_l(int, locale_t);
|
||||
int isupper_l(int, locale_t);
|
||||
int isxdigit_l(int, locale_t);
|
||||
int tolower_l(int, locale_t);
|
||||
int toupper_l(int, locale_t);
|
||||
locale_t newlocale(int category_mask, const char *locale, locale_t base);
|
||||
void freelocale(locale_t locobj);
|
||||
int strcoll_l(const char *s1, const char *s2, locale_t loc);
|
||||
int wcscoll_l(const wchar_t *ws1, const wchar_t *ws2, locale_t locale);
|
||||
size_t wcsxfrm_l(wchar_t * ws1, const wchar_t * ws2, size_t n, locale_t locale);
|
||||
size_t strxfrm_l(char * s1, const char * s2, size_t n, locale_t loc);
|
||||
int iswspace_l(wint_t wc, locale_t locale);
|
||||
int iswctype_l(wint_t wc, wctype_t charclass, locale_t locale);
|
||||
int iswprint_l(wint_t wc, locale_t locale);
|
||||
int iswupper_l(wint_t wc, locale_t locale);
|
||||
int iswlower_l(wint_t wc, locale_t locale);
|
||||
int iswalpha_l(wint_t wc, locale_t locale);
|
||||
int iswdigit_l(wint_t wc, locale_t locale);
|
||||
int iswpunct_l(wint_t wc, locale_t locale);
|
||||
int iswxdigit_l(wint_t wc, locale_t locale);
|
||||
int iswcntrl_l(wint_t wc, locale_t locale);
|
||||
int iswblank_l(wint_t wc, locale_t locale);
|
||||
wint_t towupper_l(wint_t wc, locale_t locale);
|
||||
wint_t towlower_l(wint_t wc, locale_t locale);
|
||||
wint_t btowc_l(int c, locale_t loc);
|
||||
size_t wcsnrtombs_l(char * dst, const wchar_t ** src,
|
||||
size_t nwc, size_t len, mbstate_t * ps, locale_t loc);
|
||||
size_t wcsrtombs_l(char * dst, const wchar_t ** src, size_t len,
|
||||
mbstate_t * ps, locale_t loc);
|
||||
size_t wcrtomb_l(char * s, wchar_t wc, mbstate_t * ps,
|
||||
locale_t loc);
|
||||
size_t mbsrtowcs_l(wchar_t * dst, const char ** src, size_t len,
|
||||
mbstate_t * ps, locale_t loc);
|
||||
size_t mbsnrtowcs_l(wchar_t * dst, const char ** src,
|
||||
size_t nms, size_t len, mbstate_t * ps, locale_t loc);
|
||||
size_t mbrtowc_l(wchar_t * pwc, const char * s, size_t n,
|
||||
mbstate_t * ps, locale_t loc);
|
||||
int mbtowc_l(wchar_t * pwc, const char * s, size_t n,
|
||||
locale_t loc);
|
||||
#define MB_CUR_MAX_L(x) 8
|
||||
size_t mbrlen_l(const char * s, size_t n, mbstate_t * ps,
|
||||
locale_t loc);
|
||||
struct lconv * localeconv_l(locale_t loc);
|
||||
int wctob_l(wint_t c, locale_t loc);
|
||||
int asprintf_l(char **ret, locale_t loc, const char * format, ...);
|
||||
int snprintf_l(char* str, size_t size, locale_t loc, const char* format, ...);
|
||||
int sscanf_l(const char* str, locale_t loc, const char* format, ...);
|
||||
typedef int __darwin_rune_t; /* rune_t */
|
||||
typedef size_t __darwin_size_t; /* rune_t */
|
||||
#define _CACHED_RUNES (1 <<8 ) /* Must be a power of 2 */
|
||||
#define _CRMASK (~(_CACHED_RUNES - 1))
|
||||
|
||||
/*
|
||||
* The lower 8 bits of runetype[] contain the digit value of the rune.
|
||||
*/
|
||||
typedef struct {
|
||||
__darwin_rune_t __min; /* First rune of the range */
|
||||
__darwin_rune_t __max; /* Last rune (inclusive) of the range */
|
||||
__darwin_rune_t __map; /* What first maps to in maps */
|
||||
__uint32_t *__types; /* Array of types in range */
|
||||
} _RuneEntry;
|
||||
|
||||
typedef struct {
|
||||
int __nranges; /* Number of ranges stored */
|
||||
_RuneEntry *__ranges; /* Pointer to the ranges */
|
||||
} _RuneRange;
|
||||
|
||||
typedef struct {
|
||||
char __name[14]; /* CHARCLASS_NAME_MAX = 14 */
|
||||
__uint32_t __mask; /* charclass mask */
|
||||
} _RuneCharClass;
|
||||
|
||||
typedef struct {
|
||||
char __magic[8]; /* Magic saying what version we are */
|
||||
char __encoding[32]; /* ASCII name of this encoding */
|
||||
|
||||
__darwin_rune_t (*__sgetrune)(const char *, __darwin_size_t, char const **);
|
||||
int (*__sputrune)(__darwin_rune_t, char *, __darwin_size_t, char **);
|
||||
__darwin_rune_t __invalid_rune;
|
||||
|
||||
__uint32_t __runetype[_CACHED_RUNES];
|
||||
__darwin_rune_t __maplower[_CACHED_RUNES];
|
||||
__darwin_rune_t __mapupper[_CACHED_RUNES];
|
||||
|
||||
/*
|
||||
* The following are to deal with Runes larger than _CACHED_RUNES - 1.
|
||||
* Their data is actually contiguous with this structure so as to make
|
||||
* it easier to read/write from/to disk.
|
||||
*/
|
||||
_RuneRange __runetype_ext;
|
||||
_RuneRange __maplower_ext;
|
||||
_RuneRange __mapupper_ext;
|
||||
|
||||
void *__variable; /* Data which depends on the encoding */
|
||||
int __variable_len; /* how long that data is */
|
||||
|
||||
/*
|
||||
* extra fields to deal with arbitrary character classes
|
||||
*/
|
||||
int __ncharclasses;
|
||||
_RuneCharClass *__charclasses;
|
||||
} _RuneLocale;
|
||||
|
||||
#define _RUNE_MAGIC_A "RuneMagA" /* Indicates version A of RuneLocale */
|
||||
extern _RuneLocale _DefaultRuneLocale;
|
||||
extern _RuneLocale *_CurrentRuneLocale;
|
||||
#elif defined(__Fuchsia__)
|
||||
# include <support/fuchsia/xlocale.h>
|
||||
#elif defined(_LIBCPP_HAS_MUSL_LIBC)
|
||||
|
||||
+1
-1
@@ -429,7 +429,7 @@ template <class E> constexpr const E* data(initializer_list<E> il) noexcept;
|
||||
#include <cstddef>
|
||||
#include <initializer_list>
|
||||
#ifdef __APPLE__
|
||||
#include <Availability.h>
|
||||
#include "Availability.h"
|
||||
#endif
|
||||
|
||||
#include <__debug>
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
#ifndef _CTYPE_H
|
||||
#define _CTYPE_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <features.h>
|
||||
|
||||
int isalnum(int);
|
||||
int isalpha(int);
|
||||
int isblank(int);
|
||||
int iscntrl(int);
|
||||
int isdigit(int);
|
||||
int isgraph(int);
|
||||
int islower(int);
|
||||
int isprint(int);
|
||||
int ispunct(int);
|
||||
int isspace(int);
|
||||
int isupper(int);
|
||||
int isxdigit(int);
|
||||
int tolower(int);
|
||||
int toupper(int);
|
||||
|
||||
#ifndef __cplusplus
|
||||
static __inline int __isspace(int _c)
|
||||
{
|
||||
return _c == ' ' || (unsigned)_c-'\t' < 5;
|
||||
}
|
||||
|
||||
#define isalpha(a) (0 ? isalpha(a) : (((unsigned)(a)|32)-'a') < 26)
|
||||
#define isdigit(a) (0 ? isdigit(a) : ((unsigned)(a)-'0') < 10)
|
||||
#define islower(a) (0 ? islower(a) : ((unsigned)(a)-'a') < 26)
|
||||
#define isupper(a) (0 ? isupper(a) : ((unsigned)(a)-'A') < 26)
|
||||
#define isprint(a) (0 ? isprint(a) : ((unsigned)(a)-0x20) < 0x5f)
|
||||
#define isgraph(a) (0 ? isgraph(a) : ((unsigned)(a)-0x21) < 0x5e)
|
||||
#define isspace(a) __isspace(a)
|
||||
#endif
|
||||
|
||||
|
||||
#define __NEED_locale_t
|
||||
#include <bits/alltypes.h>
|
||||
|
||||
int isalnum_l(int, locale_t);
|
||||
int isalpha_l(int, locale_t);
|
||||
int isblank_l(int, locale_t);
|
||||
int iscntrl_l(int, locale_t);
|
||||
int isdigit_l(int, locale_t);
|
||||
int isgraph_l(int, locale_t);
|
||||
int islower_l(int, locale_t);
|
||||
int isprint_l(int, locale_t);
|
||||
int ispunct_l(int, locale_t);
|
||||
int isspace_l(int, locale_t);
|
||||
int isupper_l(int, locale_t);
|
||||
int isxdigit_l(int, locale_t);
|
||||
int tolower_l(int, locale_t);
|
||||
int toupper_l(int, locale_t);
|
||||
|
||||
int isascii(int);
|
||||
int toascii(int);
|
||||
#define _tolower(a) ((a)|0x20)
|
||||
#define _toupper(a) ((a)&0x5f)
|
||||
#define isascii(a) (0 ? isascii(a) : (unsigned)(a) < 128)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
+3
-1
@@ -11,12 +11,14 @@
|
||||
#include "new"
|
||||
#include "typeinfo"
|
||||
|
||||
#if defined(LIBCXXRT) || defined(LIBCXX_BUILDING_LIBCXXABI) || \
|
||||
#if 0
|
||||
#if defined(LIBCXXRT) || defined(LIBCXX_BUILDING_LIBCXXABI) || \
|
||||
(defined(__APPLE__) && !defined(_LIBCPP_BUILDING_HAS_NO_ABI_LIBRARY))
|
||||
#include <cxxabi.h>
|
||||
using namespace __cxxabiv1;
|
||||
#define HAVE_DEPENDENT_EH_ABI 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(_LIBCPP_ABI_MICROSOFT)
|
||||
#include "support/runtime/exception_msvc.ipp"
|
||||
|
||||
@@ -0,0 +1,451 @@
|
||||
/*
|
||||
File: AvailabilityMacros.h
|
||||
|
||||
Copyright: (c) 2001-2005 by Apple Computer, Inc., all rights reserved.
|
||||
|
||||
More Info: See TechNote 2064
|
||||
|
||||
Contains: Autoconfiguration of AVAILABLE_ macros for Mac OS X
|
||||
|
||||
This header enables a developer to specify build time
|
||||
constraints on what Mac OS X versions the resulting
|
||||
application will be run. There are two bounds a developer
|
||||
can specify:
|
||||
|
||||
MAC_OS_X_VERSION_MIN_REQUIRED
|
||||
MAC_OS_X_VERSION_MAX_ALLOWED
|
||||
|
||||
The lower bound controls which calls to OS functions will
|
||||
be weak-importing (allowed to be unresolved at launch time).
|
||||
The upper bound controls which OS functionality, if used,
|
||||
will result in a compiler error because that functionality is
|
||||
not available on on any OS is the specifed range.
|
||||
|
||||
For example, suppose an application is compiled with:
|
||||
|
||||
MAC_OS_X_VERSION_MIN_REQUIRED = MAC_OS_X_VERSION_10_2
|
||||
MAC_OS_X_VERSION_MAX_ALLOWED = MAC_OS_X_VERSION_10_3
|
||||
|
||||
and an OS header contains:
|
||||
|
||||
extern void funcA(void) AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER;
|
||||
extern void funcB(void) AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_2;
|
||||
extern void funcC(void) AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_3;
|
||||
extern void funcD(void) AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER;
|
||||
extern void funcE(void) AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER;
|
||||
extern void funcF(void) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER;
|
||||
extern void funcG(void) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
|
||||
|
||||
typedef long TypeA DEPRECATED_IN_MAC_OS_X_VERSION_10_0_AND_LATER;
|
||||
typedef long TypeB DEPRECATED_IN_MAC_OS_X_VERSION_10_1_AND_LATER;
|
||||
typedef long TypeC DEPRECATED_IN_MAC_OS_X_VERSION_10_2_AND_LATER;
|
||||
typedef long TypeD DEPRECATED_IN_MAC_OS_X_VERSION_10_3_AND_LATER;
|
||||
typedef long TypeE DEPRECATED_IN_MAC_OS_X_VERSION_10_4_AND_LATER;
|
||||
|
||||
Any application code which uses these declarations will get the following:
|
||||
|
||||
compile link run
|
||||
------- ------ -------
|
||||
funcA: normal normal normal
|
||||
funcB: warning normal normal
|
||||
funcC: normal normal normal
|
||||
funcD: normal normal normal
|
||||
funcE: normal normal normal
|
||||
funcF: normal weak on 10.3 normal, on 10.2 (&funcF == NULL)
|
||||
funcG: error error n/a
|
||||
typeA: warning
|
||||
typeB: warning
|
||||
typeC: warning
|
||||
typeD: normal
|
||||
typeE: normal
|
||||
|
||||
|
||||
*/
|
||||
#ifndef __AVAILABILITYMACROS__
|
||||
#define __AVAILABILITYMACROS__
|
||||
|
||||
|
||||
/*
|
||||
* Set up standard Mac OS X versions
|
||||
*/
|
||||
#define MAC_OS_X_VERSION_10_0 1000
|
||||
#define MAC_OS_X_VERSION_10_1 1010
|
||||
#define MAC_OS_X_VERSION_10_2 1020
|
||||
#define MAC_OS_X_VERSION_10_3 1030
|
||||
#define MAC_OS_X_VERSION_10_4 1040
|
||||
|
||||
|
||||
/*
|
||||
* If min OS not specified, assume 10.1
|
||||
* Note: gcc driver may set _ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED_ based on MACOSX_DEPLOYMENT_TARGET environment variable
|
||||
*/
|
||||
#ifndef MAC_OS_X_VERSION_MIN_REQUIRED
|
||||
#ifdef __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
|
||||
#define MAC_OS_X_VERSION_MIN_REQUIRED __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
|
||||
#else
|
||||
#if __ppc64__
|
||||
#define MAC_OS_X_VERSION_MIN_REQUIRED MAC_OS_X_VERSION_10_4
|
||||
#else
|
||||
#define MAC_OS_X_VERSION_MIN_REQUIRED MAC_OS_X_VERSION_10_1
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* if max OS not specified, assume largerof(10.4, min)
|
||||
*/
|
||||
#ifndef MAC_OS_X_VERSION_MAX_ALLOWED
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_4
|
||||
#define MAC_OS_X_VERSION_MAX_ALLOWED MAC_OS_X_VERSION_MIN_REQUIRED
|
||||
#else
|
||||
#define MAC_OS_X_VERSION_MAX_ALLOWED MAC_OS_X_VERSION_10_4
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Error on bad values
|
||||
*/
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_MIN_REQUIRED
|
||||
#error MAC_OS_X_VERSION_MAX_ALLOWED must be >= MAC_OS_X_VERSION_MIN_REQUIRED
|
||||
#endif
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_0
|
||||
#error MAC_OS_X_VERSION_MIN_REQUIRED must be >= MAC_OS_X_VERSION_10_0
|
||||
#endif
|
||||
|
||||
/*
|
||||
* only certain compilers support __attribute((weak_import))__
|
||||
*/
|
||||
#if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1))) && (MAC_OS_X_VERSION_MIN_REQUIRED >= 1020)
|
||||
#define WEAK_IMPORT_ATTRIBUTE __attribute__((weak_import))
|
||||
#else
|
||||
#define WEAK_IMPORT_ATTRIBUTE
|
||||
#endif
|
||||
|
||||
/*
|
||||
* only certain compilers support __attribute((deprecated))__
|
||||
*/
|
||||
#if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)))
|
||||
#define DEPRECATED_ATTRIBUTE __attribute__((deprecated))
|
||||
#else
|
||||
#define DEPRECATED_ATTRIBUTE
|
||||
#endif
|
||||
|
||||
/*
|
||||
* only certain compilers support __attribute((unavailable))__
|
||||
*/
|
||||
#if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)))
|
||||
#define UNAVAILABLE_ATTRIBUTE __attribute__((unavailable))
|
||||
#else
|
||||
#define UNAVAILABLE_ATTRIBUTE
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
|
||||
*
|
||||
* Used on functions introduced in Mac OS X 10.0
|
||||
*/
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
|
||||
|
||||
/*
|
||||
* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED
|
||||
*
|
||||
* Used on functions introduced in Mac OS X 10.0,
|
||||
* and deprecated in Mac OS X 10.0
|
||||
*/
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE
|
||||
|
||||
/*
|
||||
* DEPRECATED_IN_MAC_OS_X_VERSION_10_0_AND_LATER
|
||||
*
|
||||
* Used on types deprecated in Mac OS X 10.0
|
||||
*/
|
||||
#define DEPRECATED_IN_MAC_OS_X_VERSION_10_0_AND_LATER DEPRECATED_ATTRIBUTE
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER
|
||||
*
|
||||
* Used on declarations introduced in Mac OS X 10.1
|
||||
*/
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_1
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER UNAVAILABLE_ATTRIBUTE
|
||||
#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_1
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER WEAK_IMPORT_ATTRIBUTE
|
||||
#else
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER
|
||||
#endif
|
||||
|
||||
/*
|
||||
* AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED
|
||||
*
|
||||
* Used on declarations introduced in Mac OS X 10.1,
|
||||
* and deprecated in Mac OS X 10.1
|
||||
*/
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_1
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE
|
||||
#else
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER
|
||||
#endif
|
||||
|
||||
/*
|
||||
* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_1
|
||||
*
|
||||
* Used on declarations introduced in Mac OS X 10.0,
|
||||
* but later deprecated in Mac OS X 10.1
|
||||
*/
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_1
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_1 DEPRECATED_ATTRIBUTE
|
||||
#else
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_1 AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
|
||||
#endif
|
||||
|
||||
/*
|
||||
* DEPRECATED_IN_MAC_OS_X_VERSION_10_1_AND_LATER
|
||||
*
|
||||
* Used on types deprecated in Mac OS X 10.1
|
||||
*/
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_1
|
||||
#define DEPRECATED_IN_MAC_OS_X_VERSION_10_1_AND_LATER DEPRECATED_ATTRIBUTE
|
||||
#else
|
||||
#define DEPRECATED_IN_MAC_OS_X_VERSION_10_1_AND_LATER
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER
|
||||
*
|
||||
* Used on declarations introduced in Mac OS X 10.2
|
||||
*/
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_2
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER UNAVAILABLE_ATTRIBUTE
|
||||
#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_2
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER WEAK_IMPORT_ATTRIBUTE
|
||||
#else
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER
|
||||
#endif
|
||||
|
||||
/*
|
||||
* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED
|
||||
*
|
||||
* Used on declarations introduced in Mac OS X 10.2,
|
||||
* and deprecated in Mac OS X 10.2
|
||||
*/
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_2
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE
|
||||
#else
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER
|
||||
#endif
|
||||
|
||||
/*
|
||||
* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_2
|
||||
*
|
||||
* Used on declarations introduced in Mac OS X 10.0,
|
||||
* but later deprecated in Mac OS X 10.2
|
||||
*/
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_2
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_2 DEPRECATED_ATTRIBUTE
|
||||
#else
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_2 AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
|
||||
#endif
|
||||
|
||||
/*
|
||||
* AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_2
|
||||
*
|
||||
* Used on declarations introduced in Mac OS X 10.1,
|
||||
* but later deprecated in Mac OS X 10.2
|
||||
*/
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_2
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_2 DEPRECATED_ATTRIBUTE
|
||||
#else
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_2 AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER
|
||||
#endif
|
||||
|
||||
/*
|
||||
* DEPRECATED_IN_MAC_OS_X_VERSION_10_2_AND_LATER
|
||||
*
|
||||
* Used on types deprecated in Mac OS X 10.2
|
||||
*/
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_2
|
||||
#define DEPRECATED_IN_MAC_OS_X_VERSION_10_2_AND_LATER DEPRECATED_ATTRIBUTE
|
||||
#else
|
||||
#define DEPRECATED_IN_MAC_OS_X_VERSION_10_2_AND_LATER
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
|
||||
*
|
||||
* Used on declarations introduced in Mac OS X 10.3
|
||||
*/
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_3
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER UNAVAILABLE_ATTRIBUTE
|
||||
#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_3
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER WEAK_IMPORT_ATTRIBUTE
|
||||
#else
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
|
||||
#endif
|
||||
|
||||
/*
|
||||
* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED
|
||||
*
|
||||
* Used on declarations introduced in Mac OS X 10.3,
|
||||
* and deprecated in Mac OS X 10.3
|
||||
*/
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_3
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE
|
||||
#else
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
|
||||
#endif
|
||||
|
||||
/*
|
||||
* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_3
|
||||
*
|
||||
* Used on declarations introduced in Mac OS X 10.0,
|
||||
* but later deprecated in Mac OS X 10.3
|
||||
*/
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_3
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_3 DEPRECATED_ATTRIBUTE
|
||||
#else
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_3 AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
|
||||
#endif
|
||||
|
||||
/*
|
||||
* AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_3
|
||||
*
|
||||
* Used on declarations introduced in Mac OS X 10.1,
|
||||
* but later deprecated in Mac OS X 10.3
|
||||
*/
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_3
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_3 DEPRECATED_ATTRIBUTE
|
||||
#else
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_3 AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER
|
||||
#endif
|
||||
|
||||
/*
|
||||
* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_3
|
||||
*
|
||||
* Used on declarations introduced in Mac OS X 10.2,
|
||||
* but later deprecated in Mac OS X 10.3
|
||||
*/
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_3
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_3 DEPRECATED_ATTRIBUTE
|
||||
#else
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_3 AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER
|
||||
#endif
|
||||
|
||||
/*
|
||||
* DEPRECATED_IN_MAC_OS_X_VERSION_10_3_AND_LATER
|
||||
*
|
||||
* Used on types deprecated in Mac OS X 10.3
|
||||
*/
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_3
|
||||
#define DEPRECATED_IN_MAC_OS_X_VERSION_10_3_AND_LATER DEPRECATED_ATTRIBUTE
|
||||
#else
|
||||
#define DEPRECATED_IN_MAC_OS_X_VERSION_10_3_AND_LATER
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER
|
||||
*
|
||||
* Used on declarations introduced in Mac OS X 10.4
|
||||
*/
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_4
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER UNAVAILABLE_ATTRIBUTE
|
||||
#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_4
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER WEAK_IMPORT_ATTRIBUTE
|
||||
#else
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER
|
||||
#endif
|
||||
|
||||
/*
|
||||
* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED
|
||||
*
|
||||
* Used on declarations introduced in Mac OS X 10.4,
|
||||
* and deprecated in Mac OS X 10.4
|
||||
*/
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_4
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE
|
||||
#else
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER
|
||||
#endif
|
||||
|
||||
/*
|
||||
* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4
|
||||
*
|
||||
* Used on declarations introduced in Mac OS X 10.0,
|
||||
* but later deprecated in Mac OS X 10.4
|
||||
*/
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_4
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 DEPRECATED_ATTRIBUTE
|
||||
#else
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
|
||||
#endif
|
||||
|
||||
/*
|
||||
* AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4
|
||||
*
|
||||
* Used on declarations introduced in Mac OS X 10.1,
|
||||
* but later deprecated in Mac OS X 10.4
|
||||
*/
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_4
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 DEPRECATED_ATTRIBUTE
|
||||
#else
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER
|
||||
#endif
|
||||
|
||||
/*
|
||||
* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4
|
||||
*
|
||||
* Used on declarations introduced in Mac OS X 10.2,
|
||||
* but later deprecated in Mac OS X 10.4
|
||||
*/
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_4
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 DEPRECATED_ATTRIBUTE
|
||||
#else
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER
|
||||
#endif
|
||||
|
||||
/*
|
||||
* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4
|
||||
*
|
||||
* Used on declarations introduced in Mac OS X 10.2,
|
||||
* but later deprecated in Mac OS X 10.4
|
||||
*/
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_4
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 DEPRECATED_ATTRIBUTE
|
||||
#else
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
|
||||
#endif
|
||||
|
||||
/*
|
||||
* DEPRECATED_IN_MAC_OS_X_VERSION_10_4_AND_LATER
|
||||
*
|
||||
* Used on types deprecated in Mac OS X 10.4
|
||||
*/
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_4
|
||||
#define DEPRECATED_IN_MAC_OS_X_VERSION_10_4_AND_LATER DEPRECATED_ATTRIBUTE
|
||||
#else
|
||||
#define DEPRECATED_IN_MAC_OS_X_VERSION_10_4_AND_LATER
|
||||
#endif
|
||||
|
||||
#endif /* __AVAILABILITYMACROS__ */
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
/*
|
||||
* Copyright (c) 1991 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.
|
||||
*
|
||||
* @(#)cdefs.h 7.6 (Berkeley) 5/4/91
|
||||
*/
|
||||
|
||||
#ifndef _CDEFS_H_
|
||||
#define _CDEFS_H_
|
||||
|
||||
#if defined(__cplusplus)
|
||||
#define __BEGIN_DECLS extern "C" {
|
||||
#define __END_DECLS };
|
||||
#else
|
||||
#define __BEGIN_DECLS
|
||||
#define __END_DECLS
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The __CONCAT macro is used to concatenate parts of symbol names, e.g.
|
||||
* with "#define OLD(foo) __CONCAT(old,foo)", OLD(foo) produces oldfoo.
|
||||
* The __CONCAT macro is a bit tricky -- make sure you don't put spaces
|
||||
* in between its arguments. __CONCAT can also concatenate double-quoted
|
||||
* strings produced by the __STRING macro, but this only works with ANSI C.
|
||||
*/
|
||||
#if defined(__STDC__) || defined(__cplusplus)
|
||||
#define __P(protos) protos /* full-blown ANSI C */
|
||||
#define __CONCAT(x,y) x ## y
|
||||
#define __STRING(x) #x
|
||||
|
||||
#else /* !(__STDC__ || __cplusplus) */
|
||||
#define __P(protos) () /* traditional C preprocessor */
|
||||
#define __CONCAT(x,y) x/**/y
|
||||
#define __STRING(x) "x"
|
||||
|
||||
#ifdef __GNUC__
|
||||
#define const __const /* GCC: ANSI C with -traditional */
|
||||
#define inline __inline
|
||||
#define signed __signed
|
||||
#define volatile __volatile
|
||||
|
||||
#else /* !__GNUC__ */
|
||||
#define const /* delete ANSI C keywords */
|
||||
#define inline
|
||||
#define signed
|
||||
#define volatile
|
||||
#endif /* !__GNUC__ */
|
||||
#endif /* !(__STDC__ || __cplusplus) */
|
||||
|
||||
#endif /* !_CDEFS_H_ */
|
||||
@@ -0,0 +1,88 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2008 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@
|
||||
*/
|
||||
|
||||
/*
|
||||
Based on the dlcompat work done by:
|
||||
Jorge Acereda <jacereda@users.sourceforge.net> &
|
||||
Peter O'Gorman <ogorman@users.sourceforge.net>
|
||||
*/
|
||||
|
||||
#ifndef _DLFCN_H_
|
||||
#define _DLFCN_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "cdefs.h"
|
||||
|
||||
#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
|
||||
#include <stdbool.h>
|
||||
#include "AvailabilityMacros.h"
|
||||
/*
|
||||
* Structure filled in by dladdr().
|
||||
*/
|
||||
typedef struct dl_info {
|
||||
const char *dli_fname; /* Pathname of shared object */
|
||||
void *dli_fbase; /* Base address of shared object */
|
||||
const char *dli_sname; /* Name of nearest symbol */
|
||||
void *dli_saddr; /* Address of nearest symbol */
|
||||
} Dl_info;
|
||||
|
||||
extern int dladdr(const void *, Dl_info *);
|
||||
#endif /* not POSIX */
|
||||
|
||||
extern int dlclose(void * __handle);
|
||||
extern char * dlerror(void);
|
||||
extern void * dlopen(const char * __path, int __mode);
|
||||
extern void * dlsym(void * __handle, const char * __symbol);
|
||||
|
||||
#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
|
||||
extern bool dlopen_preflight(const char* __path) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
|
||||
#endif /* not POSIX */
|
||||
|
||||
|
||||
#define RTLD_LAZY 0x1
|
||||
#define RTLD_NOW 0x2
|
||||
#define RTLD_LOCAL 0x4
|
||||
#define RTLD_GLOBAL 0x8
|
||||
|
||||
#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
|
||||
#define RTLD_NOLOAD 0x10
|
||||
#define RTLD_NODELETE 0x80
|
||||
#define RTLD_FIRST 0x100 /* Mac OS X 10.5 and later */
|
||||
|
||||
/*
|
||||
* Special handle arguments for dlsym().
|
||||
*/
|
||||
#define RTLD_NEXT ((void *) -1) /* Search subsequent objects. */
|
||||
#define RTLD_DEFAULT ((void *) -2) /* Use default search algorithm. */
|
||||
#define RTLD_SELF ((void *) -3) /* Search this and subsequent objects (Mac OS X 10.5 and later) */
|
||||
#define RTLD_MAIN_ONLY ((void *) -5) /* Search main executable only (Mac OS X 10.5 and later) */
|
||||
#endif /* not POSIX */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _DLFCN_H_ */
|
||||
@@ -0,0 +1,253 @@
|
||||
/*
|
||||
* Copyright (c) 1999-2008 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 _MACH_O_DYLD_H_
|
||||
#define _MACH_O_DYLD_H_
|
||||
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "loader.h"
|
||||
#include <Availability.h>
|
||||
|
||||
#if __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The following functions allow you to iterate through all loaded images.
|
||||
* This is not a thread safe operation. Another thread can add or remove
|
||||
* an image during the iteration.
|
||||
*
|
||||
* Many uses of these routines can be replace by a call to dladdr() which
|
||||
* will return the mach_header and name of an image, given an address in
|
||||
* the image. dladdr() is thread safe.
|
||||
*/
|
||||
extern uint32_t _dyld_image_count(void) __OSX_AVAILABLE_STARTING(__MAC_10_1, __IPHONE_2_0);
|
||||
extern const struct mach_header* _dyld_get_image_header(uint32_t image_index) __OSX_AVAILABLE_STARTING(__MAC_10_1, __IPHONE_2_0);
|
||||
extern intptr_t _dyld_get_image_vmaddr_slide(uint32_t image_index) __OSX_AVAILABLE_STARTING(__MAC_10_1, __IPHONE_2_0);
|
||||
extern const char* _dyld_get_image_name(uint32_t image_index) __OSX_AVAILABLE_STARTING(__MAC_10_1, __IPHONE_2_0);
|
||||
|
||||
|
||||
/*
|
||||
* The following functions allow you to install callbacks which will be called
|
||||
* by dyld whenever an image is loaded or unloaded. During a call to _dyld_register_func_for_add_image()
|
||||
* the callback func is called for every existing image. Later, it is called as each new image
|
||||
* is loaded and bound (but initializers not yet run). The callback registered with
|
||||
* _dyld_register_func_for_remove_image() is called after any terminators in an image are run
|
||||
* and before the image is un-memory-mapped.
|
||||
*/
|
||||
extern void _dyld_register_func_for_add_image(void (*func)(const struct mach_header* mh, intptr_t vmaddr_slide)) __OSX_AVAILABLE_STARTING(__MAC_10_1, __IPHONE_2_0);
|
||||
extern void _dyld_register_func_for_remove_image(void (*func)(const struct mach_header* mh, intptr_t vmaddr_slide)) __OSX_AVAILABLE_STARTING(__MAC_10_1, __IPHONE_2_0);
|
||||
|
||||
|
||||
/*
|
||||
* NSVersionOfRunTimeLibrary() returns the current_version number of the currently dylib
|
||||
* specifed by the libraryName. The libraryName parameter would be "bar" for /path/libbar.3.dylib and
|
||||
* "Foo" for /path/Foo.framework/Versions/A/Foo. It returns -1 if no such library is loaded.
|
||||
*/
|
||||
extern int32_t NSVersionOfRunTimeLibrary(const char* libraryName) __OSX_AVAILABLE_STARTING(__MAC_10_1, __IPHONE_2_0);
|
||||
|
||||
|
||||
/*
|
||||
* NSVersionOfRunTimeLibrary() returns the current_version number that the main executable was linked
|
||||
* against at build time. The libraryName parameter would be "bar" for /path/libbar.3.dylib and
|
||||
* "Foo" for /path/Foo.framework/Versions/A/Foo. It returns -1 if the main executable did not link
|
||||
* against the specified library.
|
||||
*/
|
||||
extern int32_t NSVersionOfLinkTimeLibrary(const char* libraryName) __OSX_AVAILABLE_STARTING(__MAC_10_1, __IPHONE_2_0);
|
||||
|
||||
|
||||
/*
|
||||
* _NSGetExecutablePath() copies the path of the main executable into the buffer. The bufsize parameter
|
||||
* should initially be the size of the buffer. The function returns 0 if the path was successfully copied,
|
||||
* and *bufsize is left unchanged. It returns -1 if the buffer is not large enough, and *bufsize is set
|
||||
* to the size required.
|
||||
*
|
||||
* Note that _NSGetExecutablePath will return "a path" to the executable not a "real path" to the executable.
|
||||
* That is the path may be a symbolic link and not the real file. With deep directories the total bufsize
|
||||
* needed could be more than MAXPATHLEN.
|
||||
*/
|
||||
extern int _NSGetExecutablePath(char* buf, uint32_t* bufsize) __OSX_AVAILABLE_STARTING(__MAC_10_2, __IPHONE_2_0);
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* _dyld_moninit() is a private interface between dyld and libSystem.
|
||||
*/
|
||||
extern void _dyld_moninit(void (*monaddition)(char *lowpc, char *highpc)) __OSX_AVAILABLE_STARTING(__MAC_10_1, __IPHONE_2_0);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* The following dyld API's are deprecated as of Mac OS X 10.5. They are either
|
||||
* no longer necessary or are superceeded by dlopen and friends in <dlfcn.h>.
|
||||
* dlopen/dlsym/dlclose have been available since Mac OS X 10.3 and work with
|
||||
* dylibs and bundles.
|
||||
*
|
||||
* NSAddImage -> dlopen
|
||||
* NSLookupSymbolInImage -> dlsym
|
||||
* NSCreateObjectFileImageFromFile -> dlopen
|
||||
* NSDestroyObjectFileImage -> dlclose
|
||||
* NSLinkModule -> not needed when dlopen used
|
||||
* NSUnLinkModule -> not needed when dlclose used
|
||||
* NSLookupSymbolInModule -> dlsym
|
||||
* _dyld_image_containing_address -> dladdr
|
||||
* NSLinkEditError -> dlerror
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef ENUM_DYLD_BOOL
|
||||
#define ENUM_DYLD_BOOL
|
||||
#undef FALSE
|
||||
#undef TRUE
|
||||
enum DYLD_BOOL { FALSE, TRUE };
|
||||
#endif /* ENUM_DYLD_BOOL */
|
||||
|
||||
|
||||
/* Object file image API */
|
||||
typedef enum {
|
||||
NSObjectFileImageFailure, /* for this a message is printed on stderr */
|
||||
NSObjectFileImageSuccess,
|
||||
NSObjectFileImageInappropriateFile,
|
||||
NSObjectFileImageArch,
|
||||
NSObjectFileImageFormat, /* for this a message is printed on stderr */
|
||||
NSObjectFileImageAccess
|
||||
} NSObjectFileImageReturnCode;
|
||||
|
||||
typedef struct __NSObjectFileImage* NSObjectFileImage;
|
||||
|
||||
/* NSObjectFileImage can only be used with MH_BUNDLE files */
|
||||
extern NSObjectFileImageReturnCode NSCreateObjectFileImageFromFile(const char* pathName, NSObjectFileImage *objectFileImage) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA);
|
||||
extern NSObjectFileImageReturnCode NSCreateObjectFileImageFromMemory(const void *address, size_t size, NSObjectFileImage *objectFileImage) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA);
|
||||
extern bool NSDestroyObjectFileImage(NSObjectFileImage objectFileImage) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA);
|
||||
|
||||
extern uint32_t NSSymbolDefinitionCountInObjectFileImage(NSObjectFileImage objectFileImage) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA);
|
||||
extern const char* NSSymbolDefinitionNameInObjectFileImage(NSObjectFileImage objectFileImage, uint32_t ordinal) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA);
|
||||
extern uint32_t NSSymbolReferenceCountInObjectFileImage(NSObjectFileImage objectFileImage) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA);
|
||||
extern const char* NSSymbolReferenceNameInObjectFileImage(NSObjectFileImage objectFileImage, uint32_t ordinal, bool *tentative_definition) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA);
|
||||
extern bool NSIsSymbolDefinedInObjectFileImage(NSObjectFileImage objectFileImage, const char* symbolName) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_4,__IPHONE_NA,__IPHONE_NA);
|
||||
extern void* NSGetSectionDataInObjectFileImage(NSObjectFileImage objectFileImage, const char* segmentName, const char* sectionName, size_t *size) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA);
|
||||
extern bool NSHasModInitObjectFileImage(NSObjectFileImage objectFileImage) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_3,__MAC_10_5,__IPHONE_NA,__IPHONE_NA);
|
||||
|
||||
typedef struct __NSModule* NSModule;
|
||||
extern const char* NSNameOfModule(NSModule m) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA);
|
||||
extern const char* NSLibraryNameForModule(NSModule m) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA);
|
||||
|
||||
extern NSModule NSLinkModule(NSObjectFileImage objectFileImage, const char* moduleName, uint32_t options) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA);
|
||||
#define NSLINKMODULE_OPTION_NONE 0x0
|
||||
#define NSLINKMODULE_OPTION_BINDNOW 0x1
|
||||
#define NSLINKMODULE_OPTION_PRIVATE 0x2
|
||||
#define NSLINKMODULE_OPTION_RETURN_ON_ERROR 0x4
|
||||
#define NSLINKMODULE_OPTION_DONT_CALL_MOD_INIT_ROUTINES 0x8
|
||||
#define NSLINKMODULE_OPTION_TRAILING_PHYS_NAME 0x10
|
||||
|
||||
extern bool NSUnLinkModule(NSModule module, uint32_t options) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA);
|
||||
#define NSUNLINKMODULE_OPTION_NONE 0x0
|
||||
#define NSUNLINKMODULE_OPTION_KEEP_MEMORY_MAPPED 0x1
|
||||
#define NSUNLINKMODULE_OPTION_RESET_LAZY_REFERENCES 0x2
|
||||
|
||||
/* symbol API */
|
||||
typedef struct __NSSymbol* NSSymbol;
|
||||
extern bool NSIsSymbolNameDefined(const char* symbolName) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_4,__IPHONE_NA,__IPHONE_NA);
|
||||
extern bool NSIsSymbolNameDefinedWithHint(const char* symbolName, const char* libraryNameHint) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_4,__IPHONE_NA,__IPHONE_NA);
|
||||
extern bool NSIsSymbolNameDefinedInImage(const struct mach_header* image, const char* symbolName) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_4,__IPHONE_NA,__IPHONE_NA);
|
||||
extern NSSymbol NSLookupAndBindSymbol(const char* symbolName) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_4,__IPHONE_NA,__IPHONE_NA);
|
||||
extern NSSymbol NSLookupAndBindSymbolWithHint(const char* symbolName, const char* libraryNameHint) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_4,__IPHONE_NA,__IPHONE_NA);
|
||||
extern NSSymbol NSLookupSymbolInModule(NSModule module, const char* symbolName) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA);
|
||||
extern NSSymbol NSLookupSymbolInImage(const struct mach_header* image, const char* symbolName, uint32_t options) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA);
|
||||
#define NSLOOKUPSYMBOLINIMAGE_OPTION_BIND 0x0
|
||||
#define NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_NOW 0x1
|
||||
#define NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_FULLY 0x2
|
||||
#define NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR 0x4
|
||||
extern const char* NSNameOfSymbol(NSSymbol symbol) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA);
|
||||
extern void * NSAddressOfSymbol(NSSymbol symbol) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA);
|
||||
extern NSModule NSModuleForSymbol(NSSymbol symbol) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA);
|
||||
|
||||
/* error handling API */
|
||||
typedef enum {
|
||||
NSLinkEditFileAccessError,
|
||||
NSLinkEditFileFormatError,
|
||||
NSLinkEditMachResourceError,
|
||||
NSLinkEditUnixResourceError,
|
||||
NSLinkEditOtherError,
|
||||
NSLinkEditWarningError,
|
||||
NSLinkEditMultiplyDefinedError,
|
||||
NSLinkEditUndefinedError
|
||||
} NSLinkEditErrors;
|
||||
|
||||
/*
|
||||
* For the NSLinkEditErrors value NSLinkEditOtherError these are the values
|
||||
* passed to the link edit error handler as the errorNumber (what would be an
|
||||
* errno value for NSLinkEditUnixResourceError or a kern_return_t value for
|
||||
* NSLinkEditMachResourceError).
|
||||
*/
|
||||
typedef enum {
|
||||
NSOtherErrorRelocation,
|
||||
NSOtherErrorLazyBind,
|
||||
NSOtherErrorIndrLoop,
|
||||
NSOtherErrorLazyInit,
|
||||
NSOtherErrorInvalidArgs
|
||||
} NSOtherErrorNumbers;
|
||||
|
||||
extern void NSLinkEditError(NSLinkEditErrors *c, int *errorNumber, const char** fileName, const char** errorString) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA);
|
||||
|
||||
typedef struct {
|
||||
void (*undefined)(const char* symbolName);
|
||||
NSModule (*multiple)(NSSymbol s, NSModule oldModule, NSModule newModule);
|
||||
void (*linkEdit)(NSLinkEditErrors errorClass, int errorNumber,
|
||||
const char* fileName, const char* errorString);
|
||||
} NSLinkEditErrorHandlers;
|
||||
|
||||
extern void NSInstallLinkEditErrorHandlers(const NSLinkEditErrorHandlers *handlers) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA);
|
||||
|
||||
extern bool NSAddLibrary(const char* pathName) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_4,__IPHONE_NA,__IPHONE_NA);
|
||||
extern bool NSAddLibraryWithSearching(const char* pathName) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_4,__IPHONE_NA,__IPHONE_NA);
|
||||
extern const struct mach_header* NSAddImage(const char* image_name, uint32_t options) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA);
|
||||
#define NSADDIMAGE_OPTION_NONE 0x0
|
||||
#define NSADDIMAGE_OPTION_RETURN_ON_ERROR 0x1
|
||||
#define NSADDIMAGE_OPTION_WITH_SEARCHING 0x2
|
||||
#define NSADDIMAGE_OPTION_RETURN_ONLY_IF_LOADED 0x4
|
||||
#define NSADDIMAGE_OPTION_MATCH_FILENAME_BY_INSTALLNAME 0x8
|
||||
|
||||
extern bool _dyld_present(void) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA);
|
||||
extern bool _dyld_launched_prebound(void) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA);
|
||||
extern bool _dyld_all_twolevel_modules_prebound(void) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_3,__MAC_10_5,__IPHONE_NA,__IPHONE_NA);
|
||||
extern void _dyld_bind_objc_module(const void* objc_module) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA);
|
||||
extern bool _dyld_bind_fully_image_containing_address(const void* address) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA);
|
||||
extern bool _dyld_image_containing_address(const void* address) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_3,__MAC_10_5,__IPHONE_NA,__IPHONE_NA);
|
||||
extern void _dyld_lookup_and_bind(const char* symbol_name, void **address, NSModule* module) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_4,__IPHONE_NA,__IPHONE_NA);
|
||||
extern void _dyld_lookup_and_bind_with_hint(const char* symbol_name, const char* library_name_hint, void** address, NSModule* module) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_4,__IPHONE_NA,__IPHONE_NA);
|
||||
extern void _dyld_lookup_and_bind_fully(const char* symbol_name, void** address, NSModule* module) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA);
|
||||
|
||||
extern const struct mach_header* _dyld_get_image_header_containing_address(const void* address) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_3,__MAC_10_5,__IPHONE_NA,__IPHONE_NA);
|
||||
|
||||
|
||||
#if __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _MACH_O_DYLD_H_ */
|
||||
File diff suppressed because it is too large
Load Diff
@@ -15,8 +15,8 @@
|
||||
#include <cstddef>
|
||||
#include <cstring>
|
||||
#ifdef __APPLE__
|
||||
#include <dlfcn.h>
|
||||
#include <mach-o/dyld.h>
|
||||
#include "dlfcn.h"
|
||||
#include "dyld.h"
|
||||
#endif
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
+9
-5
@@ -23,11 +23,11 @@
|
||||
#elif defined(__GLIBCXX__)
|
||||
// nothing todo
|
||||
#else
|
||||
# if defined(__APPLE__) && !defined(_LIBCPP_BUILDING_HAS_NO_ABI_LIBRARY)
|
||||
# include <cxxabi.h> // FIXME: remove this once buildit is gone.
|
||||
# else
|
||||
# include "support/runtime/new_handler_fallback.ipp"
|
||||
# endif
|
||||
//# if defined(__APPLE__) && !defined(_LIBCPP_BUILDING_HAS_NO_ABI_LIBRARY)
|
||||
//# include <cxxabi.h> // FIXME: remove this once buildit is gone.
|
||||
//# else
|
||||
#include "support/runtime/new_handler_fallback.ipp"
|
||||
//# endif
|
||||
#endif
|
||||
|
||||
namespace std
|
||||
@@ -174,6 +174,10 @@ operator delete[] (void* ptr, size_t) _NOEXCEPT
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_ALIGNED_ALLOCATIONS)
|
||||
|
||||
#ifdef __APPLE__
|
||||
int posix_memalign(void **memptr, size_t alignment, size_t size);
|
||||
#endif
|
||||
|
||||
_LIBCPP_WEAK
|
||||
void *
|
||||
operator new(std::size_t size, std::align_val_t alignment) _THROW_BAD_ALLOC
|
||||
|
||||
@@ -13,11 +13,13 @@
|
||||
#include "system_error"
|
||||
#include "include/refstring.h"
|
||||
|
||||
#if 0
|
||||
/* For _LIBCPPABI_VERSION */
|
||||
#if !defined(_LIBCPP_BUILDING_HAS_NO_ABI_LIBRARY) && \
|
||||
(defined(LIBCXX_BUILDING_LIBCXXABI) || defined(__APPLE__) || defined(LIBCXXRT))
|
||||
#include <cxxabi.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
static_assert(sizeof(std::__libcpp_refstring) == sizeof(const char *), "");
|
||||
|
||||
|
||||
@@ -78,6 +78,7 @@ terminate() _NOEXCEPT
|
||||
}
|
||||
#endif // !__EMSCRIPTEN__
|
||||
|
||||
#if 0
|
||||
#if !defined(__EMSCRIPTEN__)
|
||||
bool uncaught_exception() _NOEXCEPT { return uncaught_exceptions() > 0; }
|
||||
|
||||
@@ -88,6 +89,7 @@ int uncaught_exceptions() _NOEXCEPT
|
||||
::abort();
|
||||
}
|
||||
#endif // !__EMSCRIPTEN__
|
||||
#endif
|
||||
|
||||
|
||||
exception::~exception() _NOEXCEPT
|
||||
|
||||
Reference in New Issue
Block a user