Merge branch 'master' of https://github.com/ChaiScript/ChaiScript
This commit is contained in:
commit
9c35ede59a
36
src/main.cpp
36
src/main.cpp
@ -15,6 +15,21 @@
|
||||
#include <readline/readline.h>
|
||||
#include <readline/history.h>
|
||||
#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)())
|
||||
{
|
||||
@ -31,9 +46,9 @@ void *cast_module_symbol(std::string (*t_path)())
|
||||
|
||||
std::string default_search_path()
|
||||
{
|
||||
#ifdef CHAISCRIPT_WINDOWS
|
||||
TCHAR path[2048];
|
||||
int size = GetModuleFileName(0, path, sizeof(path)-1);
|
||||
#ifdef CHAISCRIPT_WINDOWS // force no unicode
|
||||
CHAR path[4096];
|
||||
int size = GetModuleFileNameA(0, path, sizeof(path)-1);
|
||||
|
||||
std::string exepath(path, size);
|
||||
|
||||
@ -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) {
|
||||
if ( n >= 0 ) {
|
||||
std::cout << "ChaiScript evaluator. To evaluate an expression, type it and press <enter>." << std::endl;
|
||||
|
Loading…
x
Reference in New Issue
Block a user