mirror of
https://github.com/ChaiScript/ChaiScript.git
synced 2025-12-06 16:57:04 +08:00
Merge pull request #96 from kanzure/fix-readline-build
Make main.cpp compile when readline is available
This commit is contained in:
commit
2a2a469a1b
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;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user