X-Git-Url: http://ncurses.scripts.mit.edu/?a=blobdiff_plain;f=ncurses%2Ftinfo%2Flib_setup.c;h=b7937da2291ccd2c2583e9f6e540337fc14b4fca;hb=5da4544722decdeb2bfd0c7c4581af0ea62148f9;hp=a4b87e3b887daf3812b9d592bb660d7b2b99a176;hpb=d545d5dd9889756f005fb63a843adb230b990493;p=ncurses.git diff --git a/ncurses/tinfo/lib_setup.c b/ncurses/tinfo/lib_setup.c index a4b87e3b..b7937da2 100644 --- a/ncurses/tinfo/lib_setup.c +++ b/ncurses/tinfo/lib_setup.c @@ -48,7 +48,7 @@ #include #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.193 2018/06/23 21:35:06 tom Exp $") /**************************************************************************** * @@ -560,7 +560,7 @@ NCURSES_EXPORT(int) _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); @@ -618,7 +618,7 @@ _nc_locale_breaks_acs(TERMINAL *termp) NCURSES_EXPORT(int) TINFO_SETUP_TERM(TERMINAL **tp, - NCURSES_CONST char *tname, + const char *tname, int Filedes, int *errret, int reuse) @@ -827,8 +827,9 @@ _nc_find_prescr(void) { 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; } @@ -845,8 +846,9 @@ NCURSES_EXPORT(void) _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 { @@ -882,7 +884,7 @@ new_prescr(void) #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; @@ -919,7 +921,7 @@ new_prescr(void) * 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) @@ -947,7 +949,7 @@ _nc_setupterm(NCURSES_CONST char *tname, * 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);