LLDB  mainline
SafeMachO.h
Go to the documentation of this file.
1 //===-- SafeMachO.h -----------------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 #ifndef liblldb_SafeMachO_h_
9 #define liblldb_SafeMachO_h_
10 
11 // This header file is required to work around collisions between the defines
12 // in mach/machine.h, and enum members of the same name in llvm's MachO.h. If
13 // you want to use llvm/Support/MachO.h, use this file instead. The caveats
14 // are: 1) You can only use the MachO.h enums, you can't use the defines. That
15 // won't make a difference since the values
16 // are the same.
17 // 2) If you need any header file that relies on mach/machine.h, you must
18 // include that first. 3) This isn't a total solution, it doesn't undef every
19 // define that MachO.h has borrowed from various system headers,
20 // only the ones that come from mach/machine.h because that is the one we
21 // ended up pulling in from various places.
22 //
23 
24 #undef CPU_ARCH_MASK
25 #undef CPU_ARCH_ABI64
26 
27 #undef CPU_TYPE_ANY
28 #undef CPU_TYPE_X86
29 #undef CPU_TYPE_I386
30 #undef CPU_TYPE_X86_64
31 #undef CPU_TYPE_MC98000
32 #undef CPU_TYPE_ARM
33 #undef CPU_TYPE_ARM64
34 #undef CPU_TYPE_SPARC
35 #undef CPU_TYPE_POWERPC
36 #undef CPU_TYPE_POWERPC64
37 
38 #undef CPU_SUB_TYPE_MASK
39 #undef CPU_SUB_TYPE_LIB64
40 
41 #undef CPU_SUBTYPE_MULTIPLE
42 
43 #undef CPU_SUBTYPE_I386_ALL
44 #undef CPU_SUBTYPE_386
45 #undef CPU_SUBTYPE_486
46 #undef CPU_SUBTYPE_486SX
47 #undef CPU_SUBTYPE_586
48 #undef CPU_SUBTYPE_PENT
49 #undef CPU_SUBTYPE_PENTPRO
50 #undef CPU_SUBTYPE_PENTII_M3
51 #undef CPU_SUBTYPE_PENTII_M5
52 #undef CPU_SUBTYPE_CELERON
53 #undef CPU_SUBTYPE_CELERON_MOBILE
54 #undef CPU_SUBTYPE_PENTIUM_3
55 #undef CPU_SUBTYPE_PENTIUM_3_M
56 #undef CPU_SUBTYPE_PENTIUM_3_XEON
57 #undef CPU_SUBTYPE_PENTIUM_M
58 #undef CPU_SUBTYPE_PENTIUM_4
59 #undef CPU_SUBTYPE_PENTIUM_4_M
60 #undef CPU_SUBTYPE_ITANIUM
61 #undef CPU_SUBTYPE_ITANIUM_2
62 #undef CPU_SUBTYPE_XEON
63 #undef CPU_SUBTYPE_XEON_MP
64 
65 #undef CPU_SUBTYPE_X86_ALL
66 #undef CPU_SUBTYPE_X86_64_ALL
67 #undef CPU_SUBTYPE_X86_ARCH1
68 #undef CPU_SUBTYPE_X86_64_H
69 
70 #undef CPU_SUBTYPE_INTEL
71 #undef CPU_SUBTYPE_INTEL_FAMILY
72 #undef CPU_SUBTYPE_INTEL_FAMILY_MAX
73 #undef CPU_SUBTYPE_INTEL_MODEL
74 #undef CPU_SUBTYPE_INTEL_MODEL_ALL
75 
76 #undef CPU_SUBTYPE_ARM
77 #undef CPU_SUBTYPE_ARM_ALL
78 #undef CPU_SUBTYPE_ARM_V4T
79 #undef CPU_SUBTYPE_ARM_V6
80 #undef CPU_SUBTYPE_ARM_V5
81 #undef CPU_SUBTYPE_ARM_V5TEJ
82 #undef CPU_SUBTYPE_ARM_XSCALE
83 #undef CPU_SUBTYPE_ARM_V7
84 
85 #undef CPU_SUBTYPE_ARM_V7S
86 #undef CPU_SUBTYPE_ARM_V7K
87 #undef CPU_SUBTYPE_ARM_V6M
88 #undef CPU_SUBTYPE_ARM_V7M
89 #undef CPU_SUBTYPE_ARM_V7EM
90 
91 #undef CPU_SUBTYPE_ARM64_ALL
92 
93 #undef CPU_SUBTYPE_SPARC_ALL
94 
95 #undef CPU_SUBTYPE_POWERPC
96 #undef CPU_SUBTYPE_POWERPC_ALL
97 #undef CPU_SUBTYPE_POWERPC_601
98 #undef CPU_SUBTYPE_POWERPC_602
99 #undef CPU_SUBTYPE_POWERPC_603
100 #undef CPU_SUBTYPE_POWERPC_603e
101 #undef CPU_SUBTYPE_POWERPC_603ev
102 #undef CPU_SUBTYPE_POWERPC_604
103 #undef CPU_SUBTYPE_POWERPC_604e
104 #undef CPU_SUBTYPE_POWERPC_620
105 #undef CPU_SUBTYPE_POWERPC_750
106 #undef CPU_SUBTYPE_POWERPC_7400
107 #undef CPU_SUBTYPE_POWERPC_7450
108 #undef CPU_SUBTYPE_POWERPC_970
109 
110 #undef CPU_SUBTYPE_MC980000_ALL
111 #undef CPU_SUBTYPE_MC98601
112 
113 #include "llvm/BinaryFormat/MachO.h"
114 
115 #endif // liblldb_SafeMachO_h_