From 22efdffd1d182d02efb755c6c7d0878f185a4284 Mon Sep 17 00:00:00 2001 From: Luis Diaz Mas Date: Tue, 8 Aug 2017 22:15:17 +0200 Subject: [PATCH] Use #ifdef instead of #if for EXV_HAVE_REGEX --- include/exiv2/version.hpp | 2 +- src/actions.cpp | 2 +- src/exiv2.cpp | 2 +- src/version.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/exiv2/version.hpp b/include/exiv2/version.hpp index b141806e..1fa1ccba 100644 --- a/include/exiv2/version.hpp +++ b/include/exiv2/version.hpp @@ -49,7 +49,7 @@ */ typedef std::vector exv_grep_keys_t ; #else -# if EXV_HAVE_REGEX +# ifdef EXV_HAVE_REGEX # include /*! @brief exv_grep_keys_t is a vector of keys to match to strings diff --git a/src/actions.cpp b/src/actions.cpp index fd750ea8..62dd2e57 100644 --- a/src/actions.cpp +++ b/src/actions.cpp @@ -595,7 +595,7 @@ namespace Action { std::smatch m; result = std::regex_search(key,m, *g); #else -#if EXV_HAVE_REGEX +#ifdef EXV_HAVE_REGEX result = regexec( &(*g), key.c_str(), 0, NULL, 0) == 0 ; #else std::string Pattern(g->pattern_); diff --git a/src/exiv2.cpp b/src/exiv2.cpp index 2684475d..5dce3320 100644 --- a/src/exiv2.cpp +++ b/src/exiv2.cpp @@ -454,7 +454,7 @@ int Params::evalGrep( const std::string& optarg) #if __cplusplus >= CPLUSPLUS11 greps_.push_back( std::regex(pattern, bIgnoreCase ? std::regex::icase|std::regex::extended : std::regex::extended) ); #else -#if EXV_HAVE_REGEX +#ifdef EXV_HAVE_REGEX // try to compile a reg-exp from the input argument and store it in the vector const size_t i = greps_.size(); greps_.resize(i + 1); diff --git a/src/version.cpp b/src/version.cpp index 327a5273..fad201c5 100644 --- a/src/version.cpp +++ b/src/version.cpp @@ -177,7 +177,7 @@ static bool shouldOutput(const exv_grep_keys_t& greps,const char* key,const std: std::smatch m; bPrint = std::regex_search(Key,m,*g) || std::regex_search(value,m,*g); #else -#if EXV_HAVE_REGEX +#ifdef EXV_HAVE_REGEX bPrint = ( 0 == regexec( &(*g), key , 0, NULL, 0) || 0 == regexec( &(*g), value.c_str(), 0, NULL, 0) );