From b4d6b65c97c739f0c991ccb67372d6a1960a5bd4 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sat, 18 Feb 2012 13:34:04 +0100 Subject: [PATCH] Update from gnulib. --- gettext-runtime/intl/ChangeLog | 7 ++++++ gettext-runtime/intl/localcharset.c | 16 +++++++------- gettext-runtime/intl/localename.c | 24 ++++++++++---------- gettext-runtime/intl/lock.c | 2 +- gettext-runtime/intl/lock.h | 15 +++++++------ gettext-runtime/intl/relocatable.c | 14 ++++++------ gettext-runtime/m4/ChangeLog | 8 +++++++ gettext-runtime/m4/threadlib.m4 | 34 +++++++++++++++-------------- gettext-runtime/tests/ChangeLog | 6 +++++ gettext-runtime/tests/test-lock.c | 10 ++++----- 10 files changed, 80 insertions(+), 56 deletions(-) diff --git a/gettext-runtime/intl/ChangeLog b/gettext-runtime/intl/ChangeLog index a0ee27c5d..765a3874b 100644 --- a/gettext-runtime/intl/ChangeLog +++ b/gettext-runtime/intl/ChangeLog @@ -9,6 +9,13 @@ Talk about "native Windows API", not "Win32". * vasnprintf.c: Update comments to mention native Windows. + * localcharset.c: Update comments to mention native Windows. + (WINDOWS_NATIVE): Renamed from WIN32_NATIVE. + * localename.c: Likewise. + * relocatable.c: Likewise. + * lock.h: Update comments to mention native Windows. + (USE_WINDOWS_THREADS): Renamed from USE_WIN32_THREADS. + * lock.c (USE_WINDOWS_THREADS): Renamed from USE_WIN32_THREADS. 2011-10-15 Bruno Haible diff --git a/gettext-runtime/intl/localcharset.c b/gettext-runtime/intl/localcharset.c index 5d79f8336..13831d61d 100644 --- a/gettext-runtime/intl/localcharset.c +++ b/gettext-runtime/intl/localcharset.c @@ -33,7 +33,7 @@ #endif #if defined _WIN32 || defined __WIN32__ -# define WIN32_NATIVE +# define WINDOWS_NATIVE #endif #if defined __EMX__ @@ -43,7 +43,7 @@ # endif #endif -#if !defined WIN32_NATIVE +#if !defined WINDOWS_NATIVE # include # if HAVE_LANGINFO_CODESET # include @@ -56,7 +56,7 @@ # define WIN32_LEAN_AND_MEAN # include # endif -#elif defined WIN32_NATIVE +#elif defined WINDOWS_NATIVE # define WIN32_LEAN_AND_MEAN # include #endif @@ -82,7 +82,7 @@ #endif #if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__ - /* Win32, Cygwin, OS/2, DOS */ + /* Native Windows, Cygwin, OS/2, DOS */ # define ISSLASH(C) ((C) == '/' || (C) == '\\') #endif @@ -122,7 +122,7 @@ get_charset_aliases (void) cp = charset_aliases; if (cp == NULL) { -#if !(defined DARWIN7 || defined VMS || defined WIN32_NATIVE || defined __CYGWIN__) +#if !(defined DARWIN7 || defined VMS || defined WINDOWS_NATIVE || defined __CYGWIN__) const char *dir; const char *base = "charset.alias"; char *file_name; @@ -307,7 +307,7 @@ get_charset_aliases (void) "DECKOREAN" "\0" "EUC-KR" "\0"; # endif -# if defined WIN32_NATIVE || defined __CYGWIN__ +# if defined WINDOWS_NATIVE || defined __CYGWIN__ /* To avoid the troubles of installing a separate file in the same directory as the DLL and of retrieving the DLL's directory at runtime, simply inline the aliases here. */ @@ -359,7 +359,7 @@ locale_charset (void) const char *codeset; const char *aliases; -#if !(defined WIN32_NATIVE || defined OS2) +#if !(defined WINDOWS_NATIVE || defined OS2) # if HAVE_LANGINFO_CODESET @@ -452,7 +452,7 @@ locale_charset (void) # endif -#elif defined WIN32_NATIVE +#elif defined WINDOWS_NATIVE static char buf[2 + 10 + 1]; diff --git a/gettext-runtime/intl/localename.c b/gettext-runtime/intl/localename.c index 9b7ebfc42..3dca41154 100644 --- a/gettext-runtime/intl/localename.c +++ b/gettext-runtime/intl/localename.c @@ -15,7 +15,7 @@ along with this program. If not, see . */ /* Written by Ulrich Drepper , 1995. */ -/* Win32 code written by Tor Lillqvist . */ +/* Native Windows code written by Tor Lillqvist . */ /* MacOS X code written by Bruno Haible . */ #include @@ -54,10 +54,10 @@ #endif #if defined _WIN32 || defined __WIN32__ -# define WIN32_NATIVE +# define WINDOWS_NATIVE #endif -#if defined WIN32_NATIVE || defined __CYGWIN__ /* WIN32 or Cygwin */ +#if defined WINDOWS_NATIVE || defined __CYGWIN__ /* Native Windows or Cygwin */ # define WIN32_LEAN_AND_MEAN # include /* List of language codes, sorted by value: @@ -1405,11 +1405,11 @@ gl_locale_name_canonicalize (char *name) #endif -#if defined WIN32_NATIVE || defined __CYGWIN__ /* WIN32 or Cygwin */ +#if defined WINDOWS_NATIVE || defined __CYGWIN__ /* Native Windows or Cygwin */ -/* Canonicalize a Win32 native locale name to a Unix locale name. +/* Canonicalize a Windows native locale name to a Unix locale name. NAME is a sufficiently large buffer. - On input, it contains the Win32 locale name. + On input, it contains the Windows locale name. On output, it contains the Unix locale name. */ # if !defined IN_LIBINTL static @@ -1465,9 +1465,9 @@ gl_locale_name_from_win32_LANGID (LANGID langid) } /* Internet Explorer has an LCID to RFC3066 name mapping stored in HKEY_CLASSES_ROOT\Mime\Database\Rfc1766. But we better don't use that - since IE's i18n subsystem is known to be inconsistent with the Win32 base - (e.g. they have different character conversion facilities that produce - different results). */ + since IE's i18n subsystem is known to be inconsistent with the native + Windows base (e.g. they have different character conversion facilities + that produce different results). */ /* Use our own table. */ { int primary, sub; @@ -2866,7 +2866,7 @@ gl_locale_name_default (void) "C.UTF-8" locale, which operates in the same way as the "C" locale. */ -#if !(HAVE_CFLOCALECOPYCURRENT || HAVE_CFPREFERENCESCOPYAPPVALUE || defined WIN32_NATIVE || defined __CYGWIN__) +#if !(HAVE_CFLOCALECOPYCURRENT || HAVE_CFPREFERENCESCOPYAPPVALUE || defined WINDOWS_NATIVE || defined __CYGWIN__) /* The system does not have a way of setting the locale, other than the POSIX specified environment variables. We use C as default locale. */ @@ -2921,11 +2921,11 @@ gl_locale_name_default (void) # endif -# if defined WIN32_NATIVE || defined __CYGWIN__ /* WIN32 or Cygwin */ +# if defined WINDOWS_NATIVE || defined __CYGWIN__ /* Native Windows or Cygwin */ { LCID lcid; - /* Use native Win32 API locale ID. */ + /* Use native Windows API locale ID. */ lcid = GetThreadLocale (); return gl_locale_name_from_win32_LCID (lcid); diff --git a/gettext-runtime/intl/lock.c b/gettext-runtime/intl/lock.c index a8ae55871..113098c18 100644 --- a/gettext-runtime/intl/lock.c +++ b/gettext-runtime/intl/lock.c @@ -629,7 +629,7 @@ glthread_once_singlethreaded (gl_once_t *once_control) /* ========================================================================= */ -#if USE_WIN32_THREADS +#if USE_WINDOWS_THREADS /* -------------------------- gl_lock_t datatype -------------------------- */ diff --git a/gettext-runtime/intl/lock.h b/gettext-runtime/intl/lock.h index 5fcb984ba..2504fdc57 100644 --- a/gettext-runtime/intl/lock.h +++ b/gettext-runtime/intl/lock.h @@ -613,16 +613,17 @@ extern int glthread_once_singlethreaded (gl_once_t *once_control); /* ========================================================================= */ -#if USE_WIN32_THREADS +#if USE_WINDOWS_THREADS +# define WIN32_LEAN_AND_MEAN /* avoid including junk */ # include # ifdef __cplusplus extern "C" { # endif -/* We can use CRITICAL_SECTION directly, rather than the Win32 Event, Mutex, - Semaphore types, because +/* We can use CRITICAL_SECTION directly, rather than the native Windows Event, + Mutex, Semaphore types, because - we need only to synchronize inside a single process (address space), not inter-process locking, - we don't need to support trylock operations. (TryEnterCriticalSection @@ -708,9 +709,9 @@ extern int glthread_rwlock_destroy_func (gl_rwlock_t *lock); /* --------------------- gl_recursive_lock_t datatype --------------------- */ -/* The Win32 documentation says that CRITICAL_SECTION already implements a - recursive lock. But we need not rely on it: It's easy to implement a - recursive lock without this assumption. */ +/* The native Windows documentation says that CRITICAL_SECTION already + implements a recursive lock. But we need not rely on it: It's easy to + implement a recursive lock without this assumption. */ typedef struct { @@ -762,7 +763,7 @@ extern void glthread_once_func (gl_once_t *once_control, void (*initfunction) (v /* ========================================================================= */ -#if !(USE_POSIX_THREADS || USE_PTH_THREADS || USE_SOLARIS_THREADS || USE_WIN32_THREADS) +#if !(USE_POSIX_THREADS || USE_PTH_THREADS || USE_SOLARIS_THREADS || USE_WINDOWS_THREADS) /* Provide dummy implementation if threads are not supported. */ diff --git a/gettext-runtime/intl/relocatable.c b/gettext-runtime/intl/relocatable.c index ec9d7942e..7536f6ca1 100644 --- a/gettext-runtime/intl/relocatable.c +++ b/gettext-runtime/intl/relocatable.c @@ -70,7 +70,7 @@ IS_PATH_WITH_DIR(P) tests whether P contains a directory specification. */ #if ((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__) || defined __EMX__ || defined __DJGPP__ - /* Win32, OS/2, DOS */ + /* Native Windows, OS/2, DOS */ # define ISSLASH(C) ((C) == '/' || (C) == '\\') # define HAS_DEVICE(P) \ ((((P)[0] >= 'A' && (P)[0] <= 'Z') || ((P)[0] >= 'a' && (P)[0] <= 'z')) \ @@ -89,7 +89,7 @@ It allows libraries to be have been installed with a different original prefix than the program. But it is quite costly, especially on Cygwin platforms, see below. Therefore we enable it by default only on native - Win32 platforms. */ + Windows platforms. */ #ifndef ENABLE_COSTLY_RELOCATABLE # if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ # define ENABLE_COSTLY_RELOCATABLE 1 @@ -249,7 +249,7 @@ compute_curr_prefix (const char *orig_installprefix, often case-insensitive. It's better to accept the comparison if the difference is only in case, rather than to fail. */ #if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__ - /* Win32, Cygwin, OS/2, DOS - case insignificant file system */ + /* Native Windows, Cygwin, OS/2, DOS - case insignificant file system */ if ((*rpi >= 'a' && *rpi <= 'z' ? *rpi - 'a' + 'A' : *rpi) != (*cpi >= 'a' && *cpi <= 'z' ? *cpi - 'a' + 'A' : *cpi)) break; @@ -303,10 +303,10 @@ compute_curr_prefix (const char *orig_installprefix, static char *shared_library_fullname; #if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ -/* Native Win32 only. +/* Native Windows only. On Cygwin, it is better to use the Cygwin provided /proc interface, than - to use native Win32 API and cygwin_conv_to_posix_path, because it supports - longer file names + to use native Windows API and cygwin_conv_to_posix_path, because it + supports longer file names (see ). */ /* Determine the full pathname of the shared library when it is loaded. */ @@ -390,7 +390,7 @@ find_shared_library_fullname () #endif } -#endif /* WIN32 / Unix */ +#endif /* Native Windows / Unix */ /* Return the full pathname of the current shared library. Return NULL if unknown. diff --git a/gettext-runtime/m4/ChangeLog b/gettext-runtime/m4/ChangeLog index ceb1062fe..e5b9aee9d 100644 --- a/gettext-runtime/m4/ChangeLog +++ b/gettext-runtime/m4/ChangeLog @@ -1,3 +1,11 @@ +2012-01-04 Bruno Haible + + Talk about "native Windows API", not "Win32". + * threadlib.m4: Update comments to mention native Windows. + (gl_THREADLIB_EARLY_BODY, gl_THREADLIB_BODY): Expect + --enable-threads=windows instead of --enable-threads=win32. Set + USE_WINDOWS_THREADS, not USE_WIN32_THREADS. + 2012-01-06 Paul Eggert * m4/gettext.m4: In commentary, do not use ` to quote. diff --git a/gettext-runtime/m4/threadlib.m4 b/gettext-runtime/m4/threadlib.m4 index 8a621fd04..9cedb6700 100644 --- a/gettext-runtime/m4/threadlib.m4 +++ b/gettext-runtime/m4/threadlib.m4 @@ -1,5 +1,5 @@ -# threadlib.m4 serial 8 (gettext-0.18.2) -dnl Copyright (C) 2005-2011 Free Software Foundation, Inc. +# threadlib.m4 serial 9 (gettext-0.18.2) +dnl Copyright (C) 2005-2012 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -15,7 +15,7 @@ dnl default is 'no', otherwise it is system dependent. In both cases, the user dnl can change the choice through the options --enable-threads=choice or dnl --disable-threads. dnl Defines at most one of the macros USE_POSIX_THREADS, USE_SOLARIS_THREADS, -dnl USE_PTH_THREADS, USE_WIN32_THREADS +dnl USE_PTH_THREADS, USE_WINDOWS_THREADS dnl Sets the variables LIBTHREAD and LTLIBTHREAD to the linker options for use dnl in a Makefile (LIBTHREAD for use without libtool, LTLIBTHREAD for use with dnl libtool). @@ -53,7 +53,7 @@ AC_DEFUN([gl_THREADLIB_EARLY_BODY], [m4_divert_text([DEFAULTS], [gl_use_threads_default=no])], [m4_divert_text([DEFAULTS], [gl_use_threads_default=])]) AC_ARG_ENABLE([threads], -AC_HELP_STRING([--enable-threads={posix|solaris|pth|win32}], [specify multithreading API])m4_ifdef([gl_THREADLIB_DEFAULT_NO], [], [ +AC_HELP_STRING([--enable-threads={posix|solaris|pth|windows}], [specify multithreading API])m4_ifdef([gl_THREADLIB_DEFAULT_NO], [], [ AC_HELP_STRING([--disable-threads], [build without multithread safety])]), [gl_use_threads=$enableval], [if test -n "$gl_use_threads_default"; then @@ -276,17 +276,19 @@ int main () fi fi if test -z "$gl_have_pthread"; then - if test "$gl_use_threads" = yes || test "$gl_use_threads" = win32; then - if { case "$host_os" in - mingw*) true;; - *) false;; - esac - }; then - gl_threads_api=win32 - AC_DEFINE([USE_WIN32_THREADS], [1], - [Define if the Win32 multithreading API can be used.]) - fi - fi + case "$gl_use_threads" in + yes | windows | win32) # The 'win32' is for backward compatibility. + if { case "$host_os" in + mingw*) true;; + *) false;; + esac + }; then + gl_threads_api=windows + AC_DEFINE([USE_WINDOWS_THREADS], [1], + [Define if the native Windows multithreading API can be used.]) + fi + ;; + esac fi fi AC_MSG_CHECKING([for multithread API to use]) @@ -358,7 +360,7 @@ dnl Cygwin posix -lpthread Y OK dnl dnl Any of the above pth -lpth 0.0 dnl -dnl Mingw win32 N OK +dnl Mingw windows N OK dnl dnl BeOS 5 -- dnl diff --git a/gettext-runtime/tests/ChangeLog b/gettext-runtime/tests/ChangeLog index eab532067..da8792121 100644 --- a/gettext-runtime/tests/ChangeLog +++ b/gettext-runtime/tests/ChangeLog @@ -1,3 +1,9 @@ +2012-01-06 Bruno Haible + + Talk about "native Windows API", not "Woe32". + * test-lock.c (USE_WINDOWS_THREADS): Renamed from USE_WIN32_THREADS. + (TEST_WINDOWS_THREADS): Renamed from TEST_WIN32_THREADS. + 2011-06-03 Bruno Haible Copyright: Use LGPL 2.1 instead of LGPL 2.0. diff --git a/gettext-runtime/tests/test-lock.c b/gettext-runtime/tests/test-lock.c index b2a644ddd..1258412c5 100644 --- a/gettext-runtime/tests/test-lock.c +++ b/gettext-runtime/tests/test-lock.c @@ -20,7 +20,7 @@ # include #endif -#if USE_POSIX_THREADS || USE_SOLARIS_THREADS || USE_PTH_THREADS || USE_WIN32_THREADS +#if USE_POSIX_THREADS || USE_SOLARIS_THREADS || USE_PTH_THREADS || USE_WINDOWS_THREADS #if USE_POSIX_THREADS # define TEST_POSIX_THREADS 1 @@ -31,8 +31,8 @@ #if USE_PTH_THREADS # define TEST_PTH_THREADS 1 #endif -#if USE_WIN32_THREADS -# define TEST_WIN32_THREADS 1 +#if USE_WINDOWS_THREADS +# define TEST_WINDOWS_THREADS 1 #endif /* Whether to enable locking. @@ -71,7 +71,7 @@ # undef USE_POSIX_THREADS # undef USE_SOLARIS_THREADS # undef USE_PTH_THREADS -# undef USE_WIN32_THREADS +# undef USE_WINDOWS_THREADS #endif #include "lock.h" @@ -156,7 +156,7 @@ static inline void * gl_thread_self (void) return (void *) thr_self (); } #endif -#if TEST_WIN32_THREADS +#if TEST_WINDOWS_THREADS # include typedef HANDLE gl_thread_t; /* Use a wrapper function, instead of adding WINAPI through a cast. */ -- 2.47.2