From 363097e9c366bb9c311f0fcc418aec35e6960ab0 Mon Sep 17 00:00:00 2001 From: Philipp Hasper Date: Wed, 10 May 2017 22:04:44 +0200 Subject: [PATCH] sfm: Fixed build for MSVC: snprintf only in VS2015 and above --- modules/sfm/src/libmv_light/libmv/logging/logging.h | 5 +++++ .../sfm/src/libmv_light/libmv/simple_pipeline/pipeline.cc | 4 ---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/modules/sfm/src/libmv_light/libmv/logging/logging.h b/modules/sfm/src/libmv_light/libmv/logging/logging.h index 776d9d52f7..fa091c0acc 100644 --- a/modules/sfm/src/libmv_light/libmv/logging/logging.h +++ b/modules/sfm/src/libmv_light/libmv/logging/logging.h @@ -23,6 +23,11 @@ #include + +#if defined _MSC_VER && _MSC_VER < 1900 +# define snprintf _snprintf +#endif + #define LG LOG(INFO) #define V0 LOG(INFO) #define V1 LOG(INFO) diff --git a/modules/sfm/src/libmv_light/libmv/simple_pipeline/pipeline.cc b/modules/sfm/src/libmv_light/libmv/simple_pipeline/pipeline.cc index 6c8592baa0..29b0edda4e 100644 --- a/modules/sfm/src/libmv_light/libmv/simple_pipeline/pipeline.cc +++ b/modules/sfm/src/libmv_light/libmv/simple_pipeline/pipeline.cc @@ -30,10 +30,6 @@ #include "libmv/simple_pipeline/tracks.h" #include "libmv/simple_pipeline/camera_intrinsics.h" -#ifdef _MSC_VER -# define snprintf _snprintf -#endif - namespace libmv { namespace {