Guest User

Untitled

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