]> git.saurik.com Git - apple/xnu.git/blame - bsd/sys/make_posix_availability.sh
xnu-1699.26.8.tar.gz
[apple/xnu.git] / bsd / sys / make_posix_availability.sh
CommitLineData
6d2010ae
A
1#! /bin/sh -
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
25POSIX_VALUES="198808L 199009L 199209L 199309L 199506L 200112L 200809L"
26
27{
28cat <<EOF
29/* Copyright (c) 2010 Apple Inc. All rights reserved.
30 *
31 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
32 *
33 * This file contains Original Code and/or Modifications of Original Code
34 * as defined in and that are subject to the Apple Public Source License
35 * Version 2.0 (the 'License'). You may not use this file except in
36 * compliance with the License. The rights granted to you under the License
37 * may not be used to create, or enable the creation or redistribution of,
38 * unlawful or unlicensed copies of an Apple operating system, or to
39 * circumvent, violate, or enable the circumvention or violation of, any
40 * terms of an Apple operating system software license agreement.
41 *
42 * Please obtain a copy of the License at
43 * http://www.opensource.apple.com/apsl/ and read it before using this file.
44 *
45 * The Original Code and all software distributed under the License are
46 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
47 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
48 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
49 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
50 * Please see the License for the specific language governing rights and
51 * limitations under the License.
52 *
53 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
54 */
55
56#ifndef _CDEFS_H_
57# error "Never use <sys/_posix_availability.h> directly. Use <sys/cdefs.h> instead."
58#endif
59
60EOF
61
62for value in ${POSIX_VALUES} ; do
63 echo "#if !defined(_DARWIN_C_SOURCE) && defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= ${value}"
64 echo "#define ___POSIX_C_DEPRECATED_STARTING_${value} __deprecated"
65 echo "#else"
66 echo "#define ___POSIX_C_DEPRECATED_STARTING_${value}"
67 echo "#endif"
68 echo
69done
70} > $1
71