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.
This commit is contained in:
parent
a489fa501e
commit
338214459d
8 changed files with 4 additions and 86 deletions
|
|
@ -106,24 +106,6 @@ md_init(void)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
|
||||||
md_hasclreol(void)
|
|
||||||
{
|
|
||||||
#if defined(clr_eol)
|
|
||||||
#ifdef NCURSES_VERSION
|
|
||||||
if (cur_term == NULL)
|
|
||||||
return(0);
|
|
||||||
if (cur_term->type.Strings == NULL)
|
|
||||||
return(0);
|
|
||||||
#endif
|
|
||||||
return((clr_eol != NULL) && (*clr_eol != 0));
|
|
||||||
#elif defined(__PDCURSES__)
|
|
||||||
return(TRUE);
|
|
||||||
#else
|
|
||||||
return((CE != NULL) && (*CE != 0));
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef attron
|
#ifdef attron
|
||||||
# define _puts(s) tputs(s, 0, putchar);
|
# define _puts(s) tputs(s, 0, putchar);
|
||||||
# define SO enter_standout_mode
|
# define SO enter_standout_mode
|
||||||
|
|
|
||||||
|
|
@ -264,24 +264,6 @@ md_onsignal_autosave(void)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
|
||||||
md_hasclreol(void)
|
|
||||||
{
|
|
||||||
#if defined(clr_eol)
|
|
||||||
#ifdef NCURSES_VERSION
|
|
||||||
if (cur_term == NULL)
|
|
||||||
return(0);
|
|
||||||
if (cur_term->type.Strings == NULL)
|
|
||||||
return(0);
|
|
||||||
#endif
|
|
||||||
return((clr_eol != NULL) && (*clr_eol != 0));
|
|
||||||
#elif defined(__PDCURSES__)
|
|
||||||
return(TRUE);
|
|
||||||
#else
|
|
||||||
return((CE != NULL) && (*CE != 0));
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
static int md_standout_mode = 0;
|
static int md_standout_mode = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -171,7 +171,6 @@ int md_setdsuspchar(int c);
|
||||||
int md_shellescape(void);
|
int md_shellescape(void);
|
||||||
void md_sleep(int s);
|
void md_sleep(int s);
|
||||||
int md_suspchar(void);
|
int md_suspchar(void);
|
||||||
int md_hasclreol(void);
|
|
||||||
int md_unlink(char *file);
|
int md_unlink(char *file);
|
||||||
int md_unlink_open_file(const char *file, FILE *inf);
|
int md_unlink_open_file(const char *file, FILE *inf);
|
||||||
void md_tstpsignal(void);
|
void md_tstpsignal(void);
|
||||||
|
|
|
||||||
|
|
@ -110,20 +110,6 @@ md_init(void)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
|
||||||
md_hasclreol(void)
|
|
||||||
{
|
|
||||||
#ifdef CE
|
|
||||||
return((CE != NULL) && (*CE != 0));
|
|
||||||
#elif defined (clr_eol)
|
|
||||||
return((clr_eol != NULL) && (*clr_eol != 0));
|
|
||||||
#elif !defined(__PDCURSES__)
|
|
||||||
return(clr_eol != NULL);
|
|
||||||
#else
|
|
||||||
return(TRUE);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
static int md_standout_mode = 0;
|
static int md_standout_mode = 0;
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
|
|
@ -263,13 +263,13 @@ md_onsignal_autosave(void)
|
||||||
int
|
int
|
||||||
md_hasclreol(void)
|
md_hasclreol(void)
|
||||||
{
|
{
|
||||||
#if defined(clr_eol)
|
|
||||||
#ifdef NCURSES_VERSION
|
#ifdef NCURSES_VERSION
|
||||||
|
char *cap_str;
|
||||||
if (cur_term == NULL)
|
if (cur_term == NULL)
|
||||||
return(0);
|
return(0);
|
||||||
if (cur_term->type.Strings == NULL)
|
cap_str = tigetstr("el");
|
||||||
return(0);
|
return (cap_str != NULL);
|
||||||
#endif
|
#elif defined(clr_eol)
|
||||||
return((clr_eol != NULL) && (*clr_eol != 0));
|
return((clr_eol != NULL) && (*clr_eol != 0));
|
||||||
#elif defined(__PDCURSES__)
|
#elif defined(__PDCURSES__)
|
||||||
return(TRUE);
|
return(TRUE);
|
||||||
|
|
|
||||||
|
|
@ -260,24 +260,6 @@ md_onsignal_autosave(void)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
|
||||||
md_hasclreol(void)
|
|
||||||
{
|
|
||||||
#if defined(clr_eol)
|
|
||||||
#ifdef NCURSES_VERSION
|
|
||||||
if (cur_term == NULL)
|
|
||||||
return(0);
|
|
||||||
if (cur_term->type.Strings == NULL)
|
|
||||||
return(0);
|
|
||||||
#endif
|
|
||||||
return((clr_eol != NULL) && (*clr_eol != 0));
|
|
||||||
#elif defined(__PDCURSES__)
|
|
||||||
return(TRUE);
|
|
||||||
#else
|
|
||||||
return((CE != NULL) && (*CE != 0));
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
static int md_standout_mode = 0;
|
static int md_standout_mode = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,6 @@ int md_setdsuspchar(int c);
|
||||||
int md_shellescape(void);
|
int md_shellescape(void);
|
||||||
void md_sleep(int s);
|
void md_sleep(int s);
|
||||||
int md_suspchar(void);
|
int md_suspchar(void);
|
||||||
int md_hasclreol(void);
|
|
||||||
int md_unlink(char *file);
|
int md_unlink(char *file);
|
||||||
int md_unlink_open_file(const char *file, FILE *inf);
|
int md_unlink_open_file(const char *file, FILE *inf);
|
||||||
void md_tstpsignal(void);
|
void md_tstpsignal(void);
|
||||||
|
|
|
||||||
|
|
@ -103,18 +103,6 @@ md_init()
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
|
||||||
md_hasclreol()
|
|
||||||
{
|
|
||||||
#ifndef attron
|
|
||||||
return(!CE);
|
|
||||||
#elif !defined(__PDCURSES__)
|
|
||||||
return(clr_eol != NULL);
|
|
||||||
#else
|
|
||||||
return(TRUE);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef attron
|
#ifdef attron
|
||||||
# define _puts(s) tputs(s, 0, putchar);
|
# define _puts(s) tputs(s, 0, putchar);
|
||||||
# define SO enter_standout_mode
|
# define SO enter_standout_mode
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue