From 837f38b3e0cae01ccd5021b176509cb72eb25d81 Mon Sep 17 00:00:00 2001 From: Victor Costan Date: Wed, 6 May 2020 15:55:59 +0000 Subject: [PATCH] Revise stubs for ARCH_{K8,PPC,ARM}. * ARCH_K8 and ARCH_ARM now work correctly on MSVC. * ARCH_PPC now uses the same macro as tcmalloc. Microsoft documentation: https://docs.microsoft.com/en-us/cpp/preprocessor/predefined-macros?view=vs-2019 PowerPC documentation: http://openpowerfoundation.org/wp-content/uploads/resources/leabi/content/dbdoclet.50655243_75216.html PiperOrigin-RevId: 310160787 --- snappy-stubs-internal.h | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/snappy-stubs-internal.h b/snappy-stubs-internal.h index 683b849..97263f3 100644 --- a/snappy-stubs-internal.h +++ b/snappy-stubs-internal.h @@ -69,19 +69,13 @@ #include "snappy-stubs-public.h" -#if defined(__x86_64__) - -// Enable 64-bit optimized versions of some routines. +// Used to enable 64-bit optimized versions of some routines. +#if defined(__x86_64__) || defined(_M_X64) #define ARCH_K8 1 - -#elif defined(__ppc64__) - +#elif defined(__PPC64__) || defined(__powerpc64__) #define ARCH_PPC 1 - -#elif defined(__aarch64__) - +#elif defined(__aarch64__) || defined(_M_ARM64) #define ARCH_ARM 1 - #endif // Needed by OS X, among others.