comparison srogue/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 8b6aba552f6f
children
comparison
equal deleted inserted replaced
290:2b452dbf0138 291:5b6855d5d089
255 #ifdef SIGTERM 255 #ifdef SIGTERM
256 signal(SIGTERM, auto_save); 256 signal(SIGTERM, auto_save);
257 #endif 257 #endif
258 #ifdef SIGINT 258 #ifdef SIGINT
259 signal(SIGINT, quit); 259 signal(SIGINT, quit);
260 #endif
261 }
262
263 int
264 md_hasclreol(void)
265 {
266 #if defined(clr_eol)
267 #ifdef NCURSES_VERSION
268 if (cur_term == NULL)
269 return(0);
270 if (cur_term->type.Strings == NULL)
271 return(0);
272 #endif
273 return((clr_eol != NULL) && (*clr_eol != 0));
274 #elif defined(__PDCURSES__)
275 return(TRUE);
276 #else
277 return((CE != NULL) && (*CE != 0));
278 #endif 260 #endif
279 } 261 }
280 262
281 #ifdef _WIN32 263 #ifdef _WIN32
282 static int md_standout_mode = 0; 264 static int md_standout_mode = 0;