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 LLDB_HOST_SAFEMACHO_H 9 #define LLDB_HOST_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 #undef CPU_ARCH_ABI64_32 27 28 #undef CPU_TYPE_ANY 29 #undef CPU_TYPE_X86 30 #undef CPU_TYPE_I386 31 #undef CPU_TYPE_X86_64 32 #undef CPU_TYPE_MC98000 33 #undef CPU_TYPE_ARM 34 #undef CPU_TYPE_ARM64 35 #undef CPU_TYPE_ARM64_32 36 #undef CPU_TYPE_SPARC 37 #undef CPU_TYPE_POWERPC 38 #undef CPU_TYPE_POWERPC64 39 40 #undef CPU_SUBTYPE_MASK 41 #undef CPU_SUBTYPE_LIB64 42 43 #undef CPU_SUBTYPE_MULTIPLE 44 45 #undef CPU_SUBTYPE_I386_ALL 46 #undef CPU_SUBTYPE_386 47 #undef CPU_SUBTYPE_486 48 #undef CPU_SUBTYPE_486SX 49 #undef CPU_SUBTYPE_586 50 #undef CPU_SUBTYPE_PENT 51 #undef CPU_SUBTYPE_PENTPRO 52 #undef CPU_SUBTYPE_PENTII_M3 53 #undef CPU_SUBTYPE_PENTII_M5 54 #undef CPU_SUBTYPE_CELERON 55 #undef CPU_SUBTYPE_CELERON_MOBILE 56 #undef CPU_SUBTYPE_PENTIUM_3 57 #undef CPU_SUBTYPE_PENTIUM_3_M 58 #undef CPU_SUBTYPE_PENTIUM_3_XEON 59 #undef CPU_SUBTYPE_PENTIUM_M 60 #undef CPU_SUBTYPE_PENTIUM_4 61 #undef CPU_SUBTYPE_PENTIUM_4_M 62 #undef CPU_SUBTYPE_ITANIUM 63 #undef CPU_SUBTYPE_ITANIUM_2 64 #undef CPU_SUBTYPE_XEON 65 #undef CPU_SUBTYPE_XEON_MP 66 67 #undef CPU_SUBTYPE_X86_ALL 68 #undef CPU_SUBTYPE_X86_64_ALL 69 #undef CPU_SUBTYPE_X86_ARCH1 70 #undef CPU_SUBTYPE_X86_64_H 71 72 #undef CPU_SUBTYPE_INTEL 73 #undef CPU_SUBTYPE_INTEL_FAMILY 74 #undef CPU_SUBTYPE_INTEL_FAMILY_MAX 75 #undef CPU_SUBTYPE_INTEL_MODEL 76 #undef CPU_SUBTYPE_INTEL_MODEL_ALL 77 78 #undef CPU_SUBTYPE_ARM 79 #undef CPU_SUBTYPE_ARM_ALL 80 #undef CPU_SUBTYPE_ARM_V4T 81 #undef CPU_SUBTYPE_ARM_V6 82 #undef CPU_SUBTYPE_ARM_V5 83 #undef CPU_SUBTYPE_ARM_V5TEJ 84 #undef CPU_SUBTYPE_ARM_XSCALE 85 #undef CPU_SUBTYPE_ARM_V7 86 87 #undef CPU_SUBTYPE_ARM_V7S 88 #undef CPU_SUBTYPE_ARM_V7K 89 #undef CPU_SUBTYPE_ARM_V6M 90 #undef CPU_SUBTYPE_ARM_V7M 91 #undef CPU_SUBTYPE_ARM_V7EM 92 93 #undef CPU_SUBTYPE_ARM64E 94 #undef CPU_SUBTYPE_ARM64_32_V8 95 #undef CPU_SUBTYPE_ARM64_V8 96 #undef CPU_SUBTYPE_ARM64_ALL 97 98 #undef CPU_SUBTYPE_SPARC_ALL 99 100 #undef CPU_SUBTYPE_POWERPC 101 #undef CPU_SUBTYPE_POWERPC_ALL 102 #undef CPU_SUBTYPE_POWERPC_601 103 #undef CPU_SUBTYPE_POWERPC_602 104 #undef CPU_SUBTYPE_POWERPC_603 105 #undef CPU_SUBTYPE_POWERPC_603e 106 #undef CPU_SUBTYPE_POWERPC_603ev 107 #undef CPU_SUBTYPE_POWERPC_604 108 #undef CPU_SUBTYPE_POWERPC_604e 109 #undef CPU_SUBTYPE_POWERPC_620 110 #undef CPU_SUBTYPE_POWERPC_750 111 #undef CPU_SUBTYPE_POWERPC_7400 112 #undef CPU_SUBTYPE_POWERPC_7450 113 #undef CPU_SUBTYPE_POWERPC_970 114 115 #undef CPU_SUBTYPE_MC980000_ALL 116 #undef CPU_SUBTYPE_MC98601 117 118 #undef VM_PROT_READ 119 #undef VM_PROT_WRITE 120 #undef VM_PROT_EXECUTE 121 122 #undef ARM_DEBUG_STATE 123 #undef ARM_EXCEPTION_STATE 124 #undef ARM_EXCEPTION_STATE64 125 #undef ARM_EXCEPTION_STATE64_COUNT 126 #undef ARM_THREAD_STATE 127 #undef ARM_THREAD_STATE64 128 #undef ARM_THREAD_STATE64_COUNT 129 #undef ARM_THREAD_STATE_COUNT 130 #undef ARM_VFP_STATE 131 #undef ARN_THREAD_STATE_NONE 132 #undef PPC_EXCEPTION_STATE 133 #undef PPC_EXCEPTION_STATE64 134 #undef PPC_FLOAT_STATE 135 #undef PPC_THREAD_STATE 136 #undef PPC_THREAD_STATE64 137 #undef PPC_THREAD_STATE_NONE 138 #undef PPC_VECTOR_STATE 139 #undef x86_DEBUG_STATE 140 #undef x86_DEBUG_STATE32 141 #undef x86_DEBUG_STATE64 142 #undef x86_EXCEPTION_STATE 143 #undef x86_EXCEPTION_STATE32 144 #undef x86_EXCEPTION_STATE64 145 #undef x86_EXCEPTION_STATE64_COUNT 146 #undef x86_EXCEPTION_STATE_COUNT 147 #undef x86_FLOAT_STATE 148 #undef x86_FLOAT_STATE32 149 #undef x86_FLOAT_STATE64 150 #undef x86_FLOAT_STATE64_COUNT 151 #undef x86_FLOAT_STATE_COUNT 152 #undef x86_THREAD_STATE 153 #undef x86_THREAD_STATE32 154 #undef x86_THREAD_STATE32_COUNT 155 #undef x86_THREAD_STATE64 156 #undef x86_THREAD_STATE64_COUNT 157 #undef x86_THREAD_STATE_COUNT 158 159 #include "llvm/BinaryFormat/MachO.h" 160 161 #endif // LLDB_HOST_SAFEMACHO_H 162