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/firmware.h> instead of this file directly" 10 #endif // __IMG4_INDIRECT 11 12 #include <img4/shim.h> 13 14 /*! 15 * @const IMG4_API_VERSION 16 * The API version of the library. This version will be changed in accordance 17 * with new API introductions so that callers may submit code to the build that 18 * adopts those new APIs before the APIs land by using the following pattern: 19 * 20 * #if IMG4_API_VERSION >= 20180424 21 * img4_new_api(); 22 * #endif 23 * 24 * In this example, the library maintainer and API adopter agree on an API 25 * version of 20180424 ahead of time for the introduction of 26 * img4_new_api(). When a libdarwin with that API version is submitted, the 27 * project is rebuilt, and the new API becomes active. 28 * 29 * Breaking API changes will be both covered under this mechanism as well as 30 * individual preprocessor macros in this header that declare new behavior as 31 * required. 32 * 33 * @note 34 * For a period of time, the API version was incorrectly defined as 20212105 35 * when it should have been 20210521. Avoid version comparisons across that 36 * version epoch. 37 */ 38 #define IMG4_API_VERSION (20220513u) 39 40 #if IMG4_TARGET_DARWIN 41 #define IMG4_API_AVAILABLE_FALL_2018 \ 42 API_AVAILABLE( \ 43 macos(10.15), \ 44 ios(12.0), \ 45 tvos(12.0), \ 46 watchos(5.0)) 47 48 #define IMG4_API_DEPRECATED_FALL_2018 \ 49 API_DEPRECATED_WITH_REPLACEMENT( \ 50 "img4_firmware_t", \ 51 macos(10.15, 11.0), \ 52 ios(12.2, 14.0), \ 53 tvos(12.2, 14.0), \ 54 watchos(5.2, 7.0)) 55 56 #define IMG4_API_AVAILABLE_SPRING_2019 \ 57 API_AVAILABLE(\ 58 macos(10.15), \ 59 ios(12.2), \ 60 tvos(12.2), \ 61 watchos(5.2)) 62 63 #define IMG4_API_AVAILABLE_FALL_2020 \ 64 API_AVAILABLE( \ 65 macos(11.0), \ 66 ios(14.0), \ 67 tvos(14.0), \ 68 watchos(7.0), \ 69 bridgeos(5.0)) 70 71 #define IMG4_API_AVAILABLE_FALL_2021 \ 72 API_AVAILABLE( \ 73 macos(12.0), \ 74 ios(15.0), \ 75 tvos(15.0), \ 76 watchos(8.0), \ 77 bridgeos(6.0)) 78 79 #define IMG4_API_AVAILABLE_FALL_2021_B \ 80 API_AVAILABLE( \ 81 macos(12.1), \ 82 ios(15.1), \ 83 tvos(15.1), \ 84 watchos(8.1), \ 85 bridgeos(6.1)) 86 #define IMG4_API_AVAILABLE_FALL_2022 \ 87 API_AVAILABLE( \ 88 macos(13.0), \ 89 ios(16.0), \ 90 tvos(16.0), \ 91 watchos(9.0), \ 92 bridgeos(7.0)) 93 #else 94 #define IMG4_API_AVAILABLE_FALL_2018 95 #define IMG4_API_DEPRECATED_FALL_2018 96 #define IMG4_API_AVAILABLE_SPRING_2019 97 #define IMG4_API_AVAILABLE_FALL_2020 98 #define IMG4_API_AVAILABLE_FALL_2021 99 #define IMG4_API_AVAILABLE_FALL_2021_B 100 #define IMG4_API_AVAILABLE_FALL_2022 101 #endif 102 103 #define IMG4_API_AVAILABLE_20180112 IMG4_API_AVAILABLE_FALL_2018 104 #define IMG4_API_AVAILABLE_20181106 IMG4_API_AVAILABLE_SPRING_2019 105 #define IMG4_API_AVAILABLE_20200508 IMG4_API_AVAILABLE_FALL_2020 106 #define IMG4_API_AVAILABLE_20200608 IMG4_API_AVAILABLE_FALL_2020 107 #define IMG4_API_AVAILABLE_20200724 IMG4_API_AVAILABLE_FALL_2020 108 #define IMG4_API_AVAILABLE_20210113 IMG4_API_AVAILABLE_FALL_2021 109 #define IMG4_API_AVAILABLE_20210205 IMG4_API_AVAILABLE_FALL_2021 110 #define IMG4_API_AVAILABLE_20210226 IMG4_API_AVAILABLE_FALL_2021 111 #define IMG4_API_AVAILABLE_20210305 IMG4_API_AVAILABLE_FALL_2021 112 #define IMG4_API_AVAILABLE_20210521 IMG4_API_AVAILABLE_FALL_2021 113 #define IMG4_API_AVAILABLE_20210624 IMG4_API_AVAILABLE_FALL_2021 114 #define IMG4_API_AVAILABLE_20210731 IMG4_API_AVAILABLE_FALL_2021_B 115 #define IMG4_API_AVAILABLE_20211105 IMG4_API_AVAILABLE_FALL_2022 116 #define IMG4_API_AVAILABLE_20211112 IMG4_API_AVAILABLE_FALL_2022 117 #define IMG4_API_AVAILABLE_20211119 IMG4_API_AVAILABLE_FALL_2022 118 #define IMG4_API_AVAILABLE_20211126 IMG4_API_AVAILABLE_FALL_2022 119 #define IMG4_API_AVAILABLE_20211224 IMG4_API_AVAILABLE_FALL_2022 120 #define IMG4_API_AVAILABLE_20220128 IMG4_API_AVAILABLE_FALL_2022 121 #define IMG4_API_AVAILABLE_20220322 IMG4_API_AVAILABLE_FALL_2022 122 #define IMG4_API_AVAILABLE_20220401 IMG4_API_AVAILABLE_FALL_2022 123 #define IMG4_API_AVAILABLE_20220513 IMG4_API_AVAILABLE_FALL_2022 124 125 /*! 126 * @typedef img4_struct_version_t 127 * A type describing the version of a structure in the library. 128 */ 129 IMG4_API_AVAILABLE_20180112 130 typedef uint16_t img4_struct_version_t; 131 132 #endif // __IMG4_API_H 133