fix building main.cpp when readline is available

This changes around the pragma conditionals to make sure that certain
symbols (such as "default_search_path") are defined even if the system
has readline available during builds.
This commit is contained in:
Bryan Bishop
2014-01-07 17:35:58 -06:00
parent 5272a64be9
commit ac21c8b063

View File

@@ -23,6 +23,18 @@ char *mystrdup (const char *s) {
return d; // Return the new string
}
char* readline(const char* p)
{
std::string retval;
std::cout << p ;
std::getline(std::cin, retval);
return std::cin.eof() ? NULL : mystrdup(retval.c_str());
}
void add_history(const char*){}
void using_history(){}
#endif
void *cast_module_symbol(std::string (*t_path)())
{
union cast_union
@@ -101,19 +113,6 @@ std::string default_search_path()
#endif
}
char* readline(const char* p)
{
std::string retval;
std::cout << p ;
std::getline(std::cin, retval);
return std::cin.eof() ? NULL : mystrdup(retval.c_str());
}
void add_history(const char*){}
void using_history(){}
#endif
void help(int n) {
if ( n >= 0 ) {
std::cout << "ChaiScript evaluator. To evaluate an expression, type it and press <enter>." << std::endl;