Skip to content

Commit e7c7215

Browse files
committed
Add TargetConditionals.h
I added it before, but made a mistake so the file in the include directory was an empty file.
1 parent 4653ecf commit e7c7215

File tree

2 files changed

+33
-5
lines changed

2 files changed

+33
-5
lines changed

Diff for: src/usr/include/TargetConditionals.h

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// This file is placed in the public domain.
2+
//
3+
// This file is a replacement for TargetConditionals.h for which I can't find an
4+
// open source version in an open source Apple library. (There is one in
5+
// CarbonHeaders but it is outdated doesn't support ARM64).
6+
7+
#define TARGET_CPU_PPC 0
8+
#define TARGET_CPU_PPC64 0
9+
#define TARGET_CPU_68K 0
10+
#define TARGET_CPU_X86 0
11+
#define TARGET_CPU_X86_64 defined(__x86_64__)
12+
#define TARGET_CPU_ARM 0
13+
#define TARGET_CPU_ARM64 defined(__arm64__)
14+
#define TARGET_CPU_MIPS 0
15+
#define TARGET_CPU_SPARC 0
16+
#define TARGET_CPU_ALPHA 0
17+
18+
// We only support macOS (OSX) right now.
19+
#define TARGET_OS_WIN32 0
20+
#define TARGET_OS_WINDOWS 0
21+
#define TARGET_OS_UNIX 0
22+
#define TARGET_OS_LINUX 0
23+
#define TARGET_OS_MAC 1
24+
#define TARGET_OS_OSX 1
25+
#define TARGET_OS_IPHONE 0
26+
#define TARGET_OS_IOS 0
27+
#define TARGET_OS_MACCATALYST 0
28+
#define TARGET_OS_TV 0
29+
#define TARGET_OS_WATCH 0
30+
#define TARGET_OS_VISION 0
31+
#define TARGET_OS_BRIDGE 0
32+
#define TARGET_OS_SIMULATOR 0
33+
#define TARGET_OS_DRIVERKIT 0

Diff for: update.sh

-5
Original file line numberDiff line numberDiff line change
@@ -202,11 +202,6 @@ cp -p src/signal.h $include/machine/signal.h
202202
cp -p src/availability.h $include/os/availability.h
203203
cp -p src/TargetConditionals.h $include/TargetConditionals.h
204204

205-
# This was previously a file from CarbonHeaders, but it was very old (didn't
206-
# include support for arm64) so failed to compile. An empty file seems to be
207-
# sufficient for now.
208-
printf "" > $include/TargetConditionals.h
209-
210205
# Replace machine/_types.h, arm/_types.h, and i386/_types.h with a single file.
211206
# Do forward includes though, because arm/types.h and i386/types.h still
212207
# include the */_types.h version.

0 commit comments

Comments
 (0)