cmCursesStandardIncludes.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. file Copyright.txt or https://cmake.org/licensing for details. */
  3. #ifndef cmCursesStandardIncludes_h
  4. #define cmCursesStandardIncludes_h
  5. #include "cmConfigure.h" // IWYU pragma: keep
  6. // Record whether __attribute__ is currently defined. See purpose below.
  7. #ifndef __attribute__
  8. # define cm_no__attribute__
  9. #endif
  10. #if defined(__hpux)
  11. # define _BOOL_DEFINED
  12. # include <sys/time.h>
  13. #endif
  14. #include <form.h>
  15. // on some machines move erase and clear conflict with stl
  16. // so remove them from the namespace
  17. inline void curses_move(unsigned int x, unsigned int y)
  18. {
  19. move(x, y);
  20. }
  21. inline void curses_clear()
  22. {
  23. erase();
  24. clearok(stdscr, TRUE);
  25. }
  26. #undef move
  27. #undef erase
  28. #undef clear
  29. // The curses headers on some platforms (e.g. Solaris) may
  30. // define __attribute__ as a macro. This breaks C++ headers
  31. // in some cases, so undefine it now.
  32. #if defined(cm_no__attribute__) && defined(__attribute__)
  33. # undef __attribute__
  34. #endif
  35. #undef cm_no__attribute__
  36. #endif // cmCursesStandardIncludes_h