#include <locale.h>
#endif
-MODULE_ID("$Id: lib_setup.c,v 1.189 2018/02/17 21:23:32 tom Exp $")
+MODULE_ID("$Id: lib_setup.c,v 1.194 2018/06/30 19:40:27 tom Exp $")
/****************************************************************************
*
*/
env = setlocale(LC_CTYPE, 0);
#else
- if (((env = getenv("LC_ALL")) != 0 && *env != '\0')
+ if (((env = getenv("LANG")) != 0 && *env != '\0')
|| ((env = getenv("LC_CTYPE")) != 0 && *env != '\0')
- || ((env = getenv("LANG")) != 0 && *env != '\0')) {
+ || ((env = getenv("LC_ALL")) != 0 && *env != '\0')) {
;
}
#endif
_nc_unicode_locale(void)
{
int result = 0;
-#if defined(__MINGW32__) && USE_WIDEC_SUPPORT
+#if defined(_WIN32) && USE_WIDEC_SUPPORT
result = 1;
#elif HAVE_LANGINFO_CODESET
char *env = nl_langinfo(CODESET);
NCURSES_EXPORT(int)
TINFO_SETUP_TERM(TERMINAL **tp,
- NCURSES_CONST char *tname,
+ const char *tname,
int Filedes,
int *errret,
int reuse)
{
SCREEN *result = 0;
PRESCREEN_LIST *p;
+ pthread_t id = GetThreadID();
for (p = _nc_prescreen.allocated; p != 0; p = p->next) {
- if (p->id == pthread_self()) {
+ if (p->id == id) {
result = p->sp;
break;
}
_nc_forget_prescr(void)
{
PRESCREEN_LIST *p, *q;
+ pthread_t id = GetThreadID();
for (p = _nc_prescreen.allocated, q = 0; p != 0; q = p, p = p->next) {
- if (p->id == pthread_self()) {
+ if (p->id == id) {
if (q) {
q->next = p->next;
} else {
#ifdef USE_PTHREADS
PRESCREEN_LIST *p = typeCalloc(PRESCREEN_LIST, 1);
if (p != 0) {
- p->id = pthread_self();
+ p->id = GetThreadID();
p->sp = sp;
p->next = _nc_prescreen.allocated;
_nc_prescreen.allocated = p;
* the same TERMINAL data (see comment).
*/
NCURSES_EXPORT(int)
-_nc_setupterm(NCURSES_CONST char *tname,
+_nc_setupterm(const char *tname,
int Filedes,
int *errret,
int reuse)
* Make cur_term point to the structure.
*/
NCURSES_EXPORT(int)
-setupterm(NCURSES_CONST char *tname, int Filedes, int *errret)
+setupterm(const char *tname, int Filedes, int *errret)
{
START_TRACE();
return _nc_setupterm(tname, Filedes, errret, FALSE);