[Python-checkins] CVS: python/dist/src/Modules _cursesmodule.c,2.39,2.40
A.M. Kuchling
python-dev@python.org
Wed, 1 Nov 2000 11:59:15 -0800
Update of /cvsroot/python/python/dist/src/Modules
In directory slayer.i.sourceforge.net:/tmp/cvs-serv13420
Modified Files:
_cursesmodule.c
Log Message:
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
Index: _cursesmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/_cursesmodule.c,v
retrieving revision 2.39
retrieving revision 2.40
diff -C2 -r2.39 -r2.40
*** _cursesmodule.c 2000/09/01 03:46:16 2.39
--- _cursesmodule.c 2000/11/01 19:59:12 2.40
***************
*** 79,83 ****
#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 */
--- 79,91 ----
#endif
! #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 */
***************
*** 1740,1750 ****
SetDictInt("ACS_SBSB", (ACS_VLINE));
SetDictInt("ACS_SSSS", (ACS_PLUS));
! #ifndef STRICT_SYSV_CURSES
! /* The following are never available with strict SYSV curses */
SetDictInt("ACS_S3", (ACS_S3));
SetDictInt("ACS_LEQUAL", (ACS_LEQUAL));
SetDictInt("ACS_GEQUAL", (ACS_GEQUAL));
SetDictInt("ACS_PI", (ACS_PI));
SetDictInt("ACS_NEQUAL", (ACS_NEQUAL));
SetDictInt("ACS_STERLING", (ACS_STERLING));
#endif
--- 1748,1772 ----
SetDictInt("ACS_SBSB", (ACS_VLINE));
SetDictInt("ACS_SSSS", (ACS_PLUS));
!
! /* 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
***************
*** 2271,2280 ****
SetDictInt("A_CHARTEXT", A_CHARTEXT);
SetDictInt("A_COLOR", A_COLOR);
! #ifndef STRICT_SYSV_CURSES
SetDictInt("A_HORIZONTAL", A_HORIZONTAL);
SetDictInt("A_LEFT", A_LEFT);
SetDictInt("A_LOW", A_LOW);
SetDictInt("A_RIGHT", A_RIGHT);
SetDictInt("A_TOP", A_TOP);
SetDictInt("A_VERTICAL", A_VERTICAL);
#endif
--- 2293,2314 ----
SetDictInt("A_CHARTEXT", A_CHARTEXT);
SetDictInt("A_COLOR", A_COLOR);
!
! /* 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