| | 1 | /* This file includes the curses header file. It's either <curses.h> |
| | 2 | * or <ncurses.h>; whatever is available on the system. |
| | 3 | * |
| | 4 | * Everything in the included header is made extern "C" when compiling |
| | 5 | * for C++. Normally, recent curses versions already have extern "C" |
| | 6 | * blocks in them. However, we provide our own for older versions that |
| | 7 | * might lack these blocks. It doesn't hurt when such a block is |
| | 8 | * specified twice. |
| | 9 | * |
| | 10 | * There's a potential problem when including a non C++-aware curses |
| | 11 | * header; some versions of curses define a 'bool' type. This can cause |
| | 12 | * errors when compiling in C++. Therefore, we undefine this symbol |
| | 13 | * when in C++. This won't work if 'bool' is typedef'ed though. |
| | 14 | * |
| | 15 | * Some curses versions define a clear() macro. This would cause some |
| | 16 | * files in tads2/ and tads3/ to fail to compile. Therefore, we #undef |
| | 17 | * this macro is it exists. |
| | 18 | */ |
| | 19 | #ifndef FROBCURSES_H |
| | 20 | #define FROBCURSES_H |
| | 21 | |
| | 22 | #include "common.h" |
| | 23 | |
| | 24 | #ifdef __cplusplus |
| | 25 | extern "C" { |
| | 26 | #endif |
| | 27 | |
| | 28 | #ifdef HAVE_NCURSES_H |
| | 29 | #include <ncurses.h> |
| | 30 | #endif |
| | 31 | |
| | 32 | #ifdef HAVE_CURSES_H |
| | 33 | #include <curses.h> |
| | 34 | #endif |
| | 35 | |
| | 36 | /* The TADS base code spits fire if 'clear' is defined as a macro. |
| | 37 | */ |
| | 38 | #ifdef clear |
| | 39 | #undef clear |
| | 40 | #endif |
| | 41 | |
| | 42 | #ifdef __cplusplus |
| | 43 | } |
| | 44 | // C++ has its own 'bool' type. |
| | 45 | #ifdef bool |
| | 46 | #undef bool |
| | 47 | #endif |
| | 48 | #endif |
| | 49 | |
| | 50 | #endif // FROBCURSES_H |