comparison arogue5/mdport.c @ 291:5b6855d5d089

Fix a portability issue with md_hasclreol(). Some games' implementation of md_hasclreol() poked around in ncurses internals, which does not work for some ncurses build configuration. Most games did not actually call md_hasclreol(), so it was removed. There is a standard terminfo function which can retrieve the value of the clr_eol capability, so this was used for rogue5.
author John "Elwin" Edwards
date Wed, 27 Dec 2017 10:26:06 -0500
parents 17005af49963
children e52a8a7ad4c5
comparison
equal deleted inserted replaced
290:2b452dbf0138 291:5b6855d5d089
101 #if defined(__DJGPP__) || defined(_WIN32) 101 #if defined(__DJGPP__) || defined(_WIN32)
102 _fmode = _O_BINARY; 102 _fmode = _O_BINARY;
103 #endif 103 #endif
104 #if defined(__CYGWIN__) || defined(__MSYS__) 104 #if defined(__CYGWIN__) || defined(__MSYS__)
105 ESCDELAY=250; 105 ESCDELAY=250;
106 #endif
107 }
108
109 int
110 md_hasclreol(void)
111 {
112 #if defined(clr_eol)
113 #ifdef NCURSES_VERSION
114 if (cur_term == NULL)
115 return(0);
116 if (cur_term->type.Strings == NULL)
117 return(0);
118 #endif
119 return((clr_eol != NULL) && (*clr_eol != 0));
120 #elif defined(__PDCURSES__)
121 return(TRUE);
122 #else
123 return((CE != NULL) && (*CE != 0));
124 #endif 106 #endif
125 } 107 }
126 108
127 #ifdef attron 109 #ifdef attron
128 # define _puts(s) tputs(s, 0, putchar); 110 # define _puts(s) tputs(s, 0, putchar);