gdb_curses.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /* Portable <curses.h>.
  2. Copyright (C) 2004-2022 Free Software Foundation, Inc.
  3. This file is part of GDB.
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 3 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program. If not, see <http://www.gnu.org/licenses/>. */
  14. #ifndef GDB_CURSES_H
  15. #define GDB_CURSES_H 1
  16. #ifdef __MINGW32__
  17. /* Windows API headers, included e.g. by serial.h, define MOUSE_MOVED,
  18. and so does PDCurses's curses.h, but for an entirely different
  19. purpose. Since we don't use the Windows semantics of MOUSE_MOVED
  20. anywhere, avoid compiler warnings by undefining MOUSE_MOVED before
  21. including curses.h. */
  22. #undef MOUSE_MOVED
  23. /* Likewise, KEY_EVENT is defined by ncurses.h, but also by Windows
  24. API headers. */
  25. #undef KEY_EVENT
  26. #endif
  27. /* On Solaris and probably other SysVr4 derived systems, we need to define
  28. NOMACROS so the native <curses.h> doesn't define clear which interferes
  29. with the clear member of class string_file. ncurses potentially has a
  30. similar problem and fix. */
  31. #define NOMACROS
  32. #define NCURSES_NOMACROS
  33. #if defined (HAVE_NCURSESW_NCURSES_H)
  34. #include <ncursesw/ncurses.h>
  35. #elif defined (HAVE_NCURSES_NCURSES_H)
  36. #include <ncurses/ncurses.h>
  37. #elif defined (HAVE_NCURSES_H)
  38. #include <ncurses.h>
  39. #elif defined (HAVE_CURSESX_H)
  40. #include <cursesX.h>
  41. #elif defined (HAVE_CURSES_H)
  42. #include <curses.h>
  43. #endif
  44. #if defined (HAVE_NCURSES_TERM_H)
  45. #include <ncurses/term.h>
  46. #elif defined (HAVE_TERM_H)
  47. #include <term.h>
  48. #else
  49. /* On MinGW, a real termcap library is usually not present. Stub versions
  50. of the termcap functions will be built from stub-termcap.c. Readline
  51. provides its own extern declarations when there's no termcap.h; do the
  52. same here for the termcap functions used in GDB. */
  53. EXTERN_C int tgetnum (const char *);
  54. #endif
  55. /* SunOS's curses.h has a '#define reg register' in it. Thank you Sun. */
  56. /* Ditto for:
  57. -bash-4.2$ uname -a
  58. AIX power-aix 1 7 00F84C0C4C00 */
  59. #ifdef reg
  60. #undef reg
  61. #endif
  62. #endif /* gdb_curses.h */