Github user phrocker commented on the issue:
https://github.com/apache/nifi-minifi-cpp/pull/88
@apiri The logic can be improved @jdye64 I'm in favor of removing the
conditional expression entirely and using the c style for all versions since
that will work. There's no point in using the C++ regex matching since it won't
be available for all builds. If you really want to maintain it, you can do this:
```
diff --git a/libminifi/src/processors/GetFile.cpp
b/libminifi/src/processors/GetFile.cpp
index 2740793..9988029 100644
--- a/libminifi/src/processors/GetFile.cpp
+++ b/libminifi/src/processors/GetFile.cpp
@@ -24,8 +24,9 @@
#include <dirent.h>
#include <limits.h>
#include <unistd.h>
-#if (__GNUC__ >= 4)
-#if (__GNUC_MINOR__ < 9)
+// if an older version of gcc that doesn't support <regex>
+#ifdef __GNUC__
+#if (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 9))
#include <regex.h>
#else
#include <regex>
@@ -268,8 +269,7 @@ bool GetFile::acceptFile(std::string fullName,
std::string name,
return false;
#ifdef __GNUC__
-#if (__GNUC__ >= 4)
-#if (__GNUC_MINOR__ < 9)
+#if (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 9))
regex_t regex;
int ret = regcomp(®ex, request.fileFilter.c_str(), 0);
if (ret)
@@ -280,7 +280,7 @@ bool GetFile::acceptFile(std::string fullName,
std::string name,
return false;
#else
try {
- std::regex re(fileFilter);
+ std::regex re(request.fileFilter);
if (!std::regex_match(name, re)) {
return false;
@@ -290,7 +290,6 @@ bool GetFile::acceptFile(std::string fullName,
std::string name,
return false;
}
#endif
-#endif
#else
logger_->log_info("Cannot support regex filtering");
#endif
```
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---