diff options
author | Victor Costan <costan@google.com> | 2020-05-06 15:55:59 +0000 |
---|---|---|
committer | Victor Costan <costan@google.com> | 2020-05-06 16:07:47 +0000 |
commit | 837f38b3e0cae01ccd5021b176509cb72eb25d81 (patch) | |
tree | 6de3a2c463ce7121288d45d8fd8d872190d44521 | |
parent | e1353b9fa8d72539f2d14cdba7f056a8c4c25ccc (diff) | |
download | snappy-git-837f38b3e0cae01ccd5021b176509cb72eb25d81.tar.gz |
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
-rw-r--r-- | snappy-stubs-internal.h | 14 |
1 files 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. |