Commit 10768125 authored by Andreas Schuh's avatar Andreas Schuh

Fix VS linker warning regarding locally defined FLAGS_tryfromenv symbol.

parent 8d3797cd
......@@ -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];
}
......
......@@ -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
......
......@@ -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>
......
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