diff options
author | Andrew M. Kuchling <amk@amk.ca> | 2000-11-01 19:59:12 (GMT) |
---|---|---|
committer | Andrew M. Kuchling <amk@amk.ca> | 2000-11-01 19:59:12 (GMT) |
commit | e7d3616409a6d603966a4af7314b0c11a2d7c93e (patch) | |
tree | 2e86cf46cc6b21e456dc3c555b141bea6b9d6434 /Modules | |
parent | 19647ca3187b9734c2a87a5816240ac723a76d49 (diff) | |
download | cpython-e7d3616409a6d603966a4af7314b0c11a2d7c93e.zip cpython-e7d3616409a6d603966a4af7314b0c11a2d7c93e.tar.gz cpython-e7d3616409a6d603966a4af7314b0c11a2d7c93e.tar.bz2 |
Patch from Randall Hopper to fix PR #116172, "curses module fails to
build on SGI":
* Check for 'sgi' preprocessor symbol, not '__sgi__'
* Surround individual character macros with #ifdef's, instead of making them
all rely on STRICT_SYSV_CURSES
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/_cursesmodule.c | 42 |
1 files changed, 38 insertions, 4 deletions
diff --git a/Modules/_cursesmodule.c b/Modules/_cursesmodule.c index 1920ee0..12e2084 100644 --- a/Modules/_cursesmodule.c +++ b/Modules/_cursesmodule.c @@ -78,7 +78,15 @@ char *PyCursesVersion = "1.6"; #include <curses.h> #endif -#if defined(__sgi__) || defined(__sun__) +#ifdef sgi +/* This prototype is in <term.h>, but including this header #defines + many common symbols (such as "lines") which breaks the curses + module in other ways. So the code will just specify an explicit + prototype here. */ +extern char *tigetstr(char *); +#endif + +#if defined(sgi) || defined(__sun__) #define STRICT_SYSV_CURSES /* Don't use ncurses extensions */ typedef chtype attr_t; /* No attr_t type is available */ #endif @@ -1739,13 +1747,27 @@ PyCurses_InitScr(PyObject *self, PyObject *args) SetDictInt("ACS_BSBS", (ACS_HLINE)); SetDictInt("ACS_SBSB", (ACS_VLINE)); SetDictInt("ACS_SSSS", (ACS_PLUS)); -#ifndef STRICT_SYSV_CURSES - /* The following are never available with strict SYSV curses */ + + /* The following are never available with strict SYSV curses */ +#ifdef ACS_S3 SetDictInt("ACS_S3", (ACS_S3)); +#endif +#ifdef ACS_S7 + SetDictInt("ACS_S7", (ACS_S7)); +#endif +#ifdef ACS_LEQUAL SetDictInt("ACS_LEQUAL", (ACS_LEQUAL)); +#endif +#ifdef ACS_GEQUAL SetDictInt("ACS_GEQUAL", (ACS_GEQUAL)); +#endif +#ifdef ACS_PI SetDictInt("ACS_PI", (ACS_PI)); +#endif +#ifdef ACS_NEQUAL SetDictInt("ACS_NEQUAL", (ACS_NEQUAL)); +#endif +#ifdef ACS_STERLING SetDictInt("ACS_STERLING", (ACS_STERLING)); #endif @@ -2270,12 +2292,24 @@ init_curses(void) SetDictInt("A_PROTECT", A_PROTECT); SetDictInt("A_CHARTEXT", A_CHARTEXT); SetDictInt("A_COLOR", A_COLOR); -#ifndef STRICT_SYSV_CURSES + + /* The following are never available with strict SYSV curses */ +#ifdef A_HORIZONTAL SetDictInt("A_HORIZONTAL", A_HORIZONTAL); +#endif +#ifdef A_LEFT SetDictInt("A_LEFT", A_LEFT); +#endif +#ifdef A_LOW SetDictInt("A_LOW", A_LOW); +#endif +#ifdef A_RIGHT SetDictInt("A_RIGHT", A_RIGHT); +#endif +#ifdef A_TOP SetDictInt("A_TOP", A_TOP); +#endif +#ifdef A_VERTICAL SetDictInt("A_VERTICAL", A_VERTICAL); #endif |