Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: src/third_party/gflags/README.libmv
- ===================================================================
- --- src/third_party/gflags/README.libmv (revision 548)
- +++ src/third_party/gflags/README.libmv (working copy)
- @@ -8,3 +8,9 @@
- Added #if __WORDSIZE == 64 in gflacs.cc to fix compiler warnings
- See gflags issue 13 @ Project URL
- +
- +Added definitions for strcasecmp,strtoll,strtoull,snprintf for MSVC
- +
- +Changed "pthread_once" to "::pthread_once" to fix MSVC ambiguity
- +
- +Merged #ifdef HAVE_FNMATCH_H from gflags 1.1
- \ No newline at end of file
- Index: src/third_party/gflags/gflags.cc
- ===================================================================
- --- src/third_party/gflags/gflags.cc (revision 548)
- +++ src/third_party/gflags/gflags.cc (working copy)
- @@ -40,7 +40,9 @@
- #include <errno.h>
- #include <string.h>
- #include <assert.h>
- +#ifdef HAVE_FNMATCH_H
- #include <fnmatch.h>
- +#endif // HAVE_FNMATCH_H
- #include <pthread.h>
- #include <string>
- #include <map>
- @@ -49,6 +51,14 @@
- #include <algorithm>
- #include "gflags.h"
- +#ifdef _MSC_VER
- +#include <windows.h> // for lstrcmpi
- +#define strcasecmp lstrcmpi
- +#define strtoll _strtoi64
- +#define strtoull _strtoui64
- +#define snprintf _snprintf_s
- +#endif
- +
- #ifndef PATH_SEPARATOR
- #define PATH_SEPARATOR '/'
- #endif
- @@ -665,7 +675,11 @@
- FlagRegistry* FlagRegistry::GlobalRegistry() {
- if (pthread_once) { // means we're running with pthreads
- - pthread_once(&global_registry_once_, &FlagRegistry::InitGlobalRegistry);
- +#ifdef MSC_VER
- + ::pthread_once(&global_registry_once_, &FlagRegistry::InitGlobalRegistry);
- +#else // !MSC_VER
- + pthread_once(&global_registry_once_, &FlagRegistry::InitGlobalRegistry);
- +#endif // MSC_VER
- } else { // not running with pthreads: we're the only thread
- if (global_registry_once_nothreads_++ == 0)
- InitGlobalRegistry();
- @@ -1180,9 +1194,18 @@
- space = word + strlen(word);
- const string glob(word, space - word);
- // We try matching both against the full argv0 and basename(argv0)
- - if (fnmatch(glob.c_str(), ProgramInvocationName(), FNM_PATHNAME) == 0 ||
- - fnmatch(glob.c_str(), ProgramInvocationShortName(), FNM_PATHNAME) == 0) {
- - flags_are_relevant = true;
- +#ifdef HAVE_FNMATCH_H
- + if (fnmatch(glob.c_str(),
- + ProgramInvocationName(),
- + FNM_PATHNAME) == 0 ||
- + fnmatch(glob.c_str(),
- + ProgramInvocationShortName(),
- + FNM_PATHNAME) == 0) {
- +#else // !HAVE_FNMATCH_H
- + if ((glob == ProgramInvocationName()) ||
- + (glob == ProgramInvocationShortName())) {
- +#endif // HAVE_FNMATCH_H
- + flags_are_relevant = true;
- }
- }
- }
- Index: src/third_party/gflags/gflags.h
- ===================================================================
- --- src/third_party/gflags/gflags.h (revision 548)
- +++ src/third_party/gflags/gflags.h (working copy)
- @@ -72,6 +72,10 @@
- #ifndef BASE_COMMANDLINEFLAGS_H__
- #define BASE_COMMANDLINEFLAGS_H__
- +#ifndef __GNUC__
- +#define __attribute__(X)
- +#endif
- +
- #include <string>
- #include <vector>
- Index: src/third_party/gflags/CMakeLists.txt
- ===================================================================
- --- src/third_party/gflags/CMakeLists.txt (revision 548)
- +++ src/third_party/gflags/CMakeLists.txt (working copy)
- @@ -1,3 +1,10 @@
- +IF(WIN32)
- + INCLUDE_DIRECTORIES(
- + ../msinttypes-win32/include/
- + ../pthreads-win32/include/
- + )
- +ENDIF(WIN32)
- +
- ADD_LIBRARY( gflags
- gflags.cc
- gflags_reporting.cc
- Index: src/CMakeLists.txt
- ===================================================================
- --- src/CMakeLists.txt (revision 548)
- +++ src/CMakeLists.txt (working copy)
- @@ -31,7 +31,9 @@
- # -Wno-deprecated needed for gcc-4.3 on debian/testing;
- # needed due to flens/refcounter.h including deprecated hash_map
- -SET(CMAKE_CXX_FLAGS "-Wall -W -Wfatal-errors -Werror -Wno-deprecated -Wno-sign-compare -Wno-strict-aliasing")
- +IF(NOT WIN32)
- + SET(CMAKE_CXX_FLAGS "-Wall -W -Wfatal-errors -Werror -Wno-deprecated -Wno-sign-compare -Wno-strict-aliasing")
- +ENDIF(NOT WIN32)
- SET(CMAKE_MODULE_PATH ${LIBMV_SOURCE_DIR}/CMakeModules)
- MESSAGE("CMAKE_MODULE_PATH = ${CMAKE_MODULE_PATH}")
Add Comment
Please, Sign In to add comment