From 619946253e5f2dbad8b4a564d3d489ce40eb9de2 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Thu, 31 Dec 2015 17:56:57 +0500 Subject: Libmv: Yet again update to the latest version Again brings some fixes for MSVC-2015 and keeps it easier to backport the fixes into upstream. --- extern/libmv/CMakeLists.txt | 1 + extern/libmv/ChangeLog | 73 +++------------ extern/libmv/files.txt | 1 + extern/libmv/third_party/gflags/ChangeLog.txt | 10 ++ extern/libmv/third_party/gflags/config.h | 13 +-- extern/libmv/third_party/gflags/gflags.cc | 3 + extern/libmv/third_party/gflags/gflags/gflags.h | 25 +++-- .../third_party/gflags/gflags/gflags_completions.h | 2 +- .../third_party/gflags/gflags/gflags_declare.h | 19 ++-- .../third_party/gflags/gflags/gflags_gflags.h | 101 +++++++++++++++++++++ .../libmv/third_party/gflags/gflags_completions.cc | 2 + extern/libmv/third_party/gflags/mutex.h | 3 - extern/libmv/third_party/gflags/util.h | 5 +- extern/libmv/third_party/gflags/windows_port.cc | 6 +- extern/libmv/third_party/gflags/windows_port.h | 6 +- extern/libmv/third_party/glog/src/logging.cc | 6 +- 16 files changed, 180 insertions(+), 96 deletions(-) create mode 100644 extern/libmv/third_party/gflags/gflags/gflags_gflags.h (limited to 'extern') diff --git a/extern/libmv/CMakeLists.txt b/extern/libmv/CMakeLists.txt index 089743567f0..fd559c86846 100644 --- a/extern/libmv/CMakeLists.txt +++ b/extern/libmv/CMakeLists.txt @@ -277,6 +277,7 @@ if(WITH_LIBMV OR WITH_GTESTS OR (WITH_CYCLES AND WITH_CYCLES_LOGGING)) third_party/gflags/config.h third_party/gflags/gflags/gflags_completions.h third_party/gflags/gflags/gflags_declare.h + third_party/gflags/gflags/gflags_gflags.h third_party/gflags/gflags/gflags.h third_party/gflags/mutex.h third_party/gflags/util.h diff --git a/extern/libmv/ChangeLog b/extern/libmv/ChangeLog index 17338ac6578..e04defd1e1a 100644 --- a/extern/libmv/ChangeLog +++ b/extern/libmv/ChangeLog @@ -1,3 +1,17 @@ +commit df7642b270e8e43685e9ffb404b59d7b226a9f60 +Author: Sergey Sharybin +Date: Thu Dec 31 17:56:12 2015 +0500 + + Alternative fix for missing prototype for a couple of functions + +commit 08f685797b7d776cdaa579136c82b15ddc6ffb30 +Author: Sergey Sharybin +Date: Thu Dec 31 17:33:05 2015 +0500 + + Update GFlags to the latest upstream version + + Makes it easier to synchronize some compiler/warning fixes. + commit e0ef5b09203e3906a555e6c2010f25cb667da9cd Author: Sergey Sharybin Date: Thu Dec 31 16:15:59 2015 +0500 @@ -608,62 +622,3 @@ Date: Thu Apr 17 16:26:12 2014 +0600 CC: jta Differential Revision: https://developer.blender.org/D335 - -commit 313252083f6dfa69a93c287bed81dec616503c1b -Author: Sergey Sharybin -Date: Tue Apr 15 18:23:38 2014 +0600 - - Fix failure of the image transform linear test - - Mainly was caused by the flakyness of image rotation in cases - when image has even size. The test was expecting the transform - code to rotate the image around pixel corner, which isn't a - common behavior in image processing applications. Rotation - is usually done around the pixel center. - - So now made it so RotateImage() rotates the image around the - pixel center which gives 100% proper result for odd sized images - (i.e. center pixel stays untouched). - - Also made the tests to use odd image sizes which are more - predictable by the humans. We can use even sized images in the - tests as well but their result wouldn't be so much spectacular. - - Another issue with the tests was caused by RescaleImageTranslation - test which did expect things which are not happening in the - function. - - Reviewers: keir - - Reviewed By: keir - - Differential Revision: https://developer.blender.org/D463 - -commit 80d6945bf5f996b97cd41df0e422afce5e10e7f9 -Author: Sergey Sharybin -Date: Mon Apr 14 00:01:32 2014 +0600 - - Unit tests for feature detector - - Currently covers only simplest cases with synthetic images. - Also at this point mainly Harris detector is being testes, - other detectors behaves a bit unexpected on synthetic images - and this is to be investigated further. - - Tests will be extended further later. - - Additional change: - - - Added constructor to Feature structure - - Added operator << for feature for easier debug dumps. - - TODO: Some tests are not giving the result which i was expected - to. This is to be investigated further by finding the reference - detector implementation. For until then keeping that tests - commented out. - - Reviewers: keir - - Reviewed By: keir - - Differential Revision: https://developer.blender.org/D316 diff --git a/extern/libmv/files.txt b/extern/libmv/files.txt index 11f8ef24781..427ff86dc04 100644 --- a/extern/libmv/files.txt +++ b/extern/libmv/files.txt @@ -141,6 +141,7 @@ third_party/gflags/gflags.cc third_party/gflags/gflags_completions.cc third_party/gflags/gflags/gflags_completions.h third_party/gflags/gflags/gflags_declare.h +third_party/gflags/gflags/gflags_gflags.h third_party/gflags/gflags/gflags.h third_party/gflags/gflags_reporting.cc third_party/gflags/mutex.h diff --git a/extern/libmv/third_party/gflags/ChangeLog.txt b/extern/libmv/third_party/gflags/ChangeLog.txt index e14d88e35f2..eea9f83950f 100644 --- a/extern/libmv/third_party/gflags/ChangeLog.txt +++ b/extern/libmv/third_party/gflags/ChangeLog.txt @@ -1,3 +1,13 @@ +* Tue Mar 24 2014 - Andreas Schuh + +- gflags: version 2.1.2 +- Moved project to GitHub +- Added GFLAGS_NAMESPACE definition to gflags_declare.h +- Fixed issue 94: Keep "google" as primary namespace and import symbols into "gflags" namespace +- Fixed issue 96: Fix binary ABI compatibility with gflags 2.0 using "google" as primary namespace +- Fixed issue 97/101: Removed (patched) CMake modules and enabled C language instead +- Fixed issue 103: Set CMake policy CMP0042 to silence warning regarding MACOS_RPATH setting + * Sun Mar 20 2014 - Andreas Schuh - gflags: version 2.1.1 diff --git a/extern/libmv/third_party/gflags/config.h b/extern/libmv/third_party/gflags/config.h index 858510835c1..8d20e222362 100644 --- a/extern/libmv/third_party/gflags/config.h +++ b/extern/libmv/third_party/gflags/config.h @@ -29,7 +29,7 @@ /* #undef HAVE_FNMATCH_H */ // Define if you have the header file (Windows 2000/XP). -#undef HAVE_SHLWAPI_H +/* #undef HAVE_SHLWAPI_H */ // Define if you have the strtoll function. #define HAVE_STRTOLL @@ -58,22 +58,19 @@ #define PACKAGE_NAME gflags // Define to the full name and version of this package. -#define PACKAGE_STRING gflags 2.1.1 +#define PACKAGE_STRING gflags 2.2.0 // Define to the one symbol short name of this package. -#define PACKAGE_TARNAME gflags-2.1.1 +#define PACKAGE_TARNAME gflags-2.2.0 // Define to the version of this package. -#define PACKAGE_VERSION 2.1.1 +#define PACKAGE_VERSION 2.2.0 // Version number of package. #define VERSION PACKAGE_VERSION // Define to the address where bug reports for this package should be sent. -#define PACKAGE_BUGREPORT https://code.google.com/p/gflags/issues/ - -// Namespace of gflags library symbols. -#define GFLAGS_NAMESPACE gflags +#define PACKAGE_BUGREPORT https://github.com/schuhschuh/gflags/issues // --------------------------------------------------------------------------- // Path separator diff --git a/extern/libmv/third_party/gflags/gflags.cc b/extern/libmv/third_party/gflags/gflags.cc index 285050fe9ec..a35bbfe6664 100644 --- a/extern/libmv/third_party/gflags/gflags.cc +++ b/extern/libmv/third_party/gflags/gflags.cc @@ -111,6 +111,9 @@ #include "mutex.h" #include "util.h" +using namespace MUTEX_NAMESPACE; + + // Special flags, type 1: the 'recursive' flags. They set another flag's val. DEFINE_string(flagfile, "", "load flags from file"); DEFINE_string(fromenv, "", "set flags from the environment" diff --git a/extern/libmv/third_party/gflags/gflags/gflags.h b/extern/libmv/third_party/gflags/gflags/gflags.h index 797a54cac52..5e04772c9a3 100644 --- a/extern/libmv/third_party/gflags/gflags/gflags.h +++ b/extern/libmv/third_party/gflags/gflags/gflags.h @@ -94,7 +94,7 @@ #endif -namespace gflags { +namespace GFLAGS_NAMESPACE { // -------------------------------------------------------------------- @@ -136,7 +136,7 @@ extern GFLAGS_DLL_DECL bool RegisterFlagValidator(const std::string* flag, bool // Convenience macro for the registration of a flag validator #define DEFINE_validator(name, validator) \ static const bool name##_validator_registered = \ - gflags::RegisterFlagValidator(&FLAGS_##name, validator) + GFLAGS_NAMESPACE::RegisterFlagValidator(&FLAGS_##name, validator) // -------------------------------------------------------------------- @@ -442,7 +442,7 @@ class GFLAGS_DLL_DECL FlagRegisterer { extern GFLAGS_DLL_DECL const char kStrippedFlagHelp[]; -} // namespace gflags +} // namespace GFLAGS_NAMESPACE #ifndef SWIG // In swig, ignore the main flag declarations @@ -450,7 +450,7 @@ extern GFLAGS_DLL_DECL const char kStrippedFlagHelp[]; #if defined(STRIP_FLAG_HELP) && STRIP_FLAG_HELP > 0 // Need this construct to avoid the 'defined but not used' warning. #define MAYBE_STRIPPED_HELP(txt) \ - (false ? (txt) : gflags::kStrippedFlagHelp) + (false ? (txt) : GFLAGS_NAMESPACE::kStrippedFlagHelp) #else #define MAYBE_STRIPPED_HELP(txt) txt #endif @@ -472,7 +472,7 @@ extern GFLAGS_DLL_DECL const char kStrippedFlagHelp[]; /* We always want to export defined variables, dll or no */ \ GFLAGS_DLL_DEFINE_FLAG type FLAGS_##name = FLAGS_nono##name; \ type FLAGS_no##name = FLAGS_nono##name; \ - static gflags::FlagRegisterer o_##name( \ + static GFLAGS_NAMESPACE::FlagRegisterer o_##name( \ #name, #type, MAYBE_STRIPPED_HELP(help), __FILE__, \ &FLAGS_##name, &FLAGS_no##name); \ } \ @@ -500,20 +500,20 @@ GFLAGS_DLL_DECL bool IsBoolFlag(bool from); #define DEFINE_bool(name, val, txt) \ namespace fLB { \ typedef ::fLB::CompileAssert FLAG_##name##_value_is_not_a_bool[ \ - (sizeof(::fLB::IsBoolFlag(val)) != sizeof(double)) ? 1 : -1]; \ + (sizeof(::fLB::IsBoolFlag(val)) != sizeof(double))? 1: -1]; \ } \ DEFINE_VARIABLE(bool, B, name, val, txt) #define DEFINE_int32(name, val, txt) \ - DEFINE_VARIABLE(gflags::int32, I, \ + DEFINE_VARIABLE(GFLAGS_NAMESPACE::int32, I, \ name, val, txt) #define DEFINE_int64(name, val, txt) \ - DEFINE_VARIABLE(gflags::int64, I64, \ + DEFINE_VARIABLE(GFLAGS_NAMESPACE::int64, I64, \ name, val, txt) #define DEFINE_uint64(name,val, txt) \ - DEFINE_VARIABLE(gflags::uint64, U64, \ + DEFINE_VARIABLE(GFLAGS_NAMESPACE::uint64, U64, \ name, val, txt) #define DEFINE_double(name, val, txt) \ @@ -554,7 +554,7 @@ inline clstring* dont_pass0toDEFINE_string(char *stringspot, clstring* const FLAGS_no##name = ::fLS:: \ dont_pass0toDEFINE_string(s_##name[0].s, \ val); \ - static gflags::FlagRegisterer o_##name( \ + static GFLAGS_NAMESPACE::FlagRegisterer o_##name( \ #name, "string", MAYBE_STRIPPED_HELP(txt), __FILE__, \ s_##name[0].s, new (s_##name[1].s) clstring(*FLAGS_no##name)); \ extern GFLAGS_DLL_DEFINE_FLAG clstring& FLAGS_##name; \ @@ -565,4 +565,9 @@ inline clstring* dont_pass0toDEFINE_string(char *stringspot, #endif // SWIG + +// Import gflags library symbols into alternative/deprecated namespace(s) +#include "gflags_gflags.h" + + #endif // GFLAGS_GFLAGS_H_ diff --git a/extern/libmv/third_party/gflags/gflags/gflags_completions.h b/extern/libmv/third_party/gflags/gflags/gflags_completions.h index 2fa0db6d48a..f951c1e02d1 100644 --- a/extern/libmv/third_party/gflags/gflags/gflags_completions.h +++ b/extern/libmv/third_party/gflags/gflags/gflags_completions.h @@ -112,7 +112,7 @@ $ complete -o bashdefault -o default -o nospace -C \ #ifndef GFLAGS_COMPLETIONS_H_ #define GFLAGS_COMPLETIONS_H_ -namespace gflags { +namespace google { extern void HandleCommandLineCompletions(void); diff --git a/extern/libmv/third_party/gflags/gflags/gflags_declare.h b/extern/libmv/third_party/gflags/gflags/gflags_declare.h index 335c389b610..9b85f46cfdc 100644 --- a/extern/libmv/third_party/gflags/gflags/gflags_declare.h +++ b/extern/libmv/third_party/gflags/gflags/gflags_declare.h @@ -37,12 +37,17 @@ #ifndef GFLAGS_DECLARE_H_ #define GFLAGS_DECLARE_H_ + +// --------------------------------------------------------------------------- +// Namespace of gflags library symbols. +#define GFLAGS_NAMESPACE google + // --------------------------------------------------------------------------- // Windows DLL import/export. // We always want to import the symbols of the gflags library #ifndef GFLAGS_DLL_DECL -# if 0 && defined(_MSC_VER) +# if 1 && defined(_MSC_VER) # define GFLAGS_DLL_DECL __declspec(dllimport) # else # define GFLAGS_DLL_DECL @@ -51,7 +56,7 @@ // We always want to import variables declared in user code #ifndef GFLAGS_DLL_DECLARE_FLAG -# if 0 && defined(_MSC_VER) +# ifdef _MSC_VER # define GFLAGS_DLL_DECLARE_FLAG __declspec(dllimport) # else # define GFLAGS_DLL_DECLARE_FLAG @@ -69,7 +74,7 @@ # include // a third place for uint32_t or u_int32_t #endif -namespace gflags { +namespace GFLAGS_NAMESPACE { #if 1 // C99 typedef int32_t int32; @@ -90,7 +95,7 @@ typedef unsigned __int64 uint64; # error Do not know how to define a 32-bit integer quantity on your system #endif -} // namespace gflags +} // namespace GFLAGS_NAMESPACE namespace fLS { @@ -113,13 +118,13 @@ typedef std::string clstring; DECLARE_VARIABLE(bool, B, name) #define DECLARE_int32(name) \ - DECLARE_VARIABLE(::gflags::int32, I, name) + DECLARE_VARIABLE(::GFLAGS_NAMESPACE::int32, I, name) #define DECLARE_int64(name) \ - DECLARE_VARIABLE(::gflags::int64, I64, name) + DECLARE_VARIABLE(::GFLAGS_NAMESPACE::int64, I64, name) #define DECLARE_uint64(name) \ - DECLARE_VARIABLE(::gflags::uint64, U64, name) + DECLARE_VARIABLE(::GFLAGS_NAMESPACE::uint64, U64, name) #define DECLARE_double(name) \ DECLARE_VARIABLE(double, D, name) diff --git a/extern/libmv/third_party/gflags/gflags/gflags_gflags.h b/extern/libmv/third_party/gflags/gflags/gflags_gflags.h new file mode 100644 index 00000000000..0c17825dd62 --- /dev/null +++ b/extern/libmv/third_party/gflags/gflags/gflags_gflags.h @@ -0,0 +1,101 @@ +// Copyright (c) 2014, Andreas Schuh +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// ----------------------------------------------------------------------------- +// Imports the gflags library symbols into an alternative/deprecated namespace. + +#ifndef GFLAGS_GFLAGS_H_ +# error The internal header gflags_gflags.h may only be included by gflags.h +#endif + +#ifndef GFLAGS_NS_GFLAGS_H_ +#define GFLAGS_NS_GFLAGS_H_ + + +namespace gflags { + + +using GFLAGS_NAMESPACE::int32; +using GFLAGS_NAMESPACE::uint32; +using GFLAGS_NAMESPACE::int64; +using GFLAGS_NAMESPACE::uint64; + +using GFLAGS_NAMESPACE::RegisterFlagValidator; +using GFLAGS_NAMESPACE::CommandLineFlagInfo; +using GFLAGS_NAMESPACE::GetAllFlags; +using GFLAGS_NAMESPACE::ShowUsageWithFlags; +using GFLAGS_NAMESPACE::ShowUsageWithFlagsRestrict; +using GFLAGS_NAMESPACE::DescribeOneFlag; +using GFLAGS_NAMESPACE::SetArgv; +using GFLAGS_NAMESPACE::GetArgvs; +using GFLAGS_NAMESPACE::GetArgv; +using GFLAGS_NAMESPACE::GetArgv0; +using GFLAGS_NAMESPACE::GetArgvSum; +using GFLAGS_NAMESPACE::ProgramInvocationName; +using GFLAGS_NAMESPACE::ProgramInvocationShortName; +using GFLAGS_NAMESPACE::ProgramUsage; +using GFLAGS_NAMESPACE::VersionString; +using GFLAGS_NAMESPACE::GetCommandLineOption; +using GFLAGS_NAMESPACE::GetCommandLineFlagInfo; +using GFLAGS_NAMESPACE::GetCommandLineFlagInfoOrDie; +using GFLAGS_NAMESPACE::FlagSettingMode; +using GFLAGS_NAMESPACE::SET_FLAGS_VALUE; +using GFLAGS_NAMESPACE::SET_FLAG_IF_DEFAULT; +using GFLAGS_NAMESPACE::SET_FLAGS_DEFAULT; +using GFLAGS_NAMESPACE::SetCommandLineOption; +using GFLAGS_NAMESPACE::SetCommandLineOptionWithMode; +using GFLAGS_NAMESPACE::FlagSaver; +using GFLAGS_NAMESPACE::CommandlineFlagsIntoString; +using GFLAGS_NAMESPACE::ReadFlagsFromString; +using GFLAGS_NAMESPACE::AppendFlagsIntoFile; +using GFLAGS_NAMESPACE::ReadFromFlagsFile; +using GFLAGS_NAMESPACE::BoolFromEnv; +using GFLAGS_NAMESPACE::Int32FromEnv; +using GFLAGS_NAMESPACE::Int64FromEnv; +using GFLAGS_NAMESPACE::Uint64FromEnv; +using GFLAGS_NAMESPACE::DoubleFromEnv; +using GFLAGS_NAMESPACE::StringFromEnv; +using GFLAGS_NAMESPACE::SetUsageMessage; +using GFLAGS_NAMESPACE::SetVersionString; +using GFLAGS_NAMESPACE::ParseCommandLineNonHelpFlags; +using GFLAGS_NAMESPACE::HandleCommandLineHelpFlags; +using GFLAGS_NAMESPACE::AllowCommandLineReparsing; +using GFLAGS_NAMESPACE::ReparseCommandLineNonHelpFlags; +using GFLAGS_NAMESPACE::ShutDownCommandLineFlags; +using GFLAGS_NAMESPACE::FlagRegisterer; + +#ifndef SWIG +using GFLAGS_NAMESPACE::ParseCommandLineFlags; +#endif + + +} // namespace gflags + + +#endif // GFLAGS_NS_GFLAGS_H_ diff --git a/extern/libmv/third_party/gflags/gflags_completions.cc b/extern/libmv/third_party/gflags/gflags_completions.cc index 3a476230ff9..d7097caeef7 100644 --- a/extern/libmv/third_party/gflags/gflags_completions.cc +++ b/extern/libmv/third_party/gflags/gflags_completions.cc @@ -47,6 +47,8 @@ // 5b) Trim most flag's descriptions to fit on a single terminal line +#include "gflags_completions.h" + #include "config.h" #include diff --git a/extern/libmv/third_party/gflags/mutex.h b/extern/libmv/third_party/gflags/mutex.h index 0bdd9d5f2a5..ff96f2b67f7 100644 --- a/extern/libmv/third_party/gflags/mutex.h +++ b/extern/libmv/third_party/gflags/mutex.h @@ -344,8 +344,5 @@ class WriterMutexLock { } // namespace MUTEX_NAMESPACE -using namespace MUTEX_NAMESPACE; - -#undef MUTEX_NAMESPACE #endif /* #define GFLAGS_MUTEX_H__ */ diff --git a/extern/libmv/third_party/gflags/util.h b/extern/libmv/third_party/gflags/util.h index 366e1be22e2..fb59b38ddc4 100644 --- a/extern/libmv/third_party/gflags/util.h +++ b/extern/libmv/third_party/gflags/util.h @@ -88,9 +88,10 @@ typedef unsigned char uint8; // -- utility macros --------------------------------------------------------- -template struct CompileAssert {}; +template struct CompileAssert; +template <> struct CompileAssert {}; #define COMPILE_ASSERT(expr, msg) \ - typedef CompileAssert<(bool(expr))> msg[bool(expr) ? 1 : -1] + enum { assert_##msg = sizeof(CompileAssert) } // Returns the number of elements in an array. #define arraysize(arr) (sizeof(arr)/sizeof(*(arr))) diff --git a/extern/libmv/third_party/gflags/windows_port.cc b/extern/libmv/third_party/gflags/windows_port.cc index b1a0f1929a1..b5b7194c9a4 100644 --- a/extern/libmv/third_party/gflags/windows_port.cc +++ b/extern/libmv/third_party/gflags/windows_port.cc @@ -43,7 +43,8 @@ #include "windows_port.h" // These call the windows _vsnprintf, but always NUL-terminate. -#if !defined(__MINGW32__) && !defined(__MINGW64__) && !(defined(_MSC_VER) && _MSC_VER >= 1900) /* mingw already defines */ +#if !defined(__MINGW32__) && !defined(__MINGW64__) /* mingw already defines */ +#if !(defined(_MSC_VER) && _MSC_VER >= 1900) /* msvc 2015 already defines */ #ifdef _MSC_VER # pragma warning(push) @@ -68,4 +69,5 @@ int snprintf(char *str, size_t size, const char *format, ...) { return r; } -#endif /* #if !defined(__MINGW32__) && !defined(__MINGW64__) && !(defined(_MSC_VER) && _MSC_VER >= 1900) */ +#endif /* if !(defined(_MSC_VER) && _MSC_VER >= 1900) */ +#endif /* #if !defined(__MINGW32__) && !defined(__MINGW64__) */ diff --git a/extern/libmv/third_party/gflags/windows_port.h b/extern/libmv/third_party/gflags/windows_port.h index 3ccd4f28d85..8b870ecb138 100644 --- a/extern/libmv/third_party/gflags/windows_port.h +++ b/extern/libmv/third_party/gflags/windows_port.h @@ -62,13 +62,15 @@ * because they don't always NUL-terminate. :-( We also can't use the * name vsnprintf, since windows defines that (but not snprintf (!)). */ -#if !defined(__MINGW32__) && !defined(__MINGW64__) && !(_MSC_VER >= 1900) /* mingw already defines */ +#if !defined(__MINGW32__) && !defined(__MINGW64__) /* mingw already defines */ +#if !(defined(_MSC_VER) && _MSC_VER >= 1900) /* msvc 2015 already defines */ extern GFLAGS_DLL_DECL int snprintf(char *str, size_t size, const char *format, ...); extern int GFLAGS_DLL_DECL safe_vsnprintf(char *str, size_t size, const char *format, va_list ap); #define vsnprintf(str, size, format, ap) safe_vsnprintf(str, size, format, ap) #define va_copy(dst, src) (dst) = (src) +#endif #endif /* #if !defined(__MINGW32__) && !defined(__MINGW64__) */ #ifdef _MSC_VER @@ -107,7 +109,7 @@ inline void setenv(const char* name, const char* value, int) { #define unlink _unlink #endif -#if !(_MSC_VER >= 1900) +#if !(defined(_MSC_VER) && _MSC_VER >= 1900) #define PRId32 "d" #define PRIu32 "u" #define PRId64 "I64d" diff --git a/extern/libmv/third_party/glog/src/logging.cc b/extern/libmv/third_party/glog/src/logging.cc index d700a0bf770..6552f46efdd 100644 --- a/extern/libmv/third_party/glog/src/logging.cc +++ b/extern/libmv/third_party/glog/src/logging.cc @@ -1677,7 +1677,8 @@ void LogToStderr() { namespace base { namespace internal { -static bool GetExitOnDFatal() { +bool GetExitOnDFatal(); +bool GetExitOnDFatal() { MutexLock l(&log_mutex); return exit_on_dfatal; } @@ -1692,7 +1693,8 @@ static bool GetExitOnDFatal() { // and the stack trace is not recorded. The LOG(FATAL) *will* still // exit the program. Since this function is used only in testing, // these differences are acceptable. -static void SetExitOnDFatal(bool value) { +void SetExitOnDFatal(bool value); +void SetExitOnDFatal(bool value) { MutexLock l(&log_mutex); exit_on_dfatal = value; } -- cgit v1.2.3