1 //===-- SafeMachO.h -----------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
9 #ifndef liblldb_SafeMachO_h_
10 #define liblldb_SafeMachO_h_
12 // This header file is required to work around collisions between the defines in
13 // mach/machine.h, and enum members
14 // of the same name in llvm's MachO.h. If you want to use llvm/Support/MachO.h,
15 // use this file instead.
17 // 1) You can only use the MachO.h enums, you can't use the defines. That won't
18 // make a difference since the values
20 // 2) If you need any header file that relies on mach/machine.h, you must
21 // include that first.
22 // 3) This isn't a total solution, it doesn't undef every define that MachO.h
23 // has borrowed from various system headers,
24 // only the ones that come from mach/machine.h because that is the one we
25 // ended up pulling in from various places.
34 #undef CPU_TYPE_X86_64
35 #undef CPU_TYPE_MC98000
39 #undef CPU_TYPE_POWERPC
40 #undef CPU_TYPE_POWERPC64
42 #undef CPU_SUB_TYPE_MASK
43 #undef CPU_SUB_TYPE_LIB64
45 #undef CPU_SUBTYPE_MULTIPLE
47 #undef CPU_SUBTYPE_I386_ALL
48 #undef CPU_SUBTYPE_386
49 #undef CPU_SUBTYPE_486
50 #undef CPU_SUBTYPE_486SX
51 #undef CPU_SUBTYPE_586
52 #undef CPU_SUBTYPE_PENT
53 #undef CPU_SUBTYPE_PENTPRO
54 #undef CPU_SUBTYPE_PENTII_M3
55 #undef CPU_SUBTYPE_PENTII_M5
56 #undef CPU_SUBTYPE_CELERON
57 #undef CPU_SUBTYPE_CELERON_MOBILE
58 #undef CPU_SUBTYPE_PENTIUM_3
59 #undef CPU_SUBTYPE_PENTIUM_3_M
60 #undef CPU_SUBTYPE_PENTIUM_3_XEON
61 #undef CPU_SUBTYPE_PENTIUM_M
62 #undef CPU_SUBTYPE_PENTIUM_4
63 #undef CPU_SUBTYPE_PENTIUM_4_M
64 #undef CPU_SUBTYPE_ITANIUM
65 #undef CPU_SUBTYPE_ITANIUM_2
66 #undef CPU_SUBTYPE_XEON
67 #undef CPU_SUBTYPE_XEON_MP
69 #undef CPU_SUBTYPE_X86_ALL
70 #undef CPU_SUBTYPE_X86_64_ALL
71 #undef CPU_SUBTYPE_X86_ARCH1
72 #undef CPU_SUBTYPE_X86_64_H
74 #undef CPU_SUBTYPE_INTEL
75 #undef CPU_SUBTYPE_INTEL_FAMILY
76 #undef CPU_SUBTYPE_INTEL_FAMILY_MAX
77 #undef CPU_SUBTYPE_INTEL_MODEL
78 #undef CPU_SUBTYPE_INTEL_MODEL_ALL
80 #undef CPU_SUBTYPE_ARM
81 #undef CPU_SUBTYPE_ARM_ALL
82 #undef CPU_SUBTYPE_ARM_V4T
83 #undef CPU_SUBTYPE_ARM_V6
84 #undef CPU_SUBTYPE_ARM_V5
85 #undef CPU_SUBTYPE_ARM_V5TEJ
86 #undef CPU_SUBTYPE_ARM_XSCALE
87 #undef CPU_SUBTYPE_ARM_V7
89 #undef CPU_SUBTYPE_ARM_V7S
90 #undef CPU_SUBTYPE_ARM_V7K
91 #undef CPU_SUBTYPE_ARM_V6M
92 #undef CPU_SUBTYPE_ARM_V7M
93 #undef CPU_SUBTYPE_ARM_V7EM
95 #undef CPU_SUBTYPE_ARM64_ALL
97 #undef CPU_SUBTYPE_SPARC_ALL
99 #undef CPU_SUBTYPE_POWERPC
100 #undef CPU_SUBTYPE_POWERPC_ALL
101 #undef CPU_SUBTYPE_POWERPC_601
102 #undef CPU_SUBTYPE_POWERPC_602
103 #undef CPU_SUBTYPE_POWERPC_603
104 #undef CPU_SUBTYPE_POWERPC_603e
105 #undef CPU_SUBTYPE_POWERPC_603ev
106 #undef CPU_SUBTYPE_POWERPC_604
107 #undef CPU_SUBTYPE_POWERPC_604e
108 #undef CPU_SUBTYPE_POWERPC_620
109 #undef CPU_SUBTYPE_POWERPC_750
110 #undef CPU_SUBTYPE_POWERPC_7400
111 #undef CPU_SUBTYPE_POWERPC_7450
112 #undef CPU_SUBTYPE_POWERPC_970
114 #undef CPU_SUBTYPE_MC980000_ALL
115 #undef CPU_SUBTYPE_MC98601
117 #include "llvm/BinaryFormat/MachO.h"
119 #endif // liblldb_SafeMachO_h_