From: Christopher Dykes Date: Tue, 26 Apr 2016 16:38:18 +0000 (-0700) Subject: Define DECLARE_VARIABLE in portability/GFlags.h X-Git-Tag: 2016.07.26~322 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=4cace13aed3cd74a37538b85305c20aad03e9937;p=folly.git 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 --- 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)