1 | /*! |
2 | * @header |
3 | * API definitions. |
4 | */ |
5 | #ifndef __IMG4_API_H |
6 | #define __IMG4_API_H |
7 | |
8 | #ifndef __IMG4_INDIRECT |
9 | #error "Please #include <img4/img4.h> instead of this file directly" |
10 | #endif // __IMG4_INDIRECT |
11 | |
12 | #ifndef KERNEL |
13 | #include <os/availability.h> |
14 | #endif |
15 | |
16 | #if !XNU_KERNEL_PRIVATE |
17 | #include <TargetConditionals.h> |
18 | #endif |
19 | |
20 | /*! |
21 | * @const IMG4_API_VERSION |
22 | * The API version of the library. This version will be changed in accordance |
23 | * with new API introductions so that callers may submit code to the build that |
24 | * adopts those new APIs before the APIs land by using the following pattern: |
25 | * |
26 | * #if IMG4_API_VERSION >= 20180424 |
27 | * img4_new_api(); |
28 | * #endif |
29 | * |
30 | * In this example, the library maintainer and API adopter agree on an API |
31 | * version of 20180424 ahead of time for the introduction of |
32 | * img4_new_api(). When a libdarwin with that API version is submitted, the |
33 | * project is rebuilt, and the new API becomes active. |
34 | * |
35 | * Breaking API changes will be both covered under this mechanism as well as |
36 | * individual preprocessor macros in this header that declare new behavior as |
37 | * required. |
38 | */ |
39 | #define IMG4_API_VERSION (20180112u) |
40 | |
41 | #if !defined(KERNEL) && !IMG4_PROJECT_BUILD |
42 | #define IMG4_API_AVAILABLE_20180112 \ |
43 | __API_UNAVAILABLE(macos) \ |
44 | API_AVAILABLE(ios(12.0), tvos(12.0), watchos(5.0)) |
45 | #else |
46 | #define IMG4_API_AVAILABLE_20180112 |
47 | #endif |
48 | |
49 | /*! |
50 | * @typedef img4_struct_version_t |
51 | * A type describing the version of a structure in the library. |
52 | */ |
53 | IMG4_API_AVAILABLE_20180112 |
54 | typedef uint16_t img4_struct_version_t; |
55 | |
56 | #endif // __IMG4_API_H |
57 | |