comparison rogue3/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
259 #ifdef SIGTERM 259 #ifdef SIGTERM
260 signal(SIGTERM, auto_save); 260 signal(SIGTERM, auto_save);
261 #endif 261 #endif
262 #ifdef SIGINT 262 #ifdef SIGINT
263 signal(SIGINT, quit); 263 signal(SIGINT, quit);
264 #endif
265 }
266
267 int
268 md_hasclreol(void)
269 {
270 #if defined(clr_eol)
271 #ifdef NCURSES_VERSION
272 if (cur_term == NULL)
273 return(0);
274 if (cur_term->type.Strings == NULL)
275 return(0);
276 #endif
277 return((clr_eol != NULL) && (*clr_eol != 0));
278 #elif defined(__PDCURSES__)
279 return(TRUE);
280 #else
281 return((CE != NULL) && (*CE != 0));
282 #endif 264 #endif
283 } 265 }
284 266
285 #ifdef _WIN32 267 #ifdef _WIN32
286 static int md_standout_mode = 0; 268 static int md_standout_mode = 0;