From 5fa567a871f52ecaa2ad0a130c1d35196f49ce29 Mon Sep 17 00:00:00 2001 From: bkaradzic Date: Thu, 31 May 2012 19:28:19 -0700 Subject: [PATCH] Added 32-bit/64-bit architecture macro. --- include/bx/platform.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/include/bx/platform.h b/include/bx/platform.h index c4d92cb..e98eb75 100644 --- a/include/bx/platform.h +++ b/include/bx/platform.h @@ -20,6 +20,9 @@ #define BX_CPU_PPC 0 #define BX_CPU_X86 0 +#define BX_ARCH_32BIT 0 +#define BX_ARCH_64BIT 0 + #define BX_CPU_ENDIAN_BIG 0 #define BX_CPU_ENDIAN_LITTLE 0 @@ -75,6 +78,14 @@ # define BX_CACHE_LINE_SIZE 64 #endif // +#if defined(__x86_64__) || defined(_M_X64) || defined(__64BIT__) || defined(__powerpc64__) || defined(__ppc64__) +# undef BX_ARCH_64BIT +# define BX_ARCH_64BIT 1 +#else +# undef BX_ARCH_32BIT +# define BX_ARCH_32BIT 1 +#endif // + #if BX_CPU_PPC # undef BX_CPU_ENDIAN_BIG # define BX_CPU_ENDIAN_BIG 1