From 4cace13aed3cd74a37538b85305c20aad03e9937 Mon Sep 17 00:00:00 2001 From: Christopher Dykes Date: Tue, 26 Apr 2016 09:38:18 -0700 Subject: [PATCH] Define DECLARE_VARIABLE in portability/GFlags.h Summary: If we don't, then anywhere we include `glog/logging.h` after the portability header will get the `DECLARE_*` and `DEFINE_*` macros undefined -_-.... Reviewed By: mzlee Differential Revision: D3220797 fb-gh-sync-id: 52907ddcd6b222fb1c6423034ea999eac5ce09ab fbshipit-source-id: 52907ddcd6b222fb1c6423034ea999eac5ce09ab --- folly/portability/GFlags.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/folly/portability/GFlags.h b/folly/portability/GFlags.h index e3890eab..846bdc1e 100644 --- a/folly/portability/GFlags.h +++ b/folly/portability/GFlags.h @@ -19,6 +19,14 @@ #if FOLLY_HAVE_LIBGFLAGS #include #else +// glog/logging.h is dependent on this implementation detail +// being defined otherwise it undefines all of this -_-.... +// +// Also, this is deliberately expanded such that places using +// it directly break loudly. (C will break louder than C++, but oh well) +#define DECLARE_VARIABLE() \ + static_assert(false, "You shouldn't be using GFlags internals."); + #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) -- 2.34.1