]>
Commit | Line | Data |
---|---|---|
6d2010ae A |
1 | #! /bin/bash - |
2 | # | |
3 | # Copyright (c) 2010 Apple Inc. All rights reserved. | |
4 | # | |
5 | # @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | |
6 | # | |
7 | # This file contains Original Code and/or Modifications of Original Code | |
8 | # as defined in and that are subject to the Apple Public Source License | |
9 | # Version 2.0 (the 'License'). You may not use this file except in | |
10 | # compliance with the License. Please obtain a copy of the License at | |
11 | # http://www.opensource.apple.com/apsl/ and read it before using this | |
12 | # file. | |
13 | # | |
14 | # The Original Code and all software distributed under the License are | |
15 | # distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | |
16 | # EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | |
17 | # INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | |
18 | # FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | |
19 | # Please see the License for the specific language governing rights and | |
20 | # limitations under the License. | |
21 | # | |
22 | # @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | |
23 | # | |
24 | ||
25 | { | |
26 | cat <<EOF | |
27 | /* Copyright (c) 2010 Apple Inc. All rights reserved. | |
28 | * | |
29 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | |
30 | * | |
31 | * This file contains Original Code and/or Modifications of Original Code | |
32 | * as defined in and that are subject to the Apple Public Source License | |
33 | * Version 2.0 (the 'License'). You may not use this file except in | |
34 | * compliance with the License. The rights granted to you under the License | |
35 | * may not be used to create, or enable the creation or redistribution of, | |
36 | * unlawful or unlicensed copies of an Apple operating system, or to | |
37 | * circumvent, violate, or enable the circumvention or violation of, any | |
38 | * terms of an Apple operating system software license agreement. | |
39 | * | |
40 | * Please obtain a copy of the License at | |
41 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | |
42 | * | |
43 | * The Original Code and all software distributed under the License are | |
44 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | |
45 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | |
46 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | |
47 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | |
48 | * Please see the License for the specific language governing rights and | |
49 | * limitations under the License. | |
50 | * | |
51 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | |
52 | */ | |
53 | ||
54 | #ifndef _CDEFS_H_ | |
55 | # error "Never use <sys/_symbol_aliasing.h> directly. Use <sys/cdefs.h> instead." | |
56 | #endif | |
57 | ||
58 | EOF | |
59 | ||
60 | for ver in $(${SDKROOT}/usr/local/libexec/availability.pl --ios) ; do | |
61 | ver_major=${ver%.*} | |
62 | ver_minor=${ver#*.} | |
63 | value=$(printf "%d%02d00" ${ver_major} ${ver_minor}) | |
64 | str=$(printf "__IPHONE_%d_%d" ${ver_major} ${ver_minor}) | |
65 | echo "#if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= ${value}" | |
66 | echo "#define __DARWIN_ALIAS_STARTING_IPHONE_${str}(x) x" | |
67 | echo "#else" | |
68 | echo "#define __DARWIN_ALIAS_STARTING_IPHONE_${str}(x)" | |
69 | echo "#endif" | |
70 | echo "" | |
71 | done | |
72 | ||
73 | for ver in $(${SDKROOT}/usr/local/libexec/availability.pl --macosx) ; do | |
74 | ver_major=${ver%.*} | |
75 | ver_minor=${ver#*.} | |
76 | value=$(printf "%d%d0" ${ver_major} ${ver_minor}) | |
77 | str=$(printf "__MAC_%d_%d" ${ver_major} ${ver_minor}) | |
78 | echo "#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= ${value}" | |
79 | echo "#define __DARWIN_ALIAS_STARTING_MAC_${str}(x) x" | |
80 | echo "#else" | |
81 | echo "#define __DARWIN_ALIAS_STARTING_MAC_${str}(x)" | |
82 | echo "#endif" | |
83 | echo "" | |
84 | done | |
85 | } > $1 | |
86 |