Porting: HAS_READLINE

This commit is contained in:
Hrvoje Jasak 2019-04-25 11:05:46 +01:00
parent dbd98e7297
commit 4da7aeee5e

View file

@ -46,7 +46,7 @@ Description
#include <stdio.h> #include <stdio.h>
#if READLINE != 0 #if HAS_READLINE
#include <readline/readline.h> #include <readline/readline.h>
#include <readline/history.h> #include <readline/history.h>
#endif #endif
@ -56,7 +56,7 @@ using namespace Foam;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#if READLINE != 0 #if HAS_READLINE
static const char* historyFile = ".setSet"; static const char* historyFile = ".setSet";
#endif #endif
@ -785,7 +785,7 @@ int main(int argc, char *argv[])
fileStreamPtr = new std::ifstream(batchFile.c_str()); fileStreamPtr = new std::ifstream(batchFile.c_str());
} }
#if READLINE != 0 #if HAS_READLINE
else if (!read_history(historyFile)) else if (!read_history(historyFile))
{ {
Info<< "Successfully read history from " << historyFile << endl; Info<< "Successfully read history from " << historyFile << endl;
@ -829,7 +829,7 @@ int main(int argc, char *argv[])
} }
else else
{ {
# if READLINE != 0 # if HAS_READLINE
{ {
char* linePtr = readline("readline>"); char* linePtr = readline("readline>");