Use #ifdef instead of #if for EXV_HAVE_REGEX

This commit is contained in:
Luis Diaz Mas
2017-08-08 22:15:17 +02:00
parent 7cf676efbb
commit 22efdffd1d
4 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -49,7 +49,7 @@
*/
typedef std::vector<std::regex> exv_grep_keys_t ;
#else
# if EXV_HAVE_REGEX
# ifdef EXV_HAVE_REGEX
# include <regex.h>
/*!
@brief exv_grep_keys_t is a vector of keys to match to strings
+1 -1
View File
@@ -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_);
+1 -1
View File
@@ -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);
+1 -1
View File
@@ -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)
);