|
| 1 | +/* Test that USB.h can be successfully included */ |
| 2 | + |
| 3 | +/* |
| 4 | + * Extra hacks to allow testing with "reverse mismatched" SDK. |
| 5 | + * |
| 6 | + * Building for 10.15 with a <10.12 SDK fails due to referencing a |
| 7 | + * missing definition for uuid_t. This situation is extremely unlikely |
| 8 | + * to occur "for real", so we only fix it in the test, just so that we don't |
| 9 | + * need to exclude this test from the allowable "reverse mismatch" tests. |
| 10 | + * |
| 11 | + * Similarly, we provide a missing (empty) definition for building |
| 12 | + * 26.x+ with a <12.x SDK. |
| 13 | + */ |
| 14 | + |
| 15 | +#if defined(_MACPORTS_LEGACY_MIN_EARLY_SDK_ALLOWED) \ |
| 16 | + && defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) |
| 17 | + |
| 18 | +#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 101500 \ |
| 19 | + && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 110000 |
| 20 | + |
| 21 | +#include <_macports_extras/sdkversion.h> |
| 22 | + |
| 23 | +#if __MPLS_SDK_MAJOR < 101200 |
| 24 | + |
| 25 | +#include <sys/_types.h> |
| 26 | +typedef __darwin_uuid_t uuid_t; |
| 27 | + |
| 28 | +#endif /* __MPLS_SDK_MAJOR < 101200 */ |
| 29 | + |
| 30 | +#endif /* 10.15 target */ |
| 31 | + |
| 32 | +#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 260000 |
| 33 | + |
| 34 | +#ifndef __kernel_ptr_semantics |
| 35 | +#define __kernel_ptr_semantics |
| 36 | +#endif |
| 37 | + |
| 38 | +#endif /* 26.x+ target */ |
| 39 | + |
| 40 | +#endif /* Older SDK allowed and known target */ |
1 | 41 |
|
2 | | -/* Not very exciting but normally this inclusion will fail with GCC 4.5+ pre-10.15 */ |
3 | 42 | #include <IOKit/usb/USB.h> |
4 | 43 | #include <stdio.h> |
5 | 44 |
|
|
0 commit comments