Index: cmake/modules/LLDBGenerateConfig.cmake =================================================================== --- cmake/modules/LLDBGenerateConfig.cmake +++ cmake/modules/LLDBGenerateConfig.cmake @@ -33,6 +33,16 @@ set(LLDB_DISABLE_POSIX 1) endif() +if (NOT LLDB_DISABLE_LIBEDIT) + # Check if we libedit capable of handling wide characters (built with + # '--enable-widec'). + set(CMAKE_REQUIRED_LIBRARIES ${libedit_LIBRARIES}) + set(CMAKE_REQUIRED_INCLUDES ${libedit_INCLUDE_DIRS}) + check_symbol_exists(el_winsertstr histedit.h LLDB_EDITLINE_USE_WCHAR) + set(CMAKE_REQUIRED_LIBRARIES) + set(CMAKE_REQUIRED_INCLUDES) +endif() + if(NOT LLDB_CONFIG_HEADER_INPUT) set(LLDB_CONFIG_HEADER_INPUT ${LLDB_INCLUDE_ROOT}/lldb/Host/Config.h.cmake) endif() Index: include/lldb/Host/Config.h =================================================================== --- include/lldb/Host/Config.h +++ include/lldb/Host/Config.h @@ -16,6 +16,8 @@ // absence of a configuration step. #define LLDB_CONFIG_TERMIOS_SUPPORTED 1 +#define LLDB_EDITLINE_USE_WCHAR 1 + #define HAVE_SYS_EVENT_H 1 #define HAVE_PPOLL 0 Index: include/lldb/Host/Config.h.cmake =================================================================== --- include/lldb/Host/Config.h.cmake +++ include/lldb/Host/Config.h.cmake @@ -12,6 +12,8 @@ #cmakedefine LLDB_CONFIG_TERMIOS_SUPPORTED +#cmakedefine01 LLDB_EDITLINE_USE_WCHAR + #cmakedefine LLDB_DISABLE_POSIX #define LLDB_LIBDIR_SUFFIX "${LLVM_LIBDIR_SUFFIX}" Index: include/lldb/Host/Editline.h =================================================================== --- include/lldb/Host/Editline.h +++ include/lldb/Host/Editline.h @@ -33,23 +33,11 @@ #define liblldb_Editline_h_ #if defined(__cplusplus) +#include #include #include #include -// components needed to handle wide characters ( , codecvt_utf8, -// libedit built with '--enable-widec' ) are available on some platforms. The -// wchar_t versions of libedit functions will only be used in cases where this -// is true. This is a compile time dependecy, for now selected per target -// Platform -#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__) || \ - defined(__OpenBSD__) -#define LLDB_EDITLINE_USE_WCHAR 1 -#include -#else -#define LLDB_EDITLINE_USE_WCHAR 0 -#endif - #include "lldb/Host/ConnectionFileDescriptor.h" #include "lldb/lldb-private.h"