mirror of
https://codeberg.org/noisytoot/notnotdnethack.git
synced 2025-07-26 07:12:23 +01:00
Unconditionally enable HAVE_SETLOCALE
setlocale is standard C and POSIX.
This commit is contained in:
parent
ed898f91f4
commit
2060298f77
4 changed files with 1 additions and 13 deletions
|
@ -156,8 +156,6 @@ typedef unsigned char uchar;
|
|||
|
||||
typedef uint32_t glyph_t;
|
||||
|
||||
#define HAVE_SETLOCALE /* Query locale, if UTF8 is supported? */
|
||||
|
||||
/*
|
||||
* Various structures have the option of using bitfields to save space.
|
||||
* If your C compiler handles bitfields well (e.g., it can initialize structs
|
||||
|
|
|
@ -8,9 +8,7 @@
|
|||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
|
||||
#ifdef HAVE_SETLOCALE
|
||||
#include <locale.h>
|
||||
#endif
|
||||
|
||||
#define WINTYPELEN 16
|
||||
|
||||
|
@ -611,14 +609,12 @@ initoptions(void)
|
|||
switch_graphics(DEC_GRAPHICS);
|
||||
}
|
||||
# endif
|
||||
# ifdef HAVE_SETLOCALE
|
||||
/* try to detect if a utf-8 locale is supported */
|
||||
if (setlocale(LC_ALL, "") &&
|
||||
(opts = setlocale(LC_CTYPE, NULL)) &&
|
||||
((strstri(opts, "utf8") != 0) || (strstri(opts, "utf-8") != 0))) {
|
||||
switch_graphics(UTF8_GRAPHICS);
|
||||
}
|
||||
# endif
|
||||
#endif /* UNIX */
|
||||
|
||||
flags.menu_style = MENU_FULL;
|
||||
|
|
|
@ -1022,10 +1022,8 @@ curses_init_options(void)
|
|||
switch_graphics(ASCII_GRAPHICS);
|
||||
if (iflags.IBMgraphics) {
|
||||
switch_graphics(IBM_GRAPHICS);
|
||||
#ifdef HAVE_SETLOCALE
|
||||
} else if (iflags.supports_utf8 && !iflags.cursesgraphics) {
|
||||
switch_graphics(UTF8_GRAPHICS);
|
||||
#endif
|
||||
} else if (iflags.cursesgraphics) {
|
||||
switch_graphics(CURS_GRAPHICS);
|
||||
} else {
|
||||
|
|
|
@ -6,9 +6,7 @@
|
|||
#include "color.h"
|
||||
#include "wincurs.h"
|
||||
|
||||
#ifdef HAVE_SETLOCALE
|
||||
# include <locale.h>
|
||||
#endif
|
||||
#include <locale.h>
|
||||
|
||||
/* Public functions for curses NetHack interface */
|
||||
|
||||
|
@ -93,9 +91,7 @@ curses_init_nhwindows(int *argcp, char **argv)
|
|||
char window_title[BUFSZ];
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SETLOCALE
|
||||
setlocale(LC_CTYPE, "");
|
||||
#endif
|
||||
|
||||
#ifdef XCURSES
|
||||
base_term = Xinitscr(*argcp, argv);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue