Add stubs for abseil flags.

This CL also removes support for using the gflags library to modify the
flags.

PiperOrigin-RevId: 361583626
This commit is contained in:
Victor Costan
2021-03-08 17:24:08 +00:00
parent 80a2a10c8c
commit 5e7c14bd05
7 changed files with 42 additions and 70 deletions

View File

@@ -105,17 +105,18 @@
#define SNAPPY_ATTRIBUTE_ALWAYS_INLINE
#endif
// This is only used for recomputing the tag byte table used during
// decompression; for simplicity we just remove it from the open-source
// version (anyone who wants to regenerate it can just do the call
// themselves within main()).
#define DEFINE_bool(flag_name, default_value, description) \
bool FLAGS_ ## flag_name = default_value
#define DECLARE_bool(flag_name) \
extern bool FLAGS_ ## flag_name
// Stubbed version of ABSL_FLAG.
//
// In the open source version, flags can only be changed at compile time.
#define SNAPPY_FLAG(flag_type, flag_name, default_value, help) \
flag_type FLAGS_ ## flag_name = default_value
namespace snappy {
// Stubbed version of absl::GetFlag().
template <typename T>
inline T GetFlag(T flag) { return flag; }
static const uint32_t kuint32max = std::numeric_limits<uint32_t>::max();
static const int64_t kint64max = std::numeric_limits<int64_t>::max();