Summary:
D4715918 broke open source builds on Ubuntu 14.04, since it has lz4-r114, but the lz4 frame API was introduced in [r123](https://github.com/lz4/lz4/blob/r123/lz4frame.h).
Put the `LZ4FrameCodec` behind a lz4 version check.
Fixes https://github.com/facebook/fbthrift/issues/209.
Reviewed By: yfeldblum
Differential Revision:
D4780830
fbshipit-source-id:
19492a7e6bdd128e610c36b5778274e19eff9548
#if FOLLY_HAVE_LIBLZ4
#include <lz4.h>
-#include <lz4frame.h>
#include <lz4hc.h>
+#if LZ4_VERSION_NUMBER >= 10301
+#include <lz4frame.h>
+#endif
#endif
#include <glog/logging.h>
return out;
}
+#if LZ4_VERSION_NUMBER >= 10301
+
class LZ4FrameCodec final : public Codec {
public:
static std::unique_ptr<Codec> create(int level, CodecType type);
void resetDCtx();
int level_;
- LZ4F_dctx* dctx_{nullptr};
+ LZ4F_decompressionContext_t dctx_{nullptr};
bool dirty_{false};
};
return queue.move();
}
+#endif // LZ4_VERSION_NUMBER >= 10301
#endif // FOLLY_HAVE_LIBLZ4
#if FOLLY_HAVE_LIBSNAPPY
nullptr,
#endif
-#if FOLLY_HAVE_LIBLZ4
+#if (FOLLY_HAVE_LIBLZ4 && LZ4_VERSION_NUMBER >= 10301)
LZ4FrameCodec::create,
#else
nullptr,