Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
G
gflags
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
gflags
Commits
10768125
Commit
10768125
authored
Mar 17, 2014
by
Andreas Schuh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix VS linker warning regarding locally defined FLAGS_tryfromenv symbol.
parent
8d3797cd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
12 deletions
+27
-12
gflags.cc
src/gflags.cc
+6
-2
gflags_declare.h.in
src/gflags_declare.h.in
+16
-10
gflags_unittest.cc
test/gflags_unittest.cc
+5
-0
No files found.
src/gflags.cc
View file @
10768125
...
...
@@ -109,6 +109,11 @@
#include "mutex.h"
#include "util.h"
// Export the following flags only if the gflags library is a DLL
#ifndef GFLAGS_SHARED_LIBS
# undef GFLAGS_DLL_DEFINE_FLAG
# define GFLAGS_DLL_DEFINE_FLAG
#endif
// Special flags, type 1: the 'recursive' flags. They set another flag's val.
DEFINE_string
(
flagfile
,
""
,
"load flags from file"
);
...
...
@@ -395,8 +400,7 @@ const char* FlagValue::TypeName() const {
assert
(
false
);
return
""
;
}
// Directly indexing the strigns in the 'types' string, each of them
// is 7 bytes long.
// Directly indexing the strings in the 'types' string, each of them is 7 bytes long.
return
&
types
[
type_
*
7
];
}
...
...
src/gflags_declare.h.in
View file @
10768125
...
...
@@ -72,18 +72,24 @@
# endif
#endif
// We always want to export defined variables, dll or no
#if defined(_MSC_VER)
# define GFLAGS_DLL_DEFINE_FLAG __declspec(dllexport)
#else
# define GFLAGS_DLL_DEFINE_FLAG
// By default, we always want to export defined variables, assuming
// that the DEFINE_FLAG macros are used within shared modules.
#ifndef GFLAGS_DLL_DEFINE_FLAG
# if defined(_MSC_VER)
# define GFLAGS_DLL_DEFINE_FLAG __declspec(dllexport)
# else
# define GFLAGS_DLL_DEFINE_FLAG
# endif
#endif
// We always want to import declared variables, dll or no
#if defined(_MSC_VER)
# define GFLAGS_DLL_DECLARE_FLAG __declspec(dllimport)
#else
# define GFLAGS_DLL_DECLARE_FLAG
// By default, we always want to export defined variables, assuming
// that the DECLARE_FLAG macros are used within shared modules.
#ifndef GFLAGS_DLL_DECLARE_FLAG
# if defined(_MSC_VER)
# define GFLAGS_DLL_DECLARE_FLAG __declspec(dllimport)
# else
# define GFLAGS_DLL_DECLARE_FLAG
# endif
#endif
// Export/import of STL class instantiations
...
...
test/gflags_unittest.cc
View file @
10768125
...
...
@@ -35,6 +35,11 @@
#include "config_for_unittests.h"
#include <gflags/gflags.h>
#ifndef GFLAGS_SHARED_LIBS
# undef GFLAGS_DLL_DECLARE_FLAG
# define GFLAGS_DLL_DECLARE_FLAG
#endif
#include <math.h> // for isinf() and isnan()
#include <stdio.h>
#include <stdlib.h>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment