]>
git.saurik.com Git - apple/libc.git/blob - include/sys/cdefs.h
2 * Copyright (c) 2006 - 2008 Apple Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
21 * @APPLE_LICENSE_HEADER_END@
24 /***********************************************************************
25 * Not to be installed in /usr/include
26 ***********************************************************************/
28 #ifndef _LIBC_SYS_CDEFS_H_
29 #define _LIBC_SYS_CDEFS_H_
32 * Now include the real sys/cdefs.h. The checks in libc-features.h will assure
33 * that those macros are consistent with the current build environment.
35 #include_next <sys/cdefs.h>
36 #ifndef _LIBC_NO_FEATURE_VERIFICATION
38 # include <arm/libc-features.h>
39 #elif defined(__i386__)
40 # include <i386/libc-features.h>
41 #elif defined(__ppc__)
42 # include <ppc/libc-features.h>
43 #elif defined(__ppc64__)
44 # include <ppc64/libc-features.h>
45 #elif defined(__x86_64__)
46 # include <x86_64/libc-features.h>
48 # error "Unknown architecture."
50 #endif /* _LIBC_NO_FEATURE_VERIFICATION */
53 * symbol suffixes used for symbol versioning
55 #if defined(VARIANT_LEGACY)
56 # define LIBC_SUF_UNIX03 /* nothing */
57 # define LIBC_SUF_64_BIT_INO_T /* nothing */
58 # define LIBC_SUF_NON_CANCELABLE /* nothing */
59 # define LIBC_SUF_1050 /* nothing */
60 #else /* !VARIANT_LEGACY */
61 # if __DARWIN_ONLY_UNIX_CONFORMANCE
62 # define LIBC_SUF_UNIX03 /* nothing */
63 # else /* !__DARWIN_ONLY_UNIX_CONFORMANCE */
64 # define LIBC_SUF_UNIX03 "$UNIX2003"
65 # endif /* __DARWIN_ONLY_UNIX_CONFORMANCE */
67 # if defined(VARIANT_INODE32)
68 # define LIBC_SUF_64_BIT_INO_T /* nothing */
69 # else /* !VARIANT_INODE32 */
70 # if __DARWIN_ONLY_64_BIT_INO_T
71 # define LIBC_SUF_64_BIT_INO_T /* nothing */
72 # else /* !__DARWIN_ONLY_64_BIT_INO_T */
73 # define LIBC_SUF_64_BIT_INO_T "$INODE64"
74 # endif /* __DARWIN_ONLY_64_BIT_INO_T */
75 # endif /* VARIANT_INODE32 */
77 # if defined(VARIANT_CANCELABLE)
78 # define LIBC_SUF_NON_CANCELABLE /* nothing */
79 # else /* !LIBC_NON_CANCELABLE */
80 # define LIBC_SUF_NON_CANCELABLE "$NOCANCEL"
81 # endif /* LIBC_NON_CANCELABLE */
83 # if defined(VARIANT_PRE1050)
84 # define LIBC_SUF_1050 /* nothing */
85 # else /* !VARIANT_PRE1050 */
86 # if __DARWIN_ONLY_VERS_1050
87 # define LIBC_SUF_1050 /* nothing */
88 # else /* !__DARWIN_ONLY_VERS_1050 */
89 # define LIBC_SUF_1050 "$1050"
90 # endif /* __DARWIN_ONLY_VERS_1050 */
91 # endif /* VARIANT_PRE1050 */
93 #endif /* LIBC_UNIX03 */
95 #define LIBC_SUF_EXTSN "$DARWIN_EXTSN"
98 * symbol versioning macros
100 #define LIBC_ALIAS(sym) __asm("_" __STRING(sym) LIBC_SUF_UNIX03)
101 #define LIBC_ALIAS_C(sym) __asm("_" __STRING(sym) LIBC_SUF_NON_CANCELABLE LIBC_SUF_UNIX03)
102 #define LIBC_ALIAS_I(sym) __asm("_" __STRING(sym) LIBC_SUF_64_BIT_INO_T LIBC_SUF_UNIX03)
103 #define LIBC_INODE64(sym) __asm("_" __STRING(sym) LIBC_SUF_64_BIT_INO_T)
105 #define LIBC_1050(sym) __asm("_" __STRING(sym) LIBC_SUF_1050)
106 #define LIBC_1050ALIAS(sym) __asm("_" __STRING(sym) LIBC_SUF_1050 LIBC_SUF_UNIX03)
107 #define LIBC_1050ALIAS_C(sym) __asm("_" __STRING(sym) LIBC_SUF_1050 LIBC_SUF_NON_CANCELABLE LIBC_SUF_UNIX03)
108 #define LIBC_1050ALIAS_I(sym) __asm("_" __STRING(sym) LIBC_SUF_1050 LIBC_SUF_64_BIT_INO_T LIBC_SUF_UNIX03)
109 #define LIBC_1050INODE64(sym) __asm("_" __STRING(sym) LIBC_SUF_1050 LIBC_SUF_64_BIT_INO_T)
111 #define LIBC_EXTSN(sym) __asm("_" __STRING(sym) LIBC_SUF_EXTSN)
112 #define LIBC_EXTSN_C(sym) __asm("_" __STRING(sym) LIBC_SUF_EXTSN LIBC_SUF_NON_CANCELABLE)
114 extern int __pthread_tsd_first
;
115 extern int pthread_key_init_np(int, void (*)(void *));
117 #define __LIBC_PTHREAD_KEY(x) (__pthread_tsd_first + (x))
120 * Libc pthread key assignments
122 #define __LIBC_PTHREAD_KEY_XLOCALE __LIBC_PTHREAD_KEY(0)
123 #define __LIBC_PTHREAD_KEY_TTYNAME __LIBC_PTHREAD_KEY(1)
124 #define __LIBC_PTHREAD_KEY_LOCALTIME __LIBC_PTHREAD_KEY(2)
125 #define __LIBC_PTHREAD_KEY_GMTIME __LIBC_PTHREAD_KEY(3)
126 #define __LIBC_PTHREAD_KEY_GDTOA_BIGINT __LIBC_PTHREAD_KEY(4)
127 #define __LIBC_PTHREAD_KEY_PARSEFLOAT __LIBC_PTHREAD_KEY(5)
129 #endif /* _LIBC_SYS_CDEFS_H_ */