Guest User

Untitled

a guest
Jun 22nd, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.35 KB | None | 0 0
  1. Index: src/third_party/gflags/README.libmv
  2.  
  3. ===================================================================
  4.  
  5. --- src/third_party/gflags/README.libmv (revision 548)
  6.  
  7. +++ src/third_party/gflags/README.libmv (working copy)
  8.  
  9. @@ -8,3 +8,9 @@
  10.  
  11.  
  12. Added #if __WORDSIZE == 64 in gflacs.cc to fix compiler warnings
  13. See gflags issue 13 @ Project URL
  14. +
  15. +Added definitions for strcasecmp,strtoll,strtoull,snprintf for MSVC
  16. +
  17. +Changed "pthread_once" to "::pthread_once" to fix MSVC ambiguity
  18. +
  19. +Merged #ifdef HAVE_FNMATCH_H from gflags 1.1
  20.  
  21. \ No newline at end of file
  22.  
  23. Index: src/third_party/gflags/gflags.cc
  24.  
  25. ===================================================================
  26.  
  27. --- src/third_party/gflags/gflags.cc (revision 548)
  28.  
  29. +++ src/third_party/gflags/gflags.cc (working copy)
  30.  
  31. @@ -40,7 +40,9 @@
  32.  
  33. #include <errno.h>
  34. #include <string.h>
  35. #include <assert.h>
  36. +#ifdef HAVE_FNMATCH_H
  37. #include <fnmatch.h>
  38. +#endif // HAVE_FNMATCH_H
  39. #include <pthread.h>
  40. #include <string>
  41. #include <map>
  42. @@ -49,6 +51,14 @@
  43.  
  44. #include <algorithm>
  45. #include "gflags.h"
  46.  
  47. +#ifdef _MSC_VER
  48. +#include <windows.h> // for lstrcmpi
  49. +#define strcasecmp lstrcmpi
  50. +#define strtoll _strtoi64
  51. +#define strtoull _strtoui64
  52. +#define snprintf _snprintf_s
  53. +#endif
  54. +
  55. #ifndef PATH_SEPARATOR
  56. #define PATH_SEPARATOR '/'
  57. #endif
  58. @@ -665,7 +675,11 @@
  59.  
  60.  
  61. FlagRegistry* FlagRegistry::GlobalRegistry() {
  62. if (pthread_once) { // means we're running with pthreads
  63. - pthread_once(&global_registry_once_, &FlagRegistry::InitGlobalRegistry);
  64. +#ifdef MSC_VER
  65. + ::pthread_once(&global_registry_once_, &FlagRegistry::InitGlobalRegistry);
  66. +#else // !MSC_VER
  67. + pthread_once(&global_registry_once_, &FlagRegistry::InitGlobalRegistry);
  68. +#endif // MSC_VER
  69. } else { // not running with pthreads: we're the only thread
  70. if (global_registry_once_nothreads_++ == 0)
  71. InitGlobalRegistry();
  72. @@ -1180,9 +1194,18 @@
  73.  
  74. space = word + strlen(word);
  75. const string glob(word, space - word);
  76. // We try matching both against the full argv0 and basename(argv0)
  77. - if (fnmatch(glob.c_str(), ProgramInvocationName(), FNM_PATHNAME) == 0 ||
  78. - fnmatch(glob.c_str(), ProgramInvocationShortName(), FNM_PATHNAME) == 0) {
  79. - flags_are_relevant = true;
  80. +#ifdef HAVE_FNMATCH_H
  81. + if (fnmatch(glob.c_str(),
  82. + ProgramInvocationName(),
  83. + FNM_PATHNAME) == 0 ||
  84. + fnmatch(glob.c_str(),
  85. + ProgramInvocationShortName(),
  86. + FNM_PATHNAME) == 0) {
  87. +#else // !HAVE_FNMATCH_H
  88. + if ((glob == ProgramInvocationName()) ||
  89. + (glob == ProgramInvocationShortName())) {
  90. +#endif // HAVE_FNMATCH_H
  91. + flags_are_relevant = true;
  92. }
  93. }
  94. }
  95. Index: src/third_party/gflags/gflags.h
  96.  
  97. ===================================================================
  98.  
  99. --- src/third_party/gflags/gflags.h (revision 548)
  100.  
  101. +++ src/third_party/gflags/gflags.h (working copy)
  102.  
  103. @@ -72,6 +72,10 @@
  104.  
  105. #ifndef BASE_COMMANDLINEFLAGS_H__
  106. #define BASE_COMMANDLINEFLAGS_H__
  107.  
  108. +#ifndef __GNUC__
  109.  
  110. +#define __attribute__(X)
  111.  
  112. +#endif
  113. +
  114. #include <string>
  115. #include <vector>
  116.  
  117. Index: src/third_party/gflags/CMakeLists.txt
  118.  
  119. ===================================================================
  120.  
  121. --- src/third_party/gflags/CMakeLists.txt (revision 548)
  122.  
  123. +++ src/third_party/gflags/CMakeLists.txt (working copy)
  124.  
  125. @@ -1,3 +1,10 @@
  126.  
  127. +IF(WIN32)
  128. + INCLUDE_DIRECTORIES(
  129. + ../msinttypes-win32/include/
  130. + ../pthreads-win32/include/
  131. + )
  132. +ENDIF(WIN32)
  133. +
  134. ADD_LIBRARY( gflags
  135. gflags.cc
  136. gflags_reporting.cc
  137. Index: src/CMakeLists.txt
  138.  
  139. ===================================================================
  140.  
  141. --- src/CMakeLists.txt (revision 548)
  142.  
  143. +++ src/CMakeLists.txt (working copy)
  144.  
  145. @@ -31,7 +31,9 @@
  146.  
  147.  
  148. # -Wno-deprecated needed for gcc-4.3 on debian/testing;
  149. # needed due to flens/refcounter.h including deprecated hash_map
  150. -SET(CMAKE_CXX_FLAGS "-Wall -W -Wfatal-errors -Werror -Wno-deprecated -Wno-sign-compare -Wno-strict-aliasing")
  151. +IF(NOT WIN32)
  152. + SET(CMAKE_CXX_FLAGS "-Wall -W -Wfatal-errors -Werror -Wno-deprecated -Wno-sign-compare -Wno-strict-aliasing")
  153. +ENDIF(NOT WIN32)
  154.  
  155. SET(CMAKE_MODULE_PATH ${LIBMV_SOURCE_DIR}/CMakeModules)
  156. MESSAGE("CMAKE_MODULE_PATH = ${CMAKE_MODULE_PATH}")
Add Comment
Please, Sign In to add comment