@@ -61,6 +61,7 @@ extern "C" {
61
61
#define CS_VERSION_MINOR CS_API_MINOR
62
62
#define CS_VERSION_EXTRA 0
63
63
64
+ #ifndef CAPSTONE_AARCH64_COMPAT_HEADER
64
65
/// Macro for meta programming.
65
66
/// Meant for projects using Capstone and need to support multiple
66
67
/// versions of it.
@@ -119,6 +120,7 @@ extern "C" {
119
120
#define CS_aarch64_shifter () aarch64_shifter
120
121
#define CS_aarch64_vas () AArch64Layout_VectorLayout
121
122
#endif
123
+ #endif // CAPSTONE_AARCH64_COMPAT_HEADER
122
124
123
125
/// Macro to create combined version which can be compared to
124
126
/// result of cs_version() API.
@@ -133,7 +135,11 @@ typedef size_t csh;
133
135
/// Architecture type
134
136
typedef enum cs_arch {
135
137
CS_ARCH_ARM = 0 , ///< ARM architecture (including Thumb, Thumb-2)
136
- CS_ARCH_AARCH64 , ///< AArch64
138
+ #ifdef CAPSTONE_AARCH64_COMPAT_HEADER
139
+ CS_ARCH_ARM64 = 1 , ///< ARM64
140
+ #else
141
+ CS_ARCH_AARCH64 = 1 , ///< AArch64
142
+ #endif
137
143
CS_ARCH_MIPS , ///< Mips architecture
138
144
CS_ARCH_X86 , ///< X86 architecture (including x86 & x86-64)
139
145
CS_ARCH_PPC , ///< PowerPC architecture
@@ -354,7 +360,11 @@ typedef struct cs_opt_skipdata {
354
360
355
361
356
362
#include "arm.h"
363
+ #ifdef CAPSTONE_AARCH64_COMPAT_HEADER
364
+ #include "arm64.h"
365
+ #else
357
366
#include "aarch64.h"
367
+ #endif
358
368
#include "m68k.h"
359
369
#include "mips.h"
360
370
#include "ppc.h"
@@ -399,7 +409,11 @@ typedef struct cs_detail {
399
409
/// Architecture-specific instruction info
400
410
union {
401
411
cs_x86 x86 ; ///< X86 architecture, including 16-bit, 32-bit & 64-bit mode
402
- cs_aarch64 aarch64 ; ///< AARCH64 architecture (aka AArch64)
412
+ #ifdef CAPSTONE_AARCH64_COMPAT_HEADER
413
+ cs_arm64 arm64 ;
414
+ #else
415
+ cs_aarch64 aarch64 ; ///< AArch6464 architecture (aka ARM64)
416
+ #endif
403
417
cs_arm arm ; ///< ARM architecture (including Thumb/Thumb2)
404
418
cs_m68k m68k ; ///< M68K architecture
405
419
cs_mips mips ; ///< MIPS architecture
@@ -526,6 +540,9 @@ CAPSTONE_EXPORT
526
540
void CAPSTONE_API cs_arch_register_arm (void );
527
541
CAPSTONE_EXPORT
528
542
void CAPSTONE_API cs_arch_register_aarch64 (void );
543
+ #ifdef CAPSTONE_AARCH64_COMPAT_HEADER
544
+ #define cs_arch_register_aarch64 cs_arch_register_arm64
545
+ #endif
529
546
CAPSTONE_EXPORT
530
547
void CAPSTONE_API cs_arch_register_mips (void );
531
548
CAPSTONE_EXPORT
0 commit comments