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:
25
src/main.cpp
25
src/main.cpp
@@ -23,6 +23,18 @@ char *mystrdup (const char *s) {
|
|||||||
return d; // Return the new string
|
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)())
|
void *cast_module_symbol(std::string (*t_path)())
|
||||||
{
|
{
|
||||||
union cast_union
|
union cast_union
|
||||||
@@ -101,19 +113,6 @@ std::string default_search_path()
|
|||||||
#endif
|
#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) {
|
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;
|
||||||
|
Reference in New Issue
Block a user