xref: /xnu-12377.61.12/bsd/sys/make_posix_availability.sh (revision 4d495c6e23c53686cf65f45067f79024cf5dcee8)
1*4d495c6eSApple OSS Distributions#! /bin/sh -
2*4d495c6eSApple OSS Distributions#
3*4d495c6eSApple OSS Distributions# Copyright (c) 2010 Apple Inc. All rights reserved.
4*4d495c6eSApple OSS Distributions#
5*4d495c6eSApple OSS Distributions# @APPLE_OSREFERENCE_LICENSE_HEADER_START@
6*4d495c6eSApple OSS Distributions#
7*4d495c6eSApple OSS Distributions# This file contains Original Code and/or Modifications of Original Code
8*4d495c6eSApple OSS Distributions# as defined in and that are subject to the Apple Public Source License
9*4d495c6eSApple OSS Distributions# Version 2.0 (the 'License'). You may not use this file except in
10*4d495c6eSApple OSS Distributions# compliance with the License. Please obtain a copy of the License at
11*4d495c6eSApple OSS Distributions# http://www.opensource.apple.com/apsl/ and read it before using this
12*4d495c6eSApple OSS Distributions# file.
13*4d495c6eSApple OSS Distributions#
14*4d495c6eSApple OSS Distributions# The Original Code and all software distributed under the License are
15*4d495c6eSApple OSS Distributions# distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
16*4d495c6eSApple OSS Distributions# EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
17*4d495c6eSApple OSS Distributions# INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
18*4d495c6eSApple OSS Distributions# FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
19*4d495c6eSApple OSS Distributions# Please see the License for the specific language governing rights and
20*4d495c6eSApple OSS Distributions# limitations under the License.
21*4d495c6eSApple OSS Distributions#
22*4d495c6eSApple OSS Distributions# @APPLE_OSREFERENCE_LICENSE_HEADER_END@
23*4d495c6eSApple OSS Distributions#
24*4d495c6eSApple OSS Distributions
25*4d495c6eSApple OSS Distributionsusage() {
26*4d495c6eSApple OSS Distributions    echo "Usage: $0 <output>" 1>&2
27*4d495c6eSApple OSS Distributions    exit 1
28*4d495c6eSApple OSS Distributions}
29*4d495c6eSApple OSS Distributions
30*4d495c6eSApple OSS Distributionsif [ $# -ne 1 ]; then
31*4d495c6eSApple OSS Distributions    usage
32*4d495c6eSApple OSS Distributionsfi
33*4d495c6eSApple OSS Distributions
34*4d495c6eSApple OSS DistributionsOUTPUT="$1"
35*4d495c6eSApple OSS Distributions
36*4d495c6eSApple OSS DistributionsPOSIX_VALUES="198808L 199009L 199209L 199309L 199506L 200112L 200809L"
37*4d495c6eSApple OSS Distributions
38*4d495c6eSApple OSS Distributions{
39*4d495c6eSApple OSS Distributionscat <<EOF
40*4d495c6eSApple OSS Distributions/* Copyright (c) 2010 Apple Inc. All rights reserved.
41*4d495c6eSApple OSS Distributions * 
42*4d495c6eSApple OSS Distributions * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
43*4d495c6eSApple OSS Distributions * 
44*4d495c6eSApple OSS Distributions * This file contains Original Code and/or Modifications of Original Code
45*4d495c6eSApple OSS Distributions * as defined in and that are subject to the Apple Public Source License
46*4d495c6eSApple OSS Distributions * Version 2.0 (the 'License'). You may not use this file except in
47*4d495c6eSApple OSS Distributions * compliance with the License. The rights granted to you under the License
48*4d495c6eSApple OSS Distributions * may not be used to create, or enable the creation or redistribution of,
49*4d495c6eSApple OSS Distributions * unlawful or unlicensed copies of an Apple operating system, or to
50*4d495c6eSApple OSS Distributions * circumvent, violate, or enable the circumvention or violation of, any
51*4d495c6eSApple OSS Distributions * terms of an Apple operating system software license agreement.
52*4d495c6eSApple OSS Distributions * 
53*4d495c6eSApple OSS Distributions * Please obtain a copy of the License at
54*4d495c6eSApple OSS Distributions * http://www.opensource.apple.com/apsl/ and read it before using this file.
55*4d495c6eSApple OSS Distributions * 
56*4d495c6eSApple OSS Distributions * The Original Code and all software distributed under the License are
57*4d495c6eSApple OSS Distributions * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
58*4d495c6eSApple OSS Distributions * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
59*4d495c6eSApple OSS Distributions * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
60*4d495c6eSApple OSS Distributions * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
61*4d495c6eSApple OSS Distributions * Please see the License for the specific language governing rights and
62*4d495c6eSApple OSS Distributions * limitations under the License.
63*4d495c6eSApple OSS Distributions * 
64*4d495c6eSApple OSS Distributions * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
65*4d495c6eSApple OSS Distributions */
66*4d495c6eSApple OSS Distributions
67*4d495c6eSApple OSS Distributions#ifndef _CDEFS_H_
68*4d495c6eSApple OSS Distributions# error "Never use <sys/_posix_availability.h> directly.  Use <sys/cdefs.h> instead."
69*4d495c6eSApple OSS Distributions#endif
70*4d495c6eSApple OSS Distributions
71*4d495c6eSApple OSS DistributionsEOF
72*4d495c6eSApple OSS Distributions
73*4d495c6eSApple OSS Distributionsfor value in ${POSIX_VALUES} ; do
74*4d495c6eSApple OSS Distributions    echo "#if !defined(_DARWIN_C_SOURCE) && defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= ${value}"
75*4d495c6eSApple OSS Distributions    echo "#define ___POSIX_C_DEPRECATED_STARTING_${value} __deprecated"
76*4d495c6eSApple OSS Distributions    echo "#else"
77*4d495c6eSApple OSS Distributions    echo "#define ___POSIX_C_DEPRECATED_STARTING_${value}"
78*4d495c6eSApple OSS Distributions    echo "#endif"
79*4d495c6eSApple OSS Distributions    echo
80*4d495c6eSApple OSS Distributionsdone
81*4d495c6eSApple OSS Distributions} > "$OUTPUT"
82*4d495c6eSApple OSS Distributions
83