From 832c3155276738e038fbaef30d140c56d8e6c919 Mon Sep 17 00:00:00 2001 From: Beny Luo Date: Mon, 23 Feb 2015 07:12:29 -0800 Subject: [PATCH] add preprocessor to hide unused functions Summary: encodeVarintToIOBuf and decodeVarintFromCursor are not used when FOLLY_HAVE_LIBLZMA and FOLLY_HAVE_LIBLZ4 are false, which will trigger -Werror,-Wunused-function on compile on mobile. Test Plan: unit test Reviewed By: seanc@fb.com Subscribers: meisner, trunkagent, seanc, folly-diffs@, yfeldblum FB internal diff: D1864016 Signature: t1:1864016:1424702813:75535ea92ac16385ce5c272d93bba507ccbb67a1 --- folly/io/Compression.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/folly/io/Compression.cpp b/folly/io/Compression.cpp index ab0ee5a0..9425f98f 100644 --- a/folly/io/Compression.cpp +++ b/folly/io/Compression.cpp @@ -148,6 +148,8 @@ std::unique_ptr NoCompressionCodec::doUncompress( return data->clone(); } +#if (FOLLY_HAVE_LIBLZ4 || FOLLY_HAVE_LIBLZMA) + namespace { void encodeVarintToIOBuf(uint64_t val, folly::IOBuf* out) { @@ -173,6 +175,8 @@ inline uint64_t decodeVarintFromCursor(folly::io::Cursor& cursor) { } // namespace +#endif // FOLLY_HAVE_LIBLZ4 || FOLLY_HAVE_LIBLZMA + #if FOLLY_HAVE_LIBLZ4 /** -- 2.34.1