cmCursesStandardIncludes.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /*=========================================================================
  2. Program: CMake - Cross-Platform Makefile Generator
  3. Module: $RCSfile$
  4. Language: C++
  5. Date: $Date$
  6. Version: $Revision$
  7. Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
  8. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
  9. This software is distributed WITHOUT ANY WARRANTY; without even
  10. the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  11. PURPOSE. See the above copyright notices for more information.
  12. =========================================================================*/
  13. #ifndef cmCursesStandardIncludes_h
  14. #define cmCursesStandardIncludes_h
  15. #if defined(__sun__) && defined(__GNUC__)
  16. #define _MSE_INT_H
  17. #endif
  18. #if defined(__hpux)
  19. # define _BOOL_DEFINED
  20. # include <sys/time.h>
  21. # define _XOPEN_SOURCE_EXTENDED
  22. # include <curses.h>
  23. # include <form.h>
  24. # undef _XOPEN_SOURCE_EXTENDED
  25. #else
  26. # include <curses.h>
  27. # include <form.h>
  28. #endif
  29. // This is a hack to prevent warnings about these functions being
  30. // declared but not referenced.
  31. #if defined(__sgi) && !defined(__GNUC__)
  32. class cmCursesStandardIncludesHack
  33. {
  34. public:
  35. enum
  36. {
  37. Ref1 = sizeof(cfgetospeed(0)),
  38. Ref2 = sizeof(cfgetispeed(0)),
  39. Ref3 = sizeof(tcgetattr(0, 0)),
  40. Ref4 = sizeof(tcsetattr(0, 0, 0)),
  41. Ref5 = sizeof(cfsetospeed(0,0)),
  42. Ref6 = sizeof(cfsetispeed(0,0))
  43. };
  44. };
  45. #endif
  46. #ifndef getmaxyx
  47. #define getmaxyx(w,y,x) ((y) = getmaxy(w), (x) = getmaxx(w))
  48. #endif
  49. // on some machines move erase and clear conflict with stl
  50. // so remove them from the namespace
  51. inline void curses_move(unsigned int x, unsigned int y)
  52. {
  53. move(x,y);
  54. }
  55. inline void curses_clear()
  56. {
  57. erase();
  58. clearok(stdscr, TRUE);
  59. }
  60. #undef move
  61. #undef erase
  62. #undef clear
  63. #endif // cmCursesStandardIncludes_h