From 35d8aa5fa7b8a1a60d6451c9ceb354d08da8c3af Mon Sep 17 00:00:00 2001 From: Andrey Prygunkov Date: Mon, 28 Aug 2017 21:06:45 +0200 Subject: [PATCH] #435: fixed compiling error if no regex.h --- daemon/main/nzbget.h | 2 ++ daemon/queue/QueueEditor.cpp | 2 +- daemon/remote/BinRpc.cpp | 2 +- daemon/util/Util.cpp | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/daemon/main/nzbget.h b/daemon/main/nzbget.h index 71c62642..f15afab0 100644 --- a/daemon/main/nzbget.h +++ b/daemon/main/nzbget.h @@ -69,7 +69,9 @@ compiled */ #define SOCKLEN_T socklen_t /* Define to 1 if you have the header file. */ +#ifndef DISABLE_REGEX #define HAVE_REGEX_H 1 +#endif /* Suppress warnings */ #define _CRT_SECURE_NO_DEPRECATE diff --git a/daemon/queue/QueueEditor.cpp b/daemon/queue/QueueEditor.cpp index add81f33..8dc070d8 100644 --- a/daemon/queue/QueueEditor.cpp +++ b/daemon/queue/QueueEditor.cpp @@ -650,7 +650,7 @@ void QueueEditor::PrepareList(ItemList* itemList, IdList* idList, bool QueueEditor::BuildIdListFromNameList(IdList* idList, NameList* nameList, DownloadQueue::EMatchMode matchMode, DownloadQueue::EEditAction action) { #ifndef HAVE_REGEX_H - if (matchMode == mmRegEx) + if (matchMode == DownloadQueue::mmRegEx) { return false; } diff --git a/daemon/remote/BinRpc.cpp b/daemon/remote/BinRpc.cpp index cc8a1e0b..7bcac4e9 100644 --- a/daemon/remote/BinRpc.cpp +++ b/daemon/remote/BinRpc.cpp @@ -871,7 +871,7 @@ void EditQueueBinCommand::Execute() else { #ifndef HAVE_REGEX_H - if ((QueueEditor::EMatchMode)matchMode == QueueEditor::mmRegEx) + if ((DownloadQueue::EMatchMode)matchMode == DownloadQueue::mmRegEx) { SendBoolResponse(false, "Edit-Command failed: the program was compiled without RegEx-support"); return; diff --git a/daemon/util/Util.cpp b/daemon/util/Util.cpp index 75a10799..ec0e94e4 100644 --- a/daemon/util/Util.cpp +++ b/daemon/util/Util.cpp @@ -1687,7 +1687,7 @@ int RegEx::GetMatchStart(int index) #ifdef HAVE_REGEX_H return m_matches[index].rm_so; #else - return nullptr; + return 0; #endif }