Commit 6e390924 authored by Andreas Schuh's avatar Andreas Schuh

Merge branch 'feature/#83-alternative-namespace'

parents 05b155ff 2614f123
......@@ -26,15 +26,24 @@ set (PACKAGE_SOVERSION "${PACKAGE_VERSION_MAJOR}")
# ----------------------------------------------------------------------------
# options
set (GFLAGS_NAMESPACE "${PACKAGE_NAME}" CACHE STRING "C++ namespace identifier of gflags library.")
set (GFLAGS_INCLUDE_DIR "${PACKAGE_NAME}" CACHE STRING "Include subdirectory of gflags header files.")
if (IS_ABSOLUTE GFLAGS_INCLUDE_DIR)
message (FATAL_ERROR "GFLAGS_INCLUDE_DIR must be a path relative to CMAKE_INSTALL_PREFIX/include")
if (NOT GFLAGS_NAMESPACE)
# maintain binary backwards compatibility with gflags library version <= 2.0,
# but at the same time enable the use of the preferred new "gflags" namespace
set (GFLAGS_NAMESPACE "google;${PACKAGE_NAME}" CACHE STRING "Name(s) of library namespace (separate multiple options by semicolon)")
mark_as_advanced (GFLAGS_NAMESPACE)
endif ()
if (GFLAGS_INCLUDE_DIR MATCHES "^\\.\\.[/\\]")
message (FATAL_ERROR "GFLAGS_INCLUDE_DIR must not start with parent directory reference (../)")
set (GFLAGS_NAMESPACE_SECONDARY "${GFLAGS_NAMESPACE}")
list (REMOVE_DUPLICATES GFLAGS_NAMESPACE_SECONDARY)
if (NOT GFLAGS_NAMESPACE_SECONDARY)
message (FATAL_ERROR "GFLAGS_NAMESPACE must be set to one (or more) valid C++ namespace identifier(s separated by semicolon \";\").")
endif ()
foreach (ns IN LISTS GFLAGS_NAMESPACE_SECONDARY)
if (NOT ns MATCHES "^[a-zA-Z][a-zA-Z0-9_]*$")
message (FATAL_ERROR "GFLAGS_NAMESPACE contains invalid namespace identifier: ${ns}")
endif ()
endforeach ()
list (GET GFLAGS_NAMESPACE_SECONDARY 0 GFLAGS_NAMESPACE)
list (REMOVE_AT GFLAGS_NAMESPACE_SECONDARY 0)
option (BUILD_SHARED_LIBS "Request build of shared libraries." OFF)
option (BUILD_STATIC_LIBS "Request build of static libraries (default if BUILD_SHARED_LIBS is OFF)." OFF)
......@@ -47,8 +56,6 @@ option (INSTALL_HEADERS "Request packaging of headers and other devel
mark_as_advanced (CLEAR CMAKE_INSTALL_PREFIX)
mark_as_advanced (CMAKE_CONFIGURATION_TYPES
GFLAGS_NAMESPACE
GFLAGS_INCLUDE_DIR
BUILD_STATIC_LIBS
BUILD_NC_TESTS
INSTALL_HEADERS)
......@@ -69,6 +76,18 @@ if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CXX_FLAGS)
set_property (CACHE CMAKE_BUILD_TYPE PROPERTY VALUE Release)
endif ()
if (NOT GFLAGS_INCLUDE_DIR)
set (GFLAGS_INCLUDE_DIR "${PACKAGE_NAME}" CACHE STRING "Name of include directory of installed header files")
mark_as_advanced (GFLAGS_INCLUDE_DIR)
else ()
if (IS_ABSOLUTE GFLAGS_INCLUDE_DIR)
message (FATAL_ERROR "GFLAGS_INCLUDE_DIR must be a path relative to CMAKE_INSTALL_PREFIX/include")
endif ()
if (GFLAGS_INCLUDE_DIR MATCHES "^\\.\\.[/\\]")
message (FATAL_ERROR "GFLAGS_INCLUDE_DIR must not start with parent directory reference (../)")
endif ()
endif ()
# ----------------------------------------------------------------------------
# system checks
include (CheckTypeSize)
......@@ -183,6 +202,19 @@ set (PUBLIC_HDRS
"gflags_completions.h"
)
if (GFLAGS_NAMESPACE_SECONDARY)
set (INCLUDE_GFLAGS_NS_H "// Import gflags library symbols into alternative/deprecated namespace(s)")
foreach (ns IN LISTS GFLAGS_NAMESPACE_SECONDARY)
string (TOUPPER "${ns}" NS)
set (gflags_ns_h "${PROJECT_BINARY_DIR}/include/${GFLAGS_INCLUDE_DIR}/gflags_${ns}.h")
configure_file ("${PROJECT_SOURCE_DIR}/src/gflags_ns.h.in" "${gflags_ns_h}" @ONLY)
list (APPEND PUBLIC_HDRS "${gflags_ns_h}")
set (INCLUDE_GFLAGS_NS_H "${INCLUDE_GFLAGS_NS_H}\n#include \"gflags_${ns}.h\"")
endforeach ()
else ()
set (INCLUDE_GFLAGS_NS_H)
endif ()
set (PRIVATE_HDRS
"config.h"
"util.h"
......
Installing a binary distribution package
========================================
No official binary distribution packages are provided by the gflags developers.
There may, however, be binary packages available for your OS. Please consult
also the package repositories of your Linux distribution.
For example on Debian/Ubuntu Linux, gflags can be installed using the
following command:
sudo apt-get install gflags
Compiling the source code
=========================
The build system of gflags is since version 2.1 based on [CMake](http://cmake.org).
The common steps to build, test, and install software are therefore:
1. Extract source files.
2. Create build directory and change to it.
3. Run CMake to configure the build tree.
4. Build the software using selected build tool.
5. Test the built software.
6. Install the built files.
On Unix-like systems with GNU Make as build tool, these build steps can be
summarized by the following sequence of commands executed in a shell,
where ```$package``` and ```$version``` are shell variables which represent
the name of this package and the obtained version of the software.
$ tar xzf gflags-$version-source.tar.gz
$ cd gflags-$version
$ mkdir build && cd build
$ ccmake ..
- Press 'c' to configure the build system and 'e' to ignore warnings.
- Set CMAKE_INSTALL_PREFIX and other CMake variables and options.
- Continue pressing 'c' until the option 'g' is available.
- Then press 'g' to generate the configuration files for GNU Make.
$ make
$ make test (optional)
$ make install (optional)
In the following, only gflags-specific CMake settings available to
configure the build and installation are documented.
CMake Option | Description
---------------------- | -------------------------------------------------------
CMAKE_INSTALL_PREFIX | Installation directory, e.g., "/usr/local" on Unix and "C:\Program Files\gflags" on Windows.
GFLAGS_NAMESPACE | Name of the C++ namespace to be used by the gflags library. Note that the public source header files are installed in a subdirectory named after this namespace. To maintain backwards compatibility with the Google Commandline Flags, set this variable to "google". The default is "gflags".
GFLAGS_INCLUDE_DIR | Name of include subdirectory where headers are installed into.
INSTALLING A BINARY DISTRIBUTION PACKAGE
========================================
No official binary distribution packages are provided by the gflags developers.
There may, however, be binary packages available for your OS at
https://code.google.com/p/gflags/downloads/list. Please consult also the
package repositories of your Linux distribution.
For example on Debian/Ubuntu Linux, gflags can be installed using the
following command:
$ sudo apt-get install gflags
BUILDING THE SOFTWARE FROM SOURCES
==================================
Build Steps
-----------
The build system of gflags is since version 2.1 based on CMake (cmake.org).
The common steps to build, test, and install software based on CMake are:
1. Extract source files.
2. Create build directory and change to it.
3. Run CMake to configure the build tree.
4. Build the software using selected build tool.
5. Test the built software.
6. Install the built files.
On Unix-like systems with GNU Make as build tool, these build steps can be
summarized by the following sequence of commands executed in a shell,
where $package and $version are shell variables which represent the name
of this package and the obtained version of the software.
$ tar xzf gflags-$version-source.tar.gz
$ cd gflags-$version
$ mkdir build && cd build
$ ccmake ..
- Press 'c' to configure the build system and 'e' to ignore warnings.
- Set CMAKE_INSTALL_PREFIX and other CMake variables and options.
- Continue pressing 'c' until the option 'g' is available.
- Then press 'g' to generate the configuration files for GNU Make.
$ make
$ make test (optional)
$ make install (optional)
In the following, only gflags-specific CMake settings available to
configure the build and installation are documented.
CMake Options
-------------
- CMAKE_INSTALL_PREFIX Installation directory, e.g., "/usr/local" on Unix
and "C:\Program Files\gflags" on Windows.
Advanced CMake Options
----------------------
- GFLAGS_NAMESPACE Name of the C++ namespace to be used by the gflags library.
Note that the public source header files are installed in
a subdirectory named after this namespace. To maintain
backwards compatibility with the Google Commandline Flags,
set this variable to "google". The default is "gflags".
=== 30 March 2014 ===
24 March 2015
-------------
Finalized move of gflags project from Google Code to GitHub.
Email addresses of original issue reporters got lost in the process.
Given the age of most issue reports, this should be neglibable.
Please report any further issues using the GitHub issue tracker.
30 March 2014
-------------
I've just released gflags 2.1.1.
This release fixes a few bugs in the configuration of gflags_declare.h
and adds a separate GFLAGS_INCLUDE_DIR CMake variable to the build configuration.
Setting GFLAGS_NAMESPACE to "google" no longer changes also the include
This release fixes a few bugs in the configuration of gflags\_declare.h
and adds a separate GFLAGS\_INCLUDE\_DIR CMake variable to the build configuration.
Setting GFLAGS\_NAMESPACE to "google" no longer changes also the include
path of the public header files. This allows the use of the library with
other Google projects such as glog which still use the deprecated "google"
namespace for the gflags library, but include it as "gflags/gflags.h".
=== 20 March 2014 ===
20 March 2014
-------------
I've just released gflags 2.1.
The major changes are the use of CMake for the build configuration instead
of the autotools and packaging support through CPack. The default namespace
of all C++ symbols is now "gflags" instead of "google". This can be
configured via the GFLAGS_NAMESPACE variable.
configured via the GFLAGS\_NAMESPACE variable.
This release compiles with all major compilers without warnings and passed
the unit tests on Ubuntu 12.04, Windows 7 (Visual Studio 2008 and 2010,
......@@ -29,33 +41,35 @@ character of Git, I can push (and pull) changes from both GitHub and Google Code
in order to keep the two public repositories in sync.
When fixing an issue for a pull request through either of these hosting
platforms, please reference the issue number as
[https://code.google.com/p/support/wiki/IssueTracker#Integration_with_version_control described here].
[described here](https://code.google.com/p/support/wiki/IssueTracker#Integration_with_version_control).
For the further development, I am following the
[http://nvie.com/posts/a-successful-git-branching-model/ Git branching model]
[Git branching model](http://nvie.com/posts/a-successful-git-branching-model/)
with feature branch names prefixed by "feature/" and bugfix branch names
prefixed by "bugfix/", respectively.
Binary and source [https://github.com/schuhschuh/gflags/releases packages] are available on GitHub.
Binary and source [packages](https://github.com/schuhschuh/gflags/releases) are available on GitHub.
=== 14 January 2013 ===
14 January 2013
---------------
The migration of the build system to CMake is almost complete.
What remains to be done is rewriting the tests in Python such they can be
executed on non-Unix platforms and splitting them up into separate CTest tests.
Though merging these changes into the master branch yet remains to be done,
it is recommended to already start using the
[https://github.com/schuhschuh/gflags/tree/cmake-migration cmake-migration] branch.
[cmake-migration](https://github.com/schuhschuh/gflags/tree/cmake-migration) branch.
=== 20 April 2013 ===
20 April 2013
-------------
More than a year has past since I (Andreas) took over the maintenance for
`gflags`. Only few minor changes have been made since then, much to my regret.
To get more involved and stimulate participation in the further
development of the library, I moved the project source code today to
[https://github.com/schuhschuh/gflags GitHub].
I believe that the strengths of [http://git-scm.com/ Git] will allow for better community collaboration
[GitHub](https://github.com/schuhschuh/gflags).
I believe that the strengths of [Git](http://git-scm.com/) will allow for better community collaboration
as well as ease the integration of changes made by others. I encourage everyone
who would like to contribute to send me pull requests.
Git's lightweight feature branches will also provide the right tool for more
......@@ -74,13 +88,14 @@ Please continue to report any issues with gflags on Google Code. The GitHub proj
only be used to host the Git repository.
One major change of the project structure I have in mind for the next weeks
is the migration from autotools to [http://www.cmake.org/ CMake].
is the migration from autotools to [CMake](http://www.cmake.org/).
Check out the (unstable!)
[https://github.com/schuhschuh/gflags/tree/cmake-migration cmake-migration]
[cmake-migration](https://github.com/schuhschuh/gflags/tree/cmake-migration)
branch on GitHub for details.
=== 25 January 2012 ===
25 January 2012
---------------
I've just released gflags 2.0.
......@@ -91,8 +106,7 @@ around gflags and the ideas you have for the project going forward,
and look forward to having you on the team.
I bumped the major version number up to 2 to reflect the new community
ownership of the project. All the
[http://gflags.googlecode.com/svn/tags/gflags-2.0/ChangeLog changes]
ownership of the project. All the [changes](ChangeLog.txt)
are related to the renaming. There are no functional changes from
gflags 1.7. In particular, I've kept the code in the namespace
`google`, though in a future version it should be renamed to `gflags`.
......@@ -101,7 +115,8 @@ synonym of `/usr/local/include/gflags/`, though the former name has
been obsolete for some time now.
=== 18 January 2011 ===
18 January 2011
---------------
The `google-gflags` Google Code page has been renamed to
`gflags`, in preparation for the project being renamed to
......@@ -111,15 +126,16 @@ relinquishing ownership of the project; it will now be entirely
community run. The name change reflects that shift.
=== 20 December 2011 ===
20 December 2011
----------------
I've just released gflags 1.7. This is a minor release; the major
change is that `CommandLineFlagInfo` now exports the address in memory
where the flag is located. There has also been a bugfix involving
very long --help strings, and some other minor
[http://code.google.com/p/google-gflags/source/browse/tags/gflags-1.7/ChangeLog changes].
very long --help strings, and some other minor [changes](ChangeLog.txt).
=== 29 July 2011 ===
29 July 2011
------------
I've just released gflags 1.6. The major new feature in this release
is support for setting version info, so that --version does something
......@@ -138,11 +154,10 @@ frequent updates with better change descriptions. They will also
result in future `ChangeLog` entries being much more verbose (for better
or for worse).
See the
[http://code.google.com/p/google-gflags/source/browse/tags/gflags-1.6/ChangeLog ChangeLog]
for a full list of changes for this release.
See the [ChangeLog](ChangeLog.txt) for a full list of changes for this release.
=== 24 January 2011 ===
24 January 2011
---------------
I've just released gflags 1.5. This release has only minor changes
from 1.4, including some slightly better reporting in --help, and
......@@ -152,28 +167,30 @@ libraries under valgrind. The major change is to fix up the macros
If you have not had a problem with these macros, and don't need any of
the other changes described, there is no need to upgrade. See the
[http://code.google.com/p/google-gflags/source/browse/tags/gflags-1.5/ChangeLog ChangeLog]
for a full list of changes for this release.
[ChangeLog](ChangeLog.txt) for a full list of changes for this release.
=== 11 October 2010 ===
11 October 2010
---------------
I've just released gflags 1.4. This release has only minor changes
from 1.3, including some documentation tweaks and some work to make
the library smaller. If 1.3 is working well for you, there's no
particular reason to upgrade.
=== 4 January 2010 ===
4 January 2010
--------------
I've just released gflags 1.3. gflags now compiles under MSVC, and
all tests pass. I *really* never thought non-unix-y Windows folks
all tests pass. I **really** never thought non-unix-y Windows folks
would want gflags, but at least some of them do.
The major news, though, is that I've separated out the python package
into its own library, [http://code.google.com/p/python-gflags python-gflags].
into its own library, [python-gflags](http://code.google.com/p/python-gflags).
If you're interested in the Python version of gflags, that's the place to
get it now.
=== 10 September 2009 ==
10 September 2009
-----------------
I've just released gflags 1.2. The major change from gflags 1.1 is it
now compiles under MinGW (as well as cygwin), and all tests pass. I
......@@ -184,14 +201,13 @@ wrong!
The other changes are minor, such as support for --htmlxml in the
python version of gflags.
=== 15 April 2009 ===
15 April 2009
-------------
I've just released gflags 1.1. It has only minor changes fdrom gflags
1.0 (see the
[http://code.google.com/p/google-gflags/source/browse/tags/gflags-1.1/ChangeLog ChangeLog]
for details). The major change is that I moved to a new
system for creating .deb and .rpm files. This allows me to create
x86_64 deb and rpm files.
1.0 (see the [ChangeLog](ChangeLog.txt) for details).
The major change is that I moved to a new system for creating .deb and .rpm files.
This allows me to create x86\_64 deb and rpm files.
In the process of moving to this new system, I noticed an
inconsistency: the tar.gz and .rpm files created libraries named
......@@ -199,7 +215,7 @@ libgflags.so, but the deb file created libgoogle-gflags.so. I have
fixed the deb file to create libraries like the others. I'm no expert
in debian packaging, but I believe this has caused the package name to
change as well. Please let me know (at
[mailto:google-gflags@googlegroups.com
[[mailto:google-gflags@googlegroups.com](mailto:google-gflags@googlegroups.com)
google-gflags@googlegroups.com]) if this causes problems for you --
especially if you know of a fix! I would be happy to change the deb
packages to add symlinks from the old library name to the new
......@@ -210,20 +226,21 @@ If you've tried to install a .rpm or .deb and it doesn't work for you,
let me know. I'm excited to finally have 64-bit package files, but
there may still be some wrinkles in the new system to iron out.
=== 1 October 2008 ===
1 October 2008
--------------
gflags 1.0rc2 was out for a few weeks without any issues, so gflags
1.0 is now released. This is much like gflags 0.9. The major change
is that the .h files have been moved from `/usr/include/google` to
`/usr/include/gflags`. While I have backwards-compatibility
forwarding headeds in place, please rewrite existing code to say
{{{
```
#include <gflags/gflags.h>
}}}
```
instead of
{{{
```
#include <google/gflags.h>
}}}
```
I've kept the default namespace to google. You can still change with
with the appropriate flag to the configure script (`./configure
......@@ -233,8 +250,7 @@ non-backwards-compatible change, send mail to
`google-gflags@googlegroups.com`!
Version 1.0 also has some neat new features, like support for bash
commandline-completion of help flags. See the
[http://code.google.com/p/google-gflags/source/browse/tags/gflags-1.0rc2/ChangeLog
ChangeLog] for more details.
commandline-completion of help flags. See the [ChangeLog](ChangeLog.txt)
for more details.
If I don't hear any bad news for a few weeks, I'll release 1.0-final.
This package contains a library that implements commandline flags
processing. As such it's a replacement for getopt(). It has increased
flexibility, including built-in support for C++ types like string, and
the ability to define flags in the source file in which they're used.
......@@ -46,7 +46,9 @@ endfunction ()
function (configure_headers out)
set (tmp)
foreach (src IN LISTS ARGN)
if (EXISTS "${PROJECT_SOURCE_DIR}/src/${src}.in")
if (IS_ABSOLUTE "${src}")
list (APPEND tmp "${src}")
elseif (EXISTS "${PROJECT_SOURCE_DIR}/src/${src}.in")
configure_file ("${PROJECT_SOURCE_DIR}/src/${src}.in" "${PROJECT_BINARY_DIR}/include/${GFLAGS_INCLUDE_DIR}/${src}" @ONLY)
list (APPEND tmp "${PROJECT_BINARY_DIR}/include/${GFLAGS_INCLUDE_DIR}/${src}")
else ()
......
......@@ -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
......
......@@ -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; \
......@@ -565,4 +565,8 @@ inline clstring* dont_pass0toDEFINE_string(char *stringspot,
#endif // SWIG
@INCLUDE_GFLAGS_NS_H@
#endif // GFLAGS_GFLAGS_H_
......@@ -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)
......
// Copyright (c) 2014, Andreas Schuh
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// -----------------------------------------------------------------------------
// Imports the gflags library symbols into an alternative/deprecated namespace.
#ifndef GFLAGS_GFLAGS_H_
# error The internal header gflags_@ns@.h may only be included by gflags.h
#endif
#ifndef GFLAGS_NS_@NS@_H_
#define GFLAGS_NS_@NS@_H_
namespace @ns@ {
using GFLAGS_NAMESPACE::int32;
using GFLAGS_NAMESPACE::uint32;
using GFLAGS_NAMESPACE::int64;
using GFLAGS_NAMESPACE::uint64;
using GFLAGS_NAMESPACE::RegisterFlagValidator;
using GFLAGS_NAMESPACE::CommandLineFlagInfo;
using GFLAGS_NAMESPACE::GetAllFlags;
using GFLAGS_NAMESPACE::ShowUsageWithFlags;
using GFLAGS_NAMESPACE::ShowUsageWithFlagsRestrict;
using GFLAGS_NAMESPACE::DescribeOneFlag;
using GFLAGS_NAMESPACE::SetArgv;
using GFLAGS_NAMESPACE::GetArgvs;
using GFLAGS_NAMESPACE::GetArgv;
using GFLAGS_NAMESPACE::GetArgv0;
using GFLAGS_NAMESPACE::GetArgvSum;
using GFLAGS_NAMESPACE::ProgramInvocationName;
using GFLAGS_NAMESPACE::ProgramInvocationShortName;
using GFLAGS_NAMESPACE::ProgramUsage;
using GFLAGS_NAMESPACE::VersionString;
using GFLAGS_NAMESPACE::GetCommandLineOption;
using GFLAGS_NAMESPACE::GetCommandLineFlagInfo;
using GFLAGS_NAMESPACE::GetCommandLineFlagInfoOrDie;
using GFLAGS_NAMESPACE::FlagSettingMode;
using GFLAGS_NAMESPACE::SET_FLAGS_VALUE;
using GFLAGS_NAMESPACE::SET_FLAG_IF_DEFAULT;
using GFLAGS_NAMESPACE::SET_FLAGS_DEFAULT;
using GFLAGS_NAMESPACE::SetCommandLineOption;
using GFLAGS_NAMESPACE::SetCommandLineOptionWithMode;
using GFLAGS_NAMESPACE::FlagSaver;
using GFLAGS_NAMESPACE::CommandlineFlagsIntoString;
using GFLAGS_NAMESPACE::ReadFlagsFromString;
using GFLAGS_NAMESPACE::AppendFlagsIntoFile;
using GFLAGS_NAMESPACE::ReadFromFlagsFile;
using GFLAGS_NAMESPACE::BoolFromEnv;
using GFLAGS_NAMESPACE::Int32FromEnv;
using GFLAGS_NAMESPACE::Int64FromEnv;
using GFLAGS_NAMESPACE::Uint64FromEnv;
using GFLAGS_NAMESPACE::DoubleFromEnv;
using GFLAGS_NAMESPACE::StringFromEnv;
using GFLAGS_NAMESPACE::SetUsageMessage;
using GFLAGS_NAMESPACE::SetVersionString;
using GFLAGS_NAMESPACE::ParseCommandLineNonHelpFlags;
using GFLAGS_NAMESPACE::HandleCommandLineHelpFlags;
using GFLAGS_NAMESPACE::AllowCommandLineReparsing;
using GFLAGS_NAMESPACE::ReparseCommandLineNonHelpFlags;
using GFLAGS_NAMESPACE::ShutDownCommandLineFlags;
using GFLAGS_NAMESPACE::FlagRegisterer;
#ifndef SWIG
using GFLAGS_NAMESPACE::ParseCommandLineFlags;
#endif
} // namespace @ns@
#endif // GFLAGS_NS_@NS@_H_
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