Fix build error on 4.x branch if readline is found
This commit is contained in:
parent
b872a50acc
commit
8724e0cb80
30
src/main.cpp
30
src/main.cpp
@ -15,6 +15,21 @@
|
|||||||
#include <readline/readline.h>
|
#include <readline/readline.h>
|
||||||
#include <readline/history.h>
|
#include <readline/history.h>
|
||||||
#else
|
#else
|
||||||
|
char* readline(const char* p)
|
||||||
|
{
|
||||||
|
std::string retval;
|
||||||
|
std::cout << p ;
|
||||||
|
std::getline(std::cin, retval);
|
||||||
|
#ifdef BOOST_MSVC
|
||||||
|
return std::cin.eof() ? NULL : _strdup(retval.c_str());
|
||||||
|
#else
|
||||||
|
return std::cin.eof() ? NULL : strdup(retval.c_str());
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
void add_history(const char*){}
|
||||||
|
void using_history(){}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
void *cast_module_symbol(std::string (*t_path)())
|
void *cast_module_symbol(std::string (*t_path)())
|
||||||
{
|
{
|
||||||
@ -95,21 +110,6 @@ std::string default_search_path()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
char* readline(const char* p)
|
|
||||||
{
|
|
||||||
std::string retval;
|
|
||||||
std::cout << p ;
|
|
||||||
std::getline(std::cin, retval);
|
|
||||||
#ifdef BOOST_MSVC
|
|
||||||
return std::cin.eof() ? NULL : _strdup(retval.c_str());
|
|
||||||
#else
|
|
||||||
return std::cin.eof() ? NULL : strdup(retval.c_str());
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
void add_history(const char*){}
|
|
||||||
void using_history(){}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void help(int n) {
|
void help(int n) {
|
||||||
if ( n >= 0 ) {
|
if ( n >= 0 ) {
|
||||||
std::cout << "ChaiScript evaluator. To evaluate an expression, type it and press <enter>." << std::endl;
|
std::cout << "ChaiScript evaluator. To evaluate an expression, type it and press <enter>." << std::endl;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user