Commit 0ed00b64 authored by Michael Lee's avatar Michael Lee Committed by Facebook Github Bot 1

Define more pieces of portability/GFlags

Summary: Add more compatibility for missing gflags

Reviewed By: yfeldblum

Differential Revision: D3202560

fb-gh-sync-id: d25e4abfe8ceee9fb329c9ba12d259d1d03d4974
fbshipit-source-id: d25e4abfe8ceee9fb329c9ba12d259d1d03d4974
parent 8df3c4ab
......@@ -19,6 +19,7 @@
#include <folly/Portability.h>
#include <folly/Preprocessor.h> // for FB_ANONYMOUS_VARIABLE
#include <folly/ScopeGuard.h>
#include <folly/portability/GFlags.h>
#include <folly/portability/Time.h>
#include <cassert>
......@@ -26,7 +27,6 @@
#include <boost/function_types/function_arity.hpp>
#include <functional>
#include <glog/logging.h>
#include <gflags/gflags.h>
#include <limits>
#include <type_traits>
......
......@@ -14,13 +14,12 @@
* limitations under the License.
*/
#include <gflags/gflags.h>
#include <folly/Baton.h>
#include <folly/Benchmark.h>
#include <folly/Baton.h>
#include <folly/futures/Future.h>
#include <folly/futures/Promise.h>
#include <folly/futures/InlineExecutor.h>
#include <folly/futures/Promise.h>
#include <folly/portability/GFlags.h>
#include <semaphore.h>
#include <vector>
......
......@@ -21,5 +21,25 @@
#if FOLLY_HAVE_LIBGFLAGS
#include <gflags/gflags.h>
#else
#define DEFINE_int32(_name, _default, _description) int FLAGS_##_name = _default
#define FOLLY_DECLARE_FLAG(_type, _name) extern _type FLAGS_##_name
#define DECLARE_bool(_name) FOLLY_DECLARE_FLAG(bool, _name)
#define DECLARE_double(_name) FOLLY_DECLARE_FLAG(double, _name)
#define DECLARE_int32(_name) FOLLY_DECLARE_FLAG(int, _name)
#define DECLARE_int64(_name) FOLLY_DECLARE_FLAG(long long, _name)
#define DECLARE_uint64(_name) FOLLY_DECLARE_FLAG(unsigned long long, _name)
#define DECLARE_string(_name) FOLLY_DECLARE_FLAG(std::string, _name)
#define FOLLY_DEFINE_FLAG(_type, _name, _default) _type FLAGS_##_name = _default
#define DEFINE_bool(_name, _default, _description) \
FOLLY_DEFINE_FLAG(bool, _name, _default)
#define DEFINE_double(_name, _default, _description) \
FOLLY_DEFINE_FLAG(double, _name, _default)
#define DEFINE_int32(_name, _default, _description) \
FOLLY_DEFINE_FLAG(int, _name, _default)
#define DEFINE_int64(_name, _default, _description) \
FOLLY_DEFINE_FLAG(long long, _name, _default)
#define DEFINE_uint64(_name, _default, _description) \
FOLLY_DEFINE_FLAG(unsigned long long, _name, _default)
#define DEFINE_string(_name, _default, _description) \
FOLLY_DEFINE_FLAG(std::string, _name, _default)
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment