summaryrefslogtreecommitdiff
path: root/include/lldb/Host/SafeMachO.h
blob: ec9887ececd5a88a99c79834a3e11c1a46d9acf9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
//===-- SafeMachO.h -----------------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#ifndef liblldb_SafeMachO_h_
#define liblldb_SafeMachO_h_

// This header file is required to work around collisions between the defines
// in mach/machine.h, and enum members of the same name in llvm's MachO.h.  If
// you want to use llvm/Support/MachO.h, use this file instead. The caveats
// are: 1) You can only use the MachO.h enums, you can't use the defines.  That
// won't make a difference since the values
//    are the same.
// 2) If you need any header file that relies on mach/machine.h, you must
// include that first. 3) This isn't a total solution, it doesn't undef every
// define that MachO.h has borrowed from various system headers,
//    only the ones that come from mach/machine.h because that is the one we
//    ended up pulling in from various places.
//

#undef CPU_ARCH_MASK
#undef CPU_ARCH_ABI64

#undef CPU_TYPE_ANY
#undef CPU_TYPE_X86
#undef CPU_TYPE_I386
#undef CPU_TYPE_X86_64
#undef CPU_TYPE_MC98000
#undef CPU_TYPE_ARM
#undef CPU_TYPE_ARM64
#undef CPU_TYPE_SPARC
#undef CPU_TYPE_POWERPC
#undef CPU_TYPE_POWERPC64

#undef CPU_SUB_TYPE_MASK
#undef CPU_SUB_TYPE_LIB64

#undef CPU_SUBTYPE_MULTIPLE

#undef CPU_SUBTYPE_I386_ALL
#undef CPU_SUBTYPE_386
#undef CPU_SUBTYPE_486
#undef CPU_SUBTYPE_486SX
#undef CPU_SUBTYPE_586
#undef CPU_SUBTYPE_PENT
#undef CPU_SUBTYPE_PENTPRO
#undef CPU_SUBTYPE_PENTII_M3
#undef CPU_SUBTYPE_PENTII_M5
#undef CPU_SUBTYPE_CELERON
#undef CPU_SUBTYPE_CELERON_MOBILE
#undef CPU_SUBTYPE_PENTIUM_3
#undef CPU_SUBTYPE_PENTIUM_3_M
#undef CPU_SUBTYPE_PENTIUM_3_XEON
#undef CPU_SUBTYPE_PENTIUM_M
#undef CPU_SUBTYPE_PENTIUM_4
#undef CPU_SUBTYPE_PENTIUM_4_M
#undef CPU_SUBTYPE_ITANIUM
#undef CPU_SUBTYPE_ITANIUM_2
#undef CPU_SUBTYPE_XEON
#undef CPU_SUBTYPE_XEON_MP

#undef CPU_SUBTYPE_X86_ALL
#undef CPU_SUBTYPE_X86_64_ALL
#undef CPU_SUBTYPE_X86_ARCH1
#undef CPU_SUBTYPE_X86_64_H

#undef CPU_SUBTYPE_INTEL
#undef CPU_SUBTYPE_INTEL_FAMILY
#undef CPU_SUBTYPE_INTEL_FAMILY_MAX
#undef CPU_SUBTYPE_INTEL_MODEL
#undef CPU_SUBTYPE_INTEL_MODEL_ALL

#undef CPU_SUBTYPE_ARM
#undef CPU_SUBTYPE_ARM_ALL
#undef CPU_SUBTYPE_ARM_V4T
#undef CPU_SUBTYPE_ARM_V6
#undef CPU_SUBTYPE_ARM_V5
#undef CPU_SUBTYPE_ARM_V5TEJ
#undef CPU_SUBTYPE_ARM_XSCALE
#undef CPU_SUBTYPE_ARM_V7

#undef CPU_SUBTYPE_ARM_V7S
#undef CPU_SUBTYPE_ARM_V7K
#undef CPU_SUBTYPE_ARM_V6M
#undef CPU_SUBTYPE_ARM_V7M
#undef CPU_SUBTYPE_ARM_V7EM

#undef CPU_SUBTYPE_ARM64_ALL

#undef CPU_SUBTYPE_SPARC_ALL

#undef CPU_SUBTYPE_POWERPC
#undef CPU_SUBTYPE_POWERPC_ALL
#undef CPU_SUBTYPE_POWERPC_601
#undef CPU_SUBTYPE_POWERPC_602
#undef CPU_SUBTYPE_POWERPC_603
#undef CPU_SUBTYPE_POWERPC_603e
#undef CPU_SUBTYPE_POWERPC_603ev
#undef CPU_SUBTYPE_POWERPC_604
#undef CPU_SUBTYPE_POWERPC_604e
#undef CPU_SUBTYPE_POWERPC_620
#undef CPU_SUBTYPE_POWERPC_750
#undef CPU_SUBTYPE_POWERPC_7400
#undef CPU_SUBTYPE_POWERPC_7450
#undef CPU_SUBTYPE_POWERPC_970

#undef CPU_SUBTYPE_MC980000_ALL
#undef CPU_SUBTYPE_MC98601

#include "llvm/BinaryFormat/MachO.h"

#endif // liblldb_SafeMachO_h_