cmCursesStandardIncludes.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*============================================================================
  2. CMake - Cross Platform Makefile Generator
  3. Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
  4. Distributed under the OSI-approved BSD License (the "License");
  5. see accompanying file Copyright.txt for details.
  6. This software is distributed WITHOUT ANY WARRANTY; without even the
  7. implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  8. See the License for more information.
  9. ============================================================================*/
  10. #ifndef cmCursesStandardIncludes_h
  11. #define cmCursesStandardIncludes_h
  12. #if defined(__sun__) && defined(__GNUC__)
  13. #define _MSE_INT_H
  14. #endif
  15. #if defined(__hpux)
  16. # define _BOOL_DEFINED
  17. # include <sys/time.h>
  18. #endif
  19. #include <form.h>
  20. // This is a hack to prevent warnings about these functions being
  21. // declared but not referenced.
  22. #if defined(__sgi) && !defined(__GNUC__)
  23. class cmCursesStandardIncludesHack
  24. {
  25. public:
  26. enum
  27. {
  28. Ref1 = sizeof(cfgetospeed(0)),
  29. Ref2 = sizeof(cfgetispeed(0)),
  30. Ref3 = sizeof(tcgetattr(0, 0)),
  31. Ref4 = sizeof(tcsetattr(0, 0, 0)),
  32. Ref5 = sizeof(cfsetospeed(0,0)),
  33. Ref6 = sizeof(cfsetispeed(0,0))
  34. };
  35. };
  36. #endif
  37. // on some machines move erase and clear conflict with stl
  38. // so remove them from the namespace
  39. inline void curses_move(unsigned int x, unsigned int y)
  40. {
  41. move(x,y);
  42. }
  43. inline void curses_clear()
  44. {
  45. erase();
  46. clearok(stdscr, TRUE);
  47. }
  48. #undef move
  49. #undef erase
  50. #undef clear
  51. #endif // cmCursesStandardIncludes_h