SafeMachO.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  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. // This header file is required to work around collisions between the defines
  11. // in mach/machine.h, and enum members of the same name in llvm's MachO.h. If
  12. // you want to use llvm/Support/MachO.h, use this file instead. The caveats
  13. // are: 1) You can only use the MachO.h enums, you can't use the defines. That
  14. // won't make a difference since the values
  15. // are the same.
  16. // 2) If you need any header file that relies on mach/machine.h, you must
  17. // include that first. 3) This isn't a total solution, it doesn't undef every
  18. // define that MachO.h has borrowed from various system headers,
  19. // only the ones that come from mach/machine.h because that is the one we
  20. // ended up pulling in from various places.
  21. //
  22. #undef CPU_ARCH_MASK
  23. #undef CPU_ARCH_ABI64
  24. #undef CPU_ARCH_ABI64_32
  25. #undef CPU_TYPE_ANY
  26. #undef CPU_TYPE_X86
  27. #undef CPU_TYPE_I386
  28. #undef CPU_TYPE_X86_64
  29. #undef CPU_TYPE_MC98000
  30. #undef CPU_TYPE_ARM
  31. #undef CPU_TYPE_ARM64
  32. #undef CPU_TYPE_ARM64_32
  33. #undef CPU_TYPE_SPARC
  34. #undef CPU_TYPE_POWERPC
  35. #undef CPU_TYPE_POWERPC64
  36. #undef CPU_SUBTYPE_MASK
  37. #undef CPU_SUBTYPE_LIB64
  38. #undef CPU_SUBTYPE_MULTIPLE
  39. #undef CPU_SUBTYPE_I386_ALL
  40. #undef CPU_SUBTYPE_386
  41. #undef CPU_SUBTYPE_486
  42. #undef CPU_SUBTYPE_486SX
  43. #undef CPU_SUBTYPE_586
  44. #undef CPU_SUBTYPE_PENT
  45. #undef CPU_SUBTYPE_PENTPRO
  46. #undef CPU_SUBTYPE_PENTII_M3
  47. #undef CPU_SUBTYPE_PENTII_M5
  48. #undef CPU_SUBTYPE_CELERON
  49. #undef CPU_SUBTYPE_CELERON_MOBILE
  50. #undef CPU_SUBTYPE_PENTIUM_3
  51. #undef CPU_SUBTYPE_PENTIUM_3_M
  52. #undef CPU_SUBTYPE_PENTIUM_3_XEON
  53. #undef CPU_SUBTYPE_PENTIUM_M
  54. #undef CPU_SUBTYPE_PENTIUM_4
  55. #undef CPU_SUBTYPE_PENTIUM_4_M
  56. #undef CPU_SUBTYPE_ITANIUM
  57. #undef CPU_SUBTYPE_ITANIUM_2
  58. #undef CPU_SUBTYPE_XEON
  59. #undef CPU_SUBTYPE_XEON_MP
  60. #undef CPU_SUBTYPE_X86_ALL
  61. #undef CPU_SUBTYPE_X86_64_ALL
  62. #undef CPU_SUBTYPE_X86_ARCH1
  63. #undef CPU_SUBTYPE_X86_64_H
  64. #undef CPU_SUBTYPE_INTEL
  65. #undef CPU_SUBTYPE_INTEL_FAMILY
  66. #undef CPU_SUBTYPE_INTEL_FAMILY_MAX
  67. #undef CPU_SUBTYPE_INTEL_MODEL
  68. #undef CPU_SUBTYPE_INTEL_MODEL_ALL
  69. #undef CPU_SUBTYPE_ARM
  70. #undef CPU_SUBTYPE_ARM_ALL
  71. #undef CPU_SUBTYPE_ARM_V4T
  72. #undef CPU_SUBTYPE_ARM_V6
  73. #undef CPU_SUBTYPE_ARM_V5
  74. #undef CPU_SUBTYPE_ARM_V5TEJ
  75. #undef CPU_SUBTYPE_ARM_XSCALE
  76. #undef CPU_SUBTYPE_ARM_V7
  77. #undef CPU_SUBTYPE_ARM_V7S
  78. #undef CPU_SUBTYPE_ARM_V7K
  79. #undef CPU_SUBTYPE_ARM_V6M
  80. #undef CPU_SUBTYPE_ARM_V7M
  81. #undef CPU_SUBTYPE_ARM_V7EM
  82. #undef CPU_SUBTYPE_ARM64E
  83. #undef CPU_SUBTYPE_ARM64_32_V8
  84. #undef CPU_SUBTYPE_ARM64_V8
  85. #undef CPU_SUBTYPE_ARM64_ALL
  86. #undef CPU_SUBTYPE_SPARC_ALL
  87. #undef CPU_SUBTYPE_POWERPC
  88. #undef CPU_SUBTYPE_POWERPC_ALL
  89. #undef CPU_SUBTYPE_POWERPC_601
  90. #undef CPU_SUBTYPE_POWERPC_602
  91. #undef CPU_SUBTYPE_POWERPC_603
  92. #undef CPU_SUBTYPE_POWERPC_603e
  93. #undef CPU_SUBTYPE_POWERPC_603ev
  94. #undef CPU_SUBTYPE_POWERPC_604
  95. #undef CPU_SUBTYPE_POWERPC_604e
  96. #undef CPU_SUBTYPE_POWERPC_620
  97. #undef CPU_SUBTYPE_POWERPC_750
  98. #undef CPU_SUBTYPE_POWERPC_7400
  99. #undef CPU_SUBTYPE_POWERPC_7450
  100. #undef CPU_SUBTYPE_POWERPC_970
  101. #undef CPU_SUBTYPE_MC980000_ALL
  102. #undef CPU_SUBTYPE_MC98601
  103. #undef VM_PROT_READ
  104. #undef VM_PROT_WRITE
  105. #undef VM_PROT_EXECUTE
  106. #undef ARM_DEBUG_STATE
  107. #undef ARM_EXCEPTION_STATE
  108. #undef ARM_EXCEPTION_STATE64
  109. #undef ARM_EXCEPTION_STATE64_COUNT
  110. #undef ARM_THREAD_STATE
  111. #undef ARM_THREAD_STATE64
  112. #undef ARM_THREAD_STATE64_COUNT
  113. #undef ARM_THREAD_STATE_COUNT
  114. #undef ARM_VFP_STATE
  115. #undef ARN_THREAD_STATE_NONE
  116. #undef PPC_EXCEPTION_STATE
  117. #undef PPC_EXCEPTION_STATE64
  118. #undef PPC_FLOAT_STATE
  119. #undef PPC_THREAD_STATE
  120. #undef PPC_THREAD_STATE64
  121. #undef PPC_THREAD_STATE_NONE
  122. #undef PPC_VECTOR_STATE
  123. #undef x86_DEBUG_STATE
  124. #undef x86_DEBUG_STATE32
  125. #undef x86_DEBUG_STATE64
  126. #undef x86_EXCEPTION_STATE
  127. #undef x86_EXCEPTION_STATE32
  128. #undef x86_EXCEPTION_STATE64
  129. #undef x86_EXCEPTION_STATE64_COUNT
  130. #undef x86_EXCEPTION_STATE_COUNT
  131. #undef x86_FLOAT_STATE
  132. #undef x86_FLOAT_STATE32
  133. #undef x86_FLOAT_STATE64
  134. #undef x86_FLOAT_STATE64_COUNT
  135. #undef x86_FLOAT_STATE_COUNT
  136. #undef x86_THREAD_STATE
  137. #undef x86_THREAD_STATE32
  138. #undef x86_THREAD_STATE32_COUNT
  139. #undef x86_THREAD_STATE64
  140. #undef x86_THREAD_STATE64_COUNT
  141. #undef x86_THREAD_STATE_COUNT
  142. #include "llvm/BinaryFormat/MachO.h"
  143. #endif // LLDB_HOST_SAFEMACHO_H