mirror of
https://github.com/asmjit/asmjit.git
synced 2025-12-17 04:24:37 +03:00
[MSVC] workaround mvn macro and detect ARM64 (#407)
Fixed MSVC AArch64 build * Detect AArch64 target properly when compiling by MSVC * Workaround the issue caused by MSVC defining a mvn macro --------- Co-authored-by: Petr Kobalicek <kobalicek.petr@gmail.com>
This commit is contained in:
@@ -11,6 +11,14 @@
|
|||||||
#include "../arm/a64instdb.h"
|
#include "../arm/a64instdb.h"
|
||||||
#include "../arm/a64operand.h"
|
#include "../arm/a64operand.h"
|
||||||
|
|
||||||
|
// MSVC targeting AArch64 defines a lot of macros without underscores clashing
|
||||||
|
// with AArch64 instruction names. We have to workaround until it's fixed in SDK.
|
||||||
|
#if defined(_MSC_VER) && defined(mvn)
|
||||||
|
#define ASMJIT_RESTORE_MSVC_AARCH64_MACROS
|
||||||
|
#pragma push_macro("mvn")
|
||||||
|
#undef mvn
|
||||||
|
#endif
|
||||||
|
|
||||||
ASMJIT_BEGIN_SUB_NAMESPACE(a64)
|
ASMJIT_BEGIN_SUB_NAMESPACE(a64)
|
||||||
|
|
||||||
#define ASMJIT_INST_0x(NAME, ID) \
|
#define ASMJIT_INST_0x(NAME, ID) \
|
||||||
@@ -1225,4 +1233,9 @@ class Emitter : public BaseEmitter, public EmitterExplicitT<Emitter> {
|
|||||||
|
|
||||||
ASMJIT_END_SUB_NAMESPACE
|
ASMJIT_END_SUB_NAMESPACE
|
||||||
|
|
||||||
|
// Restore undefined MSVC AArch64 macros.
|
||||||
|
#if defined(ASMJIT_RESTORE_MSVC_AARCH64_MACROS)
|
||||||
|
#pragma pop_macro("mvn")
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif // ASMJIT_ARM_A64EMITTER_H_INCLUDED
|
#endif // ASMJIT_ARM_A64EMITTER_H_INCLUDED
|
||||||
|
|||||||
@@ -172,7 +172,7 @@ namespace asmjit {
|
|||||||
#define ASMJIT_ARCH_X86 0
|
#define ASMJIT_ARCH_X86 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__arm64__) || defined(__aarch64__)
|
#if defined(_M_ARM64) || defined(__arm64__) || defined(__aarch64__)
|
||||||
# define ASMJIT_ARCH_ARM 64
|
# define ASMJIT_ARCH_ARM 64
|
||||||
#elif defined(_M_ARM) || defined(_M_ARMT) || defined(__arm__) || defined(__thumb__) || defined(__thumb2__)
|
#elif defined(_M_ARM) || defined(_M_ARMT) || defined(__arm__) || defined(__thumb__) || defined(__thumb2__)
|
||||||
#define ASMJIT_ARCH_ARM 32
|
#define ASMJIT_ARCH_ARM 32
|
||||||
|
|||||||
Reference in New Issue
Block a user