]>
Commit | Line | Data |
---|---|---|
70ad1dc8 A |
1 | /* |
2 | * Copyright (c) 2018 Apple Inc. All rights reserved. | |
3 | * | |
4 | * @APPLE_LICENSE_HEADER_START@ | |
5 | * | |
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 | |
11 | * file. | |
12 | * | |
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. | |
20 | * | |
21 | * @APPLE_LICENSE_HEADER_END@ | |
22 | */ | |
23 | ||
24 | /*! | |
25 | * @header | |
26 | * API macros. libdarwin provides APIs for low-level userspace projects in the | |
27 | * Darwin operating system. | |
28 | * | |
29 | * - C language additions | |
30 | * - POSIX and BSD API additions | |
31 | * - POSIX and BSD convenience wrappers | |
32 | * - Mach API additions and wrappers with clearer semantics | |
33 | * | |
34 | * Additions which extend the C language are not prefixed and are therefore not | |
35 | * included by default when including this header. | |
36 | * | |
37 | * Additions to API families conforming to ANSI C carry the "os_" prefix. | |
38 | * | |
39 | * Additions to API families conforming to POSIX carry the "_np" ("Not POSIX") | |
40 | * suffix. | |
41 | * | |
42 | * Additions to API families conforming to both POSIX and ANSI C carry the "_np" | |
43 | * suffix. | |
44 | * | |
45 | * Convenience wrappers for POSIX and BSD APIs carry the "os_" prefix. | |
46 | * | |
47 | * New APIs formalizing Darwin workflows carry the "os_" prefix. | |
48 | */ | |
49 | #ifndef __DARWIN_API_H | |
50 | #define __DARWIN_API_H | |
51 | ||
52 | #include <os/availability.h> | |
53 | ||
54 | /*! | |
55 | * @const DARWIN_API_VERSION | |
56 | * The API version of the library. This version will be changed in accordance | |
57 | * with new API introductions so that callers may submit code to the build that | |
58 | * adopts those new APIs before the APIs land by using the following pattern: | |
59 | * | |
60 | * #if DARWIN_API_VERSION >= 20180424 | |
61 | * darwin_new_api(); | |
62 | * #endif | |
63 | * | |
64 | * In this example, the libdarwin maintainer and API adopter agree on an API | |
65 | * version of 20180424 ahead of time for the introduction of | |
66 | * darwin_new_api_call(). When a libdarwin with that API version is submitted, | |
67 | * the project is rebuilt, and the new API becomes active. | |
68 | * | |
69 | * Breaking API changes will be both covered under this mechanism as well as | |
70 | * individual preprocessor macros in this header that declare new behavior as | |
71 | * required. | |
72 | */ | |
73 | #define DARWIN_API_VERSION 20170407lu | |
74 | ||
75 | #define DARWIN_API_AVAILABLE_20170407 \ | |
76 | API_AVAILABLE(macos(10.14), ios(12.0), tvos(12.0), watchos(5.0)) | |
77 | ||
78 | #endif // __DARWIN_API_H |