summaryrefslogtreecommitdiff
path: root/port
diff options
context:
space:
mode:
authorcostan <costan@google.com>2017-10-05 11:47:39 -0700
committerVictor Costan <pwnall@chromium.org>2017-10-05 12:19:09 -0700
commitca216e493f32278f50a823811ab95f64cf0f839b (patch)
tree08940291409ac374af8dd76ee65fc3e6e17425d4 /port
parent25767d066ca995c055f04b78a31a6e518087e667 (diff)
downloadleveldb-ca216e493f32278f50a823811ab95f64cf0f839b.tar.gz
leveldb: Rename SNAPPY to HAVE_SNAPPY.
This follows the general naming convention for preprocessor macros used to detect feature (library / header file / symbol) presence. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=171184641
Diffstat (limited to 'port')
-rw-r--r--port/port_posix.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/port/port_posix.h b/port/port_posix.h
index 1f4f6fc..2bc5223 100644
--- a/port/port_posix.h
+++ b/port/port_posix.h
@@ -39,9 +39,9 @@
#endif
#include <pthread.h>
-#ifdef SNAPPY
+#ifdef HAVE_SNAPPY
#include <snappy.h>
-#endif
+#endif // defined(HAVE_SNAPPY)
#include <stdint.h>
#include <string>
#include "port/atomic_pointer.h"
@@ -106,33 +106,33 @@ extern void InitOnce(OnceType* once, void (*initializer)());
inline bool Snappy_Compress(const char* input, size_t length,
::std::string* output) {
-#ifdef SNAPPY
+#ifdef HAVE_SNAPPY
output->resize(snappy::MaxCompressedLength(length));
size_t outlen;
snappy::RawCompress(input, length, &(*output)[0], &outlen);
output->resize(outlen);
return true;
-#endif
+#endif // defined(HAVE_SNAPPY)
return false;
}
inline bool Snappy_GetUncompressedLength(const char* input, size_t length,
size_t* result) {
-#ifdef SNAPPY
+#ifdef HAVE_SNAPPY
return snappy::GetUncompressedLength(input, length, result);
#else
return false;
-#endif
+#endif // defined(HAVE_SNAPPY)
}
inline bool Snappy_Uncompress(const char* input, size_t length,
char* output) {
-#ifdef SNAPPY
+#ifdef HAVE_SNAPPY
return snappy::RawUncompress(input, length, output);
#else
return false;
-#endif
+#endif // defined(HAVE_SNAPPY)
}
inline bool GetHeapProfile(void (*func)(void*, const char*, int), void* arg) {