Use #ifdef instead of #if for EXV_HAVE_REGEX
This commit is contained in:
+1
-1
@@ -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
@@ -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
@@ -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)
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user