1 // RUN: %clang %s -o %t -mmacosx-version-min=10.7 -framework CoreFoundation -DMAJOR=%macos_version_major -DMINOR=%macos_version_minor -DSUBMINOR=%macos_version_subminor
5 typedef unsigned int uint32_t;
7 int32_t __isPlatformVersionAtLeast(uint32_t Platform
, uint32_t Major
,
8 uint32_t Minor
, uint32_t Subminor
);
10 #define PLATFORM_MACOS 1
12 int32_t check(uint32_t Major
, uint32_t Minor
, uint32_t Subminor
) {
14 __isPlatformVersionAtLeast(PLATFORM_MACOS
, Major
, Minor
, Subminor
);
19 if (!check(MAJOR
, MINOR
, SUBMINOR
))
21 if (check(MAJOR
, MINOR
, SUBMINOR
+ 1))
23 if (SUBMINOR
&& check(MAJOR
+ 1, MINOR
, SUBMINOR
- 1))
25 if (SUBMINOR
&& !check(MAJOR
, MINOR
, SUBMINOR
- 1))
27 if (MAJOR
&& !check(MAJOR
- 1, MINOR
+ 1, SUBMINOR
))