llunak created this revision.
llunak added a reviewer: clayborg.
Herald added a subscriber: mgorny.
llunak requested review of this revision.

My openSUSE 15.2 has /usr/include/curses.h as a symlink to 
/usr/include/ncurses/curses.h , but there's no such symlink for panel.h . 
Prefer using /usr/include/ncurses for the includes if they are found there by 
the CMake check.


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D85219

Files:
  lldb/include/lldb/Host/Config.h.cmake
  lldb/source/Core/IOHandlerCursesGUI.cpp


Index: lldb/source/Core/IOHandlerCursesGUI.cpp
===================================================================
--- lldb/source/Core/IOHandlerCursesGUI.cpp
+++ lldb/source/Core/IOHandlerCursesGUI.cpp
@@ -10,9 +10,14 @@
 #include "lldb/Host/Config.h"
 
 #if LLDB_ENABLE_CURSES
+#if CURSES_HAVE_NCURSES_CURSES_H
+#include <ncurses/curses.h>
+#include <ncurses/panel.h>
+#else
 #include <curses.h>
 #include <panel.h>
 #endif
+#endif
 
 #if defined(__APPLE__)
 #include <deque>
Index: lldb/include/lldb/Host/Config.h.cmake
===================================================================
--- lldb/include/lldb/Host/Config.h.cmake
+++ lldb/include/lldb/Host/Config.h.cmake
@@ -38,6 +38,8 @@
 
 #cmakedefine01 LLDB_ENABLE_CURSES
 
+#cmakedefine01 CURSES_HAVE_NCURSES_CURSES_H
+
 #cmakedefine01 LLDB_ENABLE_LIBEDIT
 
 #cmakedefine01 LLDB_ENABLE_LIBXML2


Index: lldb/source/Core/IOHandlerCursesGUI.cpp
===================================================================
--- lldb/source/Core/IOHandlerCursesGUI.cpp
+++ lldb/source/Core/IOHandlerCursesGUI.cpp
@@ -10,9 +10,14 @@
 #include "lldb/Host/Config.h"
 
 #if LLDB_ENABLE_CURSES
+#if CURSES_HAVE_NCURSES_CURSES_H
+#include <ncurses/curses.h>
+#include <ncurses/panel.h>
+#else
 #include <curses.h>
 #include <panel.h>
 #endif
+#endif
 
 #if defined(__APPLE__)
 #include <deque>
Index: lldb/include/lldb/Host/Config.h.cmake
===================================================================
--- lldb/include/lldb/Host/Config.h.cmake
+++ lldb/include/lldb/Host/Config.h.cmake
@@ -38,6 +38,8 @@
 
 #cmakedefine01 LLDB_ENABLE_CURSES
 
+#cmakedefine01 CURSES_HAVE_NCURSES_CURSES_H
+
 #cmakedefine01 LLDB_ENABLE_LIBEDIT
 
 #cmakedefine01 LLDB_ENABLE_LIBXML2
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to