|
13 | 13 | #include "swift/Immediate/Immediate.h" |
14 | 14 | #include "ImmediateImpl.h" |
15 | 15 |
|
| 16 | +#include "swift/Config.h" |
16 | 17 | #include "swift/Subsystems.h" |
17 | 18 | #include "swift/AST/ASTContext.h" |
18 | 19 | #include "swift/AST/DiagnosticsFrontend.h" |
|
34 | 35 | #include "llvm/Support/PrettyStackTrace.h" |
35 | 36 | #include "llvm/Support/Process.h" |
36 | 37 |
|
37 | | -#if defined(__APPLE__) || defined(__FreeBSD__) |
38 | | -// FIXME: Support REPL on non-Apple platforms. Ubuntu 14.10's editline does not |
39 | | -// include the wide character entry points needed by the REPL yet. |
| 38 | +#if HAVE_UNICODE_LIBEDIT |
40 | 39 | #include <histedit.h> |
41 | | -#endif // __APPLE__ |
| 40 | +#endif |
42 | 41 |
|
43 | 42 | using namespace swift; |
44 | 43 | using namespace swift::immediate; |
@@ -131,7 +130,7 @@ class ConvertForWcharSize<4> { |
131 | 130 |
|
132 | 131 | using Convert = ConvertForWcharSize<sizeof(wchar_t)>; |
133 | 132 |
|
134 | | -#if defined(__APPLE__) || defined(__FreeBSD__) |
| 133 | +#if HAVE_UNICODE_LIBEDIT |
135 | 134 | static void convertFromUTF8(llvm::StringRef utf8, |
136 | 135 | llvm::SmallVectorImpl<wchar_t> &out) { |
137 | 136 | size_t reserve = out.size() + utf8.size(); |
@@ -163,7 +162,7 @@ static void convertToUTF8(llvm::ArrayRef<wchar_t> wide, |
163 | 162 |
|
164 | 163 | } // end anonymous namespace |
165 | 164 |
|
166 | | -#if defined(__APPLE__) || defined(__FreeBSD__) |
| 165 | +#if HAVE_UNICODE_LIBEDIT |
167 | 166 |
|
168 | 167 | static bool appendToREPLFile(SourceFile &SF, |
169 | 168 | PersistentParserState &PersistentState, |
@@ -1182,7 +1181,7 @@ void swift::runREPL(CompilerInstance &CI, const ProcessCmdLine &CmdLine, |
1182 | 1181 | } while (env.handleREPLInput(inputKind, Line)); |
1183 | 1182 | } |
1184 | 1183 |
|
1185 | | -#else // __APPLE__ |
| 1184 | +#else |
1186 | 1185 |
|
1187 | 1186 | void swift::runREPL(CompilerInstance &CI, const ProcessCmdLine &CmdLine, |
1188 | 1187 | bool ParseStdlib) { |
|
0 commit comments