From: John Wolfe Date: Tue, 27 Oct 2020 00:29:54 +0000 (-0700) Subject: Update vm_basic_types.h for apple silicon X-Git-Tag: stable-11.3.0~284 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=26fc16779ffbce1833ea90d1d5efdba83708bb87;p=thirdparty%2Fopen-vm-tools.git Update vm_basic_types.h for apple silicon Apple silicon compilers will define __arm64__ as their name for their new CPU. But they also define __aarch64__ which existing 64-bit ARM CPUs use. Add a little bit of logic to enforce and document this. --- diff --git a/open-vm-tools/lib/include/vm_basic_types.h b/open-vm-tools/lib/include/vm_basic_types.h index e46c789fb..1eb06c2f7 100644 --- a/open-vm-tools/lib/include/vm_basic_types.h +++ b/open-vm-tools/lib/include/vm_basic_types.h @@ -78,12 +78,24 @@ #include "includeCheck.h" /* - * Macros __i386__ and __ia64 are intrinsically defined by GCC + * Standardize MSVC arch macros to GCC arch macros. */ #if defined _MSC_VER && defined _M_X64 -# define __x86_64__ +# define __x86_64__ 1 #elif defined _MSC_VER && defined _M_IX86 -# define __i386__ +# define __i386__ 1 +#elif defined _MSC_VER && defined _M_ARM64 +# define __aarch64__ 1 +#elif defined _MSC_VER && defined _M_ARM +# define __arm__ 1 +#endif + +/* + * Apple/Darwin uses __arm64__, but defines the more standard + * __aarch64__ too. Code below assumes __aarch64__. + */ +#if defined __arm64__ && !defined __aarch64__ +# error Unexpected: defined __arm64__ without __aarch64__ #endif /*