Permalink
Browse files

Fix build error on 4.x branch if readline is found

  • Loading branch information...
1 parent b872a50 commit 8724e0cb807a33867165e876c83f3a6a7f79c72f @lefticus lefticus committed Jan 23, 2014
Showing with 15 additions and 15 deletions.
  1. +15 −15 src/main.cpp
View
@@ -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)())
{
@@ -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;

0 comments on commit 8724e0c

Please sign in to comment.