summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndreas Schuh <andreas.schuh.84@gmail.com>2014-05-02 12:00:35 +0100
committerAndreas Schuh <andreas.schuh.84@gmail.com>2014-05-02 12:00:35 +0100
commita93de007a65eea5f0eea1eb830788dbdb7c17112 (patch)
treeef1f88c6794f2ffd900968cf78038473b3f33116 /src
parent05b155ff59114735ec8cd089f669c4c3d8f59029 (diff)
downloadgflags-a93de007a65eea5f0eea1eb830788dbdb7c17112.tar.gz
gflags-a93de007a65eea5f0eea1eb830788dbdb7c17112.tar.bz2
gflags-a93de007a65eea5f0eea1eb830788dbdb7c17112.zip
Define GFLAGS_NAMESPACE in public headers.
This avoids any mistakes where once @GFLAGS_NAMESPACE@ was used in public .h.in files, or the #define GFLAGS_NAMESPACE in internal source files.
Diffstat (limited to 'src')
-rw-r--r--src/config.h.in3
-rw-r--r--src/gflags.h.in20
-rw-r--r--src/gflags_declare.h.in15
3 files changed, 20 insertions, 18 deletions
diff --git a/src/config.h.in b/src/config.h.in
index c033dee..a8708da 100644
--- a/src/config.h.in
+++ b/src/config.h.in
@@ -70,9 +70,6 @@
// Define to the address where bug reports for this package should be sent.
#define PACKAGE_BUGREPORT @PACKAGE_BUGREPORT@
-// Namespace of gflags library symbols.
-#define GFLAGS_NAMESPACE @GFLAGS_NAMESPACE@
-
// ---------------------------------------------------------------------------
// Path separator
#ifndef PATH_SEPARATOR
diff --git a/src/gflags.h.in b/src/gflags.h.in
index 852de48..9ee7738 100644
--- a/src/gflags.h.in
+++ b/src/gflags.h.in
@@ -94,7 +94,7 @@
#endif
-namespace @GFLAGS_NAMESPACE@ {
+namespace GFLAGS_NAMESPACE {
// --------------------------------------------------------------------
@@ -136,7 +136,7 @@ extern GFLAGS_DLL_DECL bool RegisterFlagValidator(const std::string* flag, bool
// Convenience macro for the registration of a flag validator
#define DEFINE_validator(name, validator) \
static const bool name##_validator_registered = \
- @GFLAGS_NAMESPACE@::RegisterFlagValidator(&FLAGS_##name, validator)
+ GFLAGS_NAMESPACE::RegisterFlagValidator(&FLAGS_##name, validator)
// --------------------------------------------------------------------
@@ -442,7 +442,7 @@ class GFLAGS_DLL_DECL FlagRegisterer {
extern GFLAGS_DLL_DECL const char kStrippedFlagHelp[];
-} // namespace @GFLAGS_NAMESPACE@
+} // namespace GFLAGS_NAMESPACE
#ifndef SWIG // In swig, ignore the main flag declarations
@@ -450,7 +450,7 @@ extern GFLAGS_DLL_DECL const char kStrippedFlagHelp[];
#if defined(STRIP_FLAG_HELP) && STRIP_FLAG_HELP > 0
// Need this construct to avoid the 'defined but not used' warning.
#define MAYBE_STRIPPED_HELP(txt) \
- (false ? (txt) : @GFLAGS_NAMESPACE@::kStrippedFlagHelp)
+ (false ? (txt) : GFLAGS_NAMESPACE::kStrippedFlagHelp)
#else
#define MAYBE_STRIPPED_HELP(txt) txt
#endif
@@ -472,7 +472,7 @@ extern GFLAGS_DLL_DECL const char kStrippedFlagHelp[];
/* We always want to export defined variables, dll or no */ \
GFLAGS_DLL_DEFINE_FLAG type FLAGS_##name = FLAGS_nono##name; \
type FLAGS_no##name = FLAGS_nono##name; \
- static @GFLAGS_NAMESPACE@::FlagRegisterer o_##name( \
+ static GFLAGS_NAMESPACE::FlagRegisterer o_##name( \
#name, #type, MAYBE_STRIPPED_HELP(help), __FILE__, \
&FLAGS_##name, &FLAGS_no##name); \
} \
@@ -500,20 +500,20 @@ GFLAGS_DLL_DECL bool IsBoolFlag(bool from);
#define DEFINE_bool(name, val, txt) \
namespace fLB { \
typedef ::fLB::CompileAssert FLAG_##name##_value_is_not_a_bool[ \
- (sizeof(::fLB::IsBoolFlag(val)) != sizeof(double)) ? 1 : -1]; \
+ (sizeof(::fLB::IsBoolFlag(val)) != sizeof(double))? 1: -1]; \
} \
DEFINE_VARIABLE(bool, B, name, val, txt)
#define DEFINE_int32(name, val, txt) \
- DEFINE_VARIABLE(@GFLAGS_NAMESPACE@::int32, I, \
+ DEFINE_VARIABLE(GFLAGS_NAMESPACE::int32, I, \
name, val, txt)
#define DEFINE_int64(name, val, txt) \
- DEFINE_VARIABLE(@GFLAGS_NAMESPACE@::int64, I64, \
+ DEFINE_VARIABLE(GFLAGS_NAMESPACE::int64, I64, \
name, val, txt)
#define DEFINE_uint64(name,val, txt) \
- DEFINE_VARIABLE(@GFLAGS_NAMESPACE@::uint64, U64, \
+ DEFINE_VARIABLE(GFLAGS_NAMESPACE::uint64, U64, \
name, val, txt)
#define DEFINE_double(name, val, txt) \
@@ -554,7 +554,7 @@ inline clstring* dont_pass0toDEFINE_string(char *stringspot,
clstring* const FLAGS_no##name = ::fLS:: \
dont_pass0toDEFINE_string(s_##name[0].s, \
val); \
- static @GFLAGS_NAMESPACE@::FlagRegisterer o_##name( \
+ static GFLAGS_NAMESPACE::FlagRegisterer o_##name( \
#name, "string", MAYBE_STRIPPED_HELP(txt), __FILE__, \
s_##name[0].s, new (s_##name[1].s) clstring(*FLAGS_no##name)); \
extern GFLAGS_DLL_DEFINE_FLAG clstring& FLAGS_##name; \
diff --git a/src/gflags_declare.h.in b/src/gflags_declare.h.in
index b9ab9c7..279db24 100644
--- a/src/gflags_declare.h.in
+++ b/src/gflags_declare.h.in
@@ -37,6 +37,11 @@
#ifndef GFLAGS_DECLARE_H_
#define GFLAGS_DECLARE_H_
+
+// ---------------------------------------------------------------------------
+// Namespace of gflags library symbols.
+#define GFLAGS_NAMESPACE @GFLAGS_NAMESPACE@
+
// ---------------------------------------------------------------------------
// Windows DLL import/export.
@@ -69,7 +74,7 @@
# include <inttypes.h> // a third place for uint32_t or u_int32_t
#endif
-namespace @GFLAGS_NAMESPACE@ {
+namespace GFLAGS_NAMESPACE {
#if @GFLAGS_INTTYPES_FORMAT_C99@ // C99
typedef int32_t int32;
@@ -90,7 +95,7 @@ typedef unsigned __int64 uint64;
# error Do not know how to define a 32-bit integer quantity on your system
#endif
-} // namespace @GFLAGS_NAMESPACE@
+} // namespace GFLAGS_NAMESPACE
namespace fLS {
@@ -113,13 +118,13 @@ typedef std::string clstring;
DECLARE_VARIABLE(bool, B, name)
#define DECLARE_int32(name) \
- DECLARE_VARIABLE(::@GFLAGS_NAMESPACE@::int32, I, name)
+ DECLARE_VARIABLE(::GFLAGS_NAMESPACE::int32, I, name)
#define DECLARE_int64(name) \
- DECLARE_VARIABLE(::@GFLAGS_NAMESPACE@::int64, I64, name)
+ DECLARE_VARIABLE(::GFLAGS_NAMESPACE::int64, I64, name)
#define DECLARE_uint64(name) \
- DECLARE_VARIABLE(::@GFLAGS_NAMESPACE@::uint64, U64, name)
+ DECLARE_VARIABLE(::GFLAGS_NAMESPACE::uint64, U64, name)
#define DECLARE_double(name) \
DECLARE_VARIABLE(double, D, name)