summaryrefslogtreecommitdiff
path: root/snappy-internal.h
diff options
context:
space:
mode:
authorVictor Costan <costan@google.com>2021-08-16 18:22:31 +0000
committerVictor Costan <pwnall@chromium.org>2021-08-16 18:26:33 +0000
commitcbb83a1d64a5505c6fe8d505641109e405358a7d (patch)
tree339214d7ad9a8a27d4d64aed78805bdebd9c926a /snappy-internal.h
parenta8400f1fabed965a9c52c0085e30f65ffa710961 (diff)
downloadsnappy-git-cbb83a1d64a5505c6fe8d505641109e405358a7d.tar.gz
Migrate feature detection macro checks from #ifdef to #if.
The #if predicate evaluates to false if the macro is undefined, or defined to 0. #ifdef (and its synonym #if defined) evaluates to false only if the macro is undefined. The new setup allows differentiating between setting a macro to 0 (to express that the capability definitely does not exist / should not be used) and leaving a macro undefined (to express not knowing whether a capability exists / not caring if a capability is used). PiperOrigin-RevId: 391094241
Diffstat (limited to 'snappy-internal.h')
-rw-r--r--snappy-internal.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/snappy-internal.h b/snappy-internal.h
index f1aafa9..8530071 100644
--- a/snappy-internal.h
+++ b/snappy-internal.h
@@ -153,8 +153,9 @@ char* CompressFragment(const char* input,
// loading from s2 + n.
//
// Separate implementation for 64-bit, little-endian cpus.
-#if !defined(SNAPPY_IS_BIG_ENDIAN) && \
- (defined(__x86_64__) || defined(_M_X64) || defined(ARCH_PPC) || defined(ARCH_ARM))
+#if !SNAPPY_IS_BIG_ENDIAN && \
+ (defined(__x86_64__) || defined(_M_X64) || defined(ARCH_PPC) || \
+ defined(ARCH_ARM))
static inline std::pair<size_t, bool> FindMatchLength(const char* s1,
const char* s2,
const char* s2_limit,