diff options
Diffstat (limited to 'extern/libmv/third_party/glog/src/base')
-rw-r--r-- | extern/libmv/third_party/glog/src/base/commandlineflags.h | 59 | ||||
-rw-r--r-- | extern/libmv/third_party/glog/src/base/mutex.h | 14 |
2 files changed, 40 insertions, 33 deletions
diff --git a/extern/libmv/third_party/glog/src/base/commandlineflags.h b/extern/libmv/third_party/glog/src/base/commandlineflags.h index 483a96ee80b..529540ea461 100644 --- a/extern/libmv/third_party/glog/src/base/commandlineflags.h +++ b/extern/libmv/third_party/glog/src/base/commandlineflags.h @@ -48,56 +48,57 @@ #ifndef BASE_COMMANDLINEFLAGS_H__ #define BASE_COMMANDLINEFLAGS_H__ -#include "config.h" +#include "../config.h" #include <string> #include <string.h> // for memchr #include <stdlib.h> // for getenv #ifdef HAVE_LIB_GFLAGS -#include "third_party/gflags/gflags/gflags.h" +#include <gflags/gflags.h> #else -#include <glog/logging.h> +#include "glog/logging.h" -#define DECLARE_VARIABLE(type, name, tn) \ - namespace FLAG__namespace_do_not_use_directly_use_DECLARE_##tn##_instead { \ - extern GOOGLE_GLOG_DLL_DECL type FLAGS_##name; \ - } \ - using FLAG__namespace_do_not_use_directly_use_DECLARE_##tn##_instead::FLAGS_##name -#define DEFINE_VARIABLE(type, name, value, meaning, tn) \ - namespace FLAG__namespace_do_not_use_directly_use_DECLARE_##tn##_instead { \ - GOOGLE_GLOG_DLL_DECL type FLAGS_##name(value); \ - char FLAGS_no##name; \ - } \ - using FLAG__namespace_do_not_use_directly_use_DECLARE_##tn##_instead::FLAGS_##name +#define DECLARE_VARIABLE(type, shorttype, name, tn) \ + namespace fL##shorttype { \ + extern GOOGLE_GLOG_DLL_DECL type FLAGS_##name; \ + } \ + using fL##shorttype::FLAGS_##name +#define DEFINE_VARIABLE(type, shorttype, name, value, meaning, tn) \ + namespace fL##shorttype { \ + GOOGLE_GLOG_DLL_DECL type FLAGS_##name(value); \ + char FLAGS_no##name; \ + } \ + using fL##shorttype::FLAGS_##name // bool specialization #define DECLARE_bool(name) \ - DECLARE_VARIABLE(bool, name, bool) + DECLARE_VARIABLE(bool, B, name, bool) #define DEFINE_bool(name, value, meaning) \ - DEFINE_VARIABLE(bool, name, value, meaning, bool) + DEFINE_VARIABLE(bool, B, name, value, meaning, bool) // int32 specialization #define DECLARE_int32(name) \ - DECLARE_VARIABLE(GOOGLE_NAMESPACE::int32, name, int32) + DECLARE_VARIABLE(GOOGLE_NAMESPACE::int32, I, name, int32) #define DEFINE_int32(name, value, meaning) \ - DEFINE_VARIABLE(GOOGLE_NAMESPACE::int32, name, value, meaning, int32) + DEFINE_VARIABLE(GOOGLE_NAMESPACE::int32, I, name, value, meaning, int32) // Special case for string, because we have to specify the namespace // std::string, which doesn't play nicely with our FLAG__namespace hackery. -#define DECLARE_string(name) \ - namespace FLAG__namespace_do_not_use_directly_use_DECLARE_string_instead { \ - extern GOOGLE_GLOG_DLL_DECL std::string FLAGS_##name; \ - } \ - using FLAG__namespace_do_not_use_directly_use_DECLARE_string_instead::FLAGS_##name -#define DEFINE_string(name, value, meaning) \ - namespace FLAG__namespace_do_not_use_directly_use_DECLARE_string_instead { \ - GOOGLE_GLOG_DLL_DECL std::string FLAGS_##name(value); \ - char FLAGS_no##name; \ - } \ - using FLAG__namespace_do_not_use_directly_use_DECLARE_string_instead::FLAGS_##name +#define DECLARE_string(name) \ + namespace fLS { \ + extern GOOGLE_GLOG_DLL_DECL std::string& FLAGS_##name; \ + } \ + using fLS::FLAGS_##name +#define DEFINE_string(name, value, meaning) \ + namespace fLS { \ + std::string FLAGS_##name##_buf(value); \ + GOOGLE_GLOG_DLL_DECL std::string& FLAGS_##name = FLAGS_##name##_buf; \ + char FLAGS_no##name; \ + } \ + using fLS::FLAGS_##name #endif // HAVE_LIB_GFLAGS diff --git a/extern/libmv/third_party/glog/src/base/mutex.h b/extern/libmv/third_party/glog/src/base/mutex.h index 7ba88cb5a63..36fc55c4dcb 100644 --- a/extern/libmv/third_party/glog/src/base/mutex.h +++ b/extern/libmv/third_party/glog/src/base/mutex.h @@ -102,12 +102,14 @@ #ifndef GOOGLE_MUTEX_H_ #define GOOGLE_MUTEX_H_ -#include "config.h" // to figure out pthreads support +#include "../config.h" // to figure out pthreads support #if defined(NO_THREADS) typedef int MutexType; // to keep a lock-count #elif defined(_WIN32) || defined(__CYGWIN32__) || defined(__CYGWIN64__) -# define WIN32_LEAN_AND_MEAN // We only need minimal includes +# ifndef WIN32_LEAN_AND_MEAN +# define WIN32_LEAN_AND_MEAN // We only need minimal includes +# endif # ifdef GMUTEX_TRYLOCK // We need Windows NT or later for TryEnterCriticalSection(). If you // don't need that functionality, you can remove these _WIN32_WINNT @@ -117,9 +119,13 @@ # endif # endif // To avoid macro definition of ERROR. -# define NOGDI +# ifndef NOGDI +# define NOGDI +# endif // To avoid macro definition of min/max. -# define NOMINMAX +# ifndef NOMINMAX +# define NOMINMAX +# endif # include <windows.h> typedef CRITICAL_SECTION MutexType; #elif defined(HAVE_PTHREAD) && defined(HAVE_RWLOCK) |