Commit graph

80 commits

Author SHA1 Message Date
Andreas Schuh
2b81a76bed fix: Include guard of alternative "gflags" namespace header. 2014-07-17 02:14:41 +01:00
Andreas Schuh
659b440f9e Support alternative namespaces in GFLAGS_NAMESPACE CMake variable.
The first element in the GFLAGS_NAMESPACE list is used as primary/default namespace. The symbols are then imported from this primary namespace into each of the other alternative namespaces with the using keyword. This is in particular used to maintain backwards compatibility with previous gflags library versions that used the "google" namespace instead of the new default "gflags" namespace.
2014-05-02 14:56:58 +01:00
Andreas Schuh
a93de007a6 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.
2014-05-02 12:00:35 +01:00
Andreas Schuh
38213112a5 Replace GFLAGS_NAMESPACE by @GFLAGS_NAMESPACE@ in gflags_declare.h (Fixes issue #79). 2014-03-26 19:37:01 +00:00
Andreas Schuh
cb62c00354 Change mode of text file. 2014-03-20 02:14:30 +00:00
Andreas Schuh
9ecc4cab3b Enable packaging of library using CPack. 2014-03-20 02:11:44 +00:00
Andreas Schuh
ddc5357419 Add link dependency on shlwapi.lib during build configuration instead of #pragma comment statement. Use this library also on MinGW. 2014-03-19 17:32:23 +00:00
Andreas Schuh
acb460af9e Use strtoll as defined by windows_port.h for strto64. 2014-03-19 16:53:19 +00:00
Andreas Schuh
41181669d1 Use OS_WINDOWS #define instead of _WIN32 and WINDOWS.
The OS_WINDOWS #define has previously been used in gflags.cc before the CMake migration.
2014-03-19 16:46:56 +00:00
Andreas Schuh
13025b119f Remove GFLAGS_NAMESPACE and version macros from public headers again. 2014-03-19 16:05:02 +00:00
Andreas Schuh
8566bcf1eb Replace GFLAGS_HAVE_* #defines by HAVE_* again. 2014-03-19 14:24:52 +00:00
Andreas Schuh
6e9f41669e No need to export CommandLineFlagInfo data only structure from DLL. 2014-03-19 11:35:30 +00:00
Andreas Schuh
d8c6a552aa Fix bug in SafeFOpen showing up in Cygwin. Errno only guaranteed to be set on failure. 2014-03-19 11:29:43 +00:00
Andreas Schuh
492ac156bc Fix DLL build on Windows and use PathMatchSpec instead of fnmatch.
Expose as few system variables as possible through public interface.
Perform STRIP_FLAGS_HELP test using CMake instead of Bash.
Change file path separator used by gflags_reporting.cc to backslash on Windwos.
2014-03-18 22:03:10 +00:00
Andreas Schuh
e491f0161d Add missing errno.h include statement and use int instead of errno_t. 2014-03-17 21:38:21 +00:00
Andreas Schuh
e31f179ae0 Fix up use of SafeFOpen. 2014-03-17 21:27:01 +00:00
Andreas Schuh
a0dca4df0c Create temporary directory for unit tests in specified --test_tmpdir if possible. 2014-03-17 21:21:59 +00:00
Andreas Schuh
eeb4db3234 Use _strtoi64 and _strtoui64 on Windows. 2014-03-17 21:21:21 +00:00
Andreas Schuh
107681258b Fix VS linker warning regarding locally defined FLAGS_tryfromenv symbol. 2014-03-17 21:20:24 +00:00
Andreas Schuh
8d3797cd15 Fix VS security warnings using SafeGetEnv and SafeFOpen utility functions. 2014-03-17 21:19:35 +00:00
Andreas Schuh
7b63ae8f8a Fix preprocessor conditions to use new GFLAGS_* defines. 2014-03-17 13:33:26 +00:00
Andreas Schuh
a4c4a01a37 Check if pthread_rwlock_t is available and use it if so. 2014-03-15 14:31:21 +00:00
Andreas Schuh
8477f3174e Fix build with Xcode 5, system checks, set LANGUAGE to CXX. 2014-03-15 14:15:33 +00:00
Andreas Schuh
15bc2d6c15 Issue #73 Merge gflags_config.h into gflags_declare.h. Configuration of gflags.h no longer needed. 2014-03-14 16:29:51 +00:00
Andreas Schuh
70eac23c1b Issue #73 Fix missing STL DLL export warnings of Visual Studio according to KB168958. 2014-03-14 16:08:52 +00:00
Andreas Schuh
b2180eb52c Fix build on Windows using Visual Studio. Add gflags_config.h. 2014-03-14 15:28:34 +00:00
Andreas Schuh
4eb2cb223b Add missing windows portability definitions. 2013-05-22 00:06:08 +01:00
Andreas Schuh
f7e89ba9ea Move public header files to src/ subdirectory. Copy them to <prefix>/include/<ns>/ upon installation. 2013-04-21 03:38:25 +01:00
Andreas Schuh
392eb67dbf Add CMakeLists.txt and adapt source files accordingly. 2013-04-21 03:05:35 +01:00
Andreas Schuh
2eed08d94a Move public header files to separate subdirectory. 2013-04-21 00:11:52 +01:00
Andreas Schuh
5ed8ae17a9 Remove build tool related files, operating system packages, and move unit tests to separate subdirectory. 2013-04-21 00:06:37 +01:00
Andreas Schuh
45a53dea87 Add DEFINE_validator macro for convenient registration of a flag validator.
git-svn-id: https://gflags.googlecode.com/svn/trunk@82 6586e3c6-dcc4-952a-343f-ff74eb82781d
2013-04-20 18:35:34 +00:00
Andreas Schuh
8011f61247 Use static_cast to avoid comparison of signed and unsigned integer warning in util.h.
git-svn-id: https://gflags.googlecode.com/svn/trunk@81 6586e3c6-dcc4-952a-343f-ff74eb82781d
2013-01-14 15:11:53 +00:00
Andreas Schuh
f098a54822 Fix deprecation warnings of VC++ regarding strdup and unlink. Add solution files for VS 2010 and VS 2012.
git-svn-id: https://gflags.googlecode.com/svn/trunk@80 6586e3c6-dcc4-952a-343f-ff74eb82781d
2012-11-20 14:48:22 +00:00
Andreas Schuh
6b215b0a3a Use project name (gflags) within include guards to avoid conflict with gperftools as reported by chen3feng (issue #62, http://code.google.com/p/gflags/issues/detail?id=62).
git-svn-id: https://gflags.googlecode.com/svn/trunk@78 6586e3c6-dcc4-952a-343f-ff74eb82781d
2012-11-11 20:32:35 +00:00
Andreas Schuh
e88280ed85 Fix "invalid suffix on literal; C++11 requires a space between literal and identifier" errors as reported by http://code.google.com/p/gflags/issues/detail?id=54.
git-svn-id: https://gflags.googlecode.com/svn/trunk@77 6586e3c6-dcc4-952a-343f-ff74eb82781d
2012-05-29 15:19:11 +00:00
Craig Silverstein
f18772936d Wed Jan 25 15:09:14 2012 Google Inc. <google-gflags@googlegroups.com>
* gflags: version 2.0
	* Changed the 'official' gflags email in setup.py/etc
	* Renamed google-gflags.sln to gflags.sln
	* Changed copyright text to reflect Google's relinquished ownership


git-svn-id: https://gflags.googlecode.com/svn/trunk@74 6586e3c6-dcc4-952a-343f-ff74eb82781d
2012-01-25 23:59:40 +00:00
Craig Silverstein
80912052d0 Clarify thread-safety comment for FlagSaver.
Tested:
blaze test base:commandlineflags_unittest

R=csilvers
DELTA=4  (3 added, 0 deleted, 1 changed)


Revision created by MOE tool push_codebase.
MOE_MIGRATION=3791


git-svn-id: https://gflags.googlecode.com/svn/trunk@71 6586e3c6-dcc4-952a-343f-ff74eb82781d
2011-12-01 01:58:29 +00:00
Craig Silverstein
be2da58d73 The last bit of rolling back commandlineflag categories:
remove the 'categories' field from CommandLineFlagInfo.  (Note
the code to fill this field was removed from
FillComandLineFlagInfo previously, so it's been an empty
string for some time now.)

R=ncalvin
DELTA=1  (0 added, 1 deleted, 0 changed)


Revision created by MOE tool push_codebase.
MOE_MIGRATION=3616


git-svn-id: https://gflags.googlecode.com/svn/trunk@70 6586e3c6-dcc4-952a-343f-ff74eb82781d
2011-11-03 23:37:01 +00:00
Craig Silverstein
2535e43dd2 Get rid of the old FlagRegisterer constructor.
R=jkline,georgevdd
DELTA=27  (0 added, 27 deleted, 0 changed)


Revision created by MOE tool push_codebase.
MOE_MIGRATION=3609


git-svn-id: https://gflags.googlecode.com/svn/trunk@69 6586e3c6-dcc4-952a-343f-ff74eb82781d
2011-11-03 23:28:30 +00:00
Craig Silverstein
c23c6c6fc8 Starting the rollback of flag categories.
I left in the old FlagRegisterer constructor.
I also left in 'categories' in CommandLineFlagInfo for now,
though I never use it.  I doubt anyone else does either, but I
want to minimize the number of ways this rollback can break
the build.  I will remove it in a subsequent CL.

R=ncalvin
DELTA=121  (28 added, 55 deleted, 38 changed)


Revision created by MOE tool push_codebase.
MOE_MIGRATION=3574


git-svn-id: https://gflags.googlecode.com/svn/trunk@68 6586e3c6-dcc4-952a-343f-ff74eb82781d
2011-11-03 23:25:32 +00:00
Craig Silverstein
17a627a413 Add a 'flag_ptr' field to CommandLineFlagInfo that points to the current storage of the flag (i.e. &FLAGS_foo).
R=csilvers
DELTA=15  (15 added, 0 deleted, 0 changed)


Revision created by MOE tool push_codebase.
MOE_MIGRATION=3301


git-svn-id: https://gflags.googlecode.com/svn/trunk@67 6586e3c6-dcc4-952a-343f-ff74eb82781d
2011-11-03 23:18:00 +00:00
Craig Silverstein
9bf7e65f08 Now I can get rid of the old constructor!
R=jkline,ncalvin
DELTA=28  (0 added, 27 deleted, 1 changed)


Revision created by MOE tool push_codebase.
MOE_MIGRATION=3169


git-svn-id: https://gflags.googlecode.com/svn/trunk@65 6586e3c6-dcc4-952a-343f-ff74eb82781d
2011-11-03 23:12:52 +00:00
Craig Silverstein
6b70a75081 http://code.google.com/p/google-gflags/issues/detail?id=45
reports that the error isn't always getting flushed on
cygwin.  So do that explicitly.

R=desovski
DELTA=1  (1 added, 0 deleted, 0 changed)


Revision created by MOE tool push_codebase.
MOE_MIGRATION=3140


git-svn-id: https://gflags.googlecode.com/svn/trunk@64 6586e3c6-dcc4-952a-343f-ff74eb82781d
2011-11-03 23:11:24 +00:00
Craig Silverstein
29f02f9896 Report category names via the xml help output (but not, yet,
during 'normal' help output).

R=ncalvin
DELTA=3  (3 added, 0 deleted, 0 changed)


Revision created by MOE tool push_codebase.
MOE_MIGRATION=3066


git-svn-id: https://gflags.googlecode.com/svn/trunk@63 6586e3c6-dcc4-952a-343f-ff74eb82781d
2011-11-03 23:09:49 +00:00
Craig Silverstein
10caa99e2d Add back in a backwards-compatible constructor for
FlagRegisterer.

Because this backwards-compatible API is intended to be
short-lived, I did it in the simplest, least invasive way
possible, which involved cutting-and-pasting.

R=ncalvin,jkline
DELTA=27  (27 added, 0 deleted, 0 changed)


Revision created by MOE tool push_codebase.
MOE_MIGRATION=3065


git-svn-id: https://gflags.googlecode.com/svn/trunk@62 6586e3c6-dcc4-952a-343f-ff74eb82781d
2011-11-03 23:09:19 +00:00
Craig Silverstein
874aed5db7 NOTE: I'm checking this in just to have a record in source control of the idea. We've decided for now it doesn't make sense to go forward with flag categories -- and the __VA_ARGS__ for macros has caused lots of problems with uncaught accidental commas, already -- so a future commit will back this out. (Actually, it's all a series of commits, for annoying technical reasons.)
Add support for flag categories.

In this CL, all you can do is set categories in the DEFINE_*
macros and then retrieve them via GetCommandLineFlagInfo and
similar.

In future CLs, we will start to give some semantic meaning to
particular flag values, as described in the designdoc.  In
particular, we will start to use flag categories to revamp
--help output.

Implementation-wise: to keep categories an optional macro
argument, I had to use __VA_ARGS__, which means future gflags
releases will no longer work with MSVC 7.1.  We're at MSVC 10
now, so I'm pretty much ok with that.

The downside of __VA_ARGS__ is there is no error if you
specify more args after the ones we expect.  To get around
that, I only use __VA_ARGS_ in this idiom:
static const OptionalDefineArgs var = { __VA_ARGS__ };
The new OptionalDefineArgs struct defines all the args that
may be optionally specified in the DEFINE_* macros.  For now,
that's only the 'categories' arg, though in theory more could be
added later.

R=titus,ncalvin
DELTA=92  (54 added, 3 deleted, 35 changed)


Revision created by MOE tool push_codebase.
MOE_MIGRATION=3057


git-svn-id: https://gflags.googlecode.com/svn/trunk@61 6586e3c6-dcc4-952a-343f-ff74eb82781d
2011-11-03 23:08:41 +00:00
Craig Silverstein
1b8e9bab5e Clean up the 'GFLAGS_DLL_DECL' stuff better: reduce use outside of windows/ directory.
R=jyrki
DELTA=33  (0 added, 27 deleted, 6 changed)


Revision created by MOE tool push_codebase.
MOE_MIGRATION=3016


git-svn-id: https://gflags.googlecode.com/svn/trunk@60 6586e3c6-dcc4-952a-343f-ff74eb82781d
2011-08-18 11:39:20 +00:00
Craig Silverstein
beb69a876b Fix a bug in StringPrintf() that caused it to not print large strings properly.
R=nilton
DELTA=1  (0 added, 0 deleted, 1 changed)


Revision created by MOE tool push_codebase.
MOE_MIGRATION=2886


git-svn-id: https://gflags.googlecode.com/svn/trunk@59 6586e3c6-dcc4-952a-343f-ff74eb82781d
2011-08-04 00:02:52 +00:00
Craig Silverstein
8233556d44 Add a new unittest case, that tests the --help output for a
really long helpstring.  Opensource gflags had a bug where we
were cutting off the output too soon; this test should protect
against such a thing.

R=nilton
DELTA=16  (16 added, 0 deleted, 0 changed)


Revision created by MOE tool push_codebase.
MOE_MIGRATION=2885


git-svn-id: https://gflags.googlecode.com/svn/trunk@58 6586e3c6-dcc4-952a-343f-ff74eb82781d
2011-08-04 00:02:39 +00:00