summaryrefslogtreecommitdiff
path: root/port
diff options
context:
space:
mode:
authorcostan <costan@google.com>2018-03-09 08:36:08 -0800
committerVictor Costan <pwnall@chromium.org>2018-03-09 09:34:42 -0800
commit8c8024ea33d8efc8c415597fb7fa1745002961d6 (patch)
tree5534016862a12b546ee8dfa925ae76bcf06df657 /port
parent41172a24016bc29fc795ed504737392587f54e3d (diff)
downloadleveldb-8c8024ea33d8efc8c415597fb7fa1745002961d6.tar.gz
Switch HAVE_ library detection macros to 0/1.
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=188488298
Diffstat (limited to 'port')
-rw-r--r--port/port_posix.h24
1 files changed, 12 insertions, 12 deletions
diff --git a/port/port_posix.h b/port/port_posix.h
index d30f0f2..5bfc12e 100644
--- a/port/port_posix.h
+++ b/port/port_posix.h
@@ -39,12 +39,12 @@
#endif
#include <pthread.h>
-#if defined(HAVE_CRC32C)
+#if HAVE_CRC32C
#include <crc32c/crc32c.h>
-#endif // defined(HAVE_CRC32C)
-#ifdef HAVE_SNAPPY
+#endif // HAVE_CRC32C
+#if HAVE_SNAPPY
#include <snappy.h>
-#endif // defined(HAVE_SNAPPY)
+#endif // HAVE_SNAPPY
#include <stdint.h>
#include <string>
#include "port/atomic_pointer.h"
@@ -110,33 +110,33 @@ extern void InitOnce(OnceType* once, void (*initializer)());
inline bool Snappy_Compress(const char* input, size_t length,
::std::string* output) {
-#ifdef HAVE_SNAPPY
+#if HAVE_SNAPPY
output->resize(snappy::MaxCompressedLength(length));
size_t outlen;
snappy::RawCompress(input, length, &(*output)[0], &outlen);
output->resize(outlen);
return true;
-#endif // defined(HAVE_SNAPPY)
+#endif // HAVE_SNAPPY
return false;
}
inline bool Snappy_GetUncompressedLength(const char* input, size_t length,
size_t* result) {
-#ifdef HAVE_SNAPPY
+#if HAVE_SNAPPY
return snappy::GetUncompressedLength(input, length, result);
#else
return false;
-#endif // defined(HAVE_SNAPPY)
+#endif // HAVE_SNAPPY
}
inline bool Snappy_Uncompress(const char* input, size_t length,
char* output) {
-#ifdef HAVE_SNAPPY
+#if HAVE_SNAPPY
return snappy::RawUncompress(input, length, output);
#else
return false;
-#endif // defined(HAVE_SNAPPY)
+#endif // HAVE_SNAPPY
}
inline bool GetHeapProfile(void (*func)(void*, const char*, int), void* arg) {
@@ -144,11 +144,11 @@ inline bool GetHeapProfile(void (*func)(void*, const char*, int), void* arg) {
}
inline uint32_t AcceleratedCRC32C(uint32_t crc, const char* buf, size_t size) {
-#if defined(HAVE_CRC32C)
+#if HAVE_CRC32C
return ::crc32c::Extend(crc, reinterpret_cast<const uint8_t*>(buf), size);
#else
return 0;
-#endif // defined(HAVE_CRC32C)
+#endif // HAVE_CRC32C
}
} // namespace port