From: Bruno Haible Date: Fri, 26 Jun 2020 21:22:29 +0000 (+0200) Subject: Update after gnulib changed. X-Git-Tag: v0.21~49 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=791879b94b9d336461510b0791751710f42c7a6e;p=thirdparty%2Fgettext.git Update after gnulib changed. * gnulib-local/modules/fnmatch.diff: Remove file. * gnulib-local/lib/fnmatch.c.diff: Remove file. * gnulib-local/lib/fnmatch_loop.c.diff: Remove file. * gnulib-local/Makefile.am (EXTRA_DIST): Remove them. * gettext-tools/src/read-properties.c (properties_parse): Update the fread_file invocation. * gettext-tools/po/POTFILES.in: Remove gnulib-lib/copy-acl.c, gnulib-lib/set-acl.c. * gettext-runtime/intl/localename.c: Update from gnulib. * gettext-runtime/intl/relocatable.c: Likewise. * gettext-runtime/intl/verify.h: Likewise. * gettext-runtime/intl/windows-rwlock.c: Likewise. --- diff --git a/gettext-runtime/intl/localename.c b/gettext-runtime/intl/localename.c index 180caefc3..6458f7574 100644 --- a/gettext-runtime/intl/localename.c +++ b/gettext-runtime/intl/localename.c @@ -1150,6 +1150,11 @@ extern char * getlocalename_l(int, locale_t); # ifndef LOCALE_NAME_MAX_LENGTH # define LOCALE_NAME_MAX_LENGTH 85 # endif +/* Don't assume that UNICODE is not defined. */ +# undef GetLocaleInfo +# define GetLocaleInfo GetLocaleInfoA +# undef EnumSystemLocales +# define EnumSystemLocales EnumSystemLocalesA #endif /* We want to use the system's setlocale() function here, not the gnulib @@ -2564,7 +2569,7 @@ static char lname[LC_MAX * (LOCALE_NAME_MAX_LENGTH + 1) + 1]; /* Callback function for EnumLocales. */ static BOOL CALLBACK -enum_locales_fn (LPTSTR locale_num_str) +enum_locales_fn (LPSTR locale_num_str) { char *endp; char locval[2 * LOCALE_NAME_MAX_LENGTH + 1 + 1]; diff --git a/gettext-runtime/intl/relocatable.c b/gettext-runtime/intl/relocatable.c index 209a618e9..9461458df 100644 --- a/gettext-runtime/intl/relocatable.c +++ b/gettext-runtime/intl/relocatable.c @@ -1,5 +1,5 @@ /* Provide relocatable packages. - Copyright (C) 2003-2006, 2008-2019 Free Software Foundation, Inc. + Copyright (C) 2003-2006, 2008-2020 Free Software Foundation, Inc. Written by Bruno Haible , 2003. This program is free software: you can redistribute it and/or modify @@ -65,6 +65,12 @@ # include #endif +#if defined _WIN32 && !defined __CYGWIN__ +/* Don't assume that UNICODE is not defined. */ +# undef GetModuleFileName +# define GetModuleFileName GetModuleFileNameA +#endif + /* Faked cheap 'bool'. */ #undef bool #undef false diff --git a/gettext-runtime/intl/verify.h b/gettext-runtime/intl/verify.h index 2e4997ac9..11dc4bf7a 100644 --- a/gettext-runtime/intl/verify.h +++ b/gettext-runtime/intl/verify.h @@ -277,10 +277,22 @@ template #endif /* Assume that R always holds. Behavior is undefined if R is false, - fails to evaluate, or has side effects. Although assuming R can - help a compiler generate better code or diagnostics, performance - can suffer if R uses hard-to-optimize features such as function - calls not inlined by the compiler. */ + fails to evaluate, or has side effects. + + 'assume (R)' is a directive from the programmer telling the + compiler that R is true so the compiler needn't generate code to + test R. This is why 'assume' is in verify.h: it's related to + static checking (in this case, static checking done by the + programmer), not dynamic checking. + + 'assume (R)' can affect compilation of all the code, not just code + that happens to be executed after the assume (R) is "executed". + For example, if the code mistakenly does 'assert (R); assume (R);' + the compiler is entitled to optimize away the 'assert (R)'. + + Although assuming R can help a compiler generate better code or + diagnostics, performance can suffer if R uses hard-to-optimize + features such as function calls not inlined by the compiler. */ #if _GL_HAS_BUILTIN_UNREACHABLE # define assume(R) ((R) ? (void) 0 : __builtin_unreachable ()) diff --git a/gettext-runtime/intl/windows-rwlock.c b/gettext-runtime/intl/windows-rwlock.c index c69427e98..30707d4ec 100644 --- a/gettext-runtime/intl/windows-rwlock.c +++ b/gettext-runtime/intl/windows-rwlock.c @@ -1,5 +1,5 @@ /* Read-write locks (native Windows implementation). - Copyright (C) 2005-2019 Free Software Foundation, Inc. + Copyright (C) 2005-2020 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by @@ -25,6 +25,10 @@ #include #include +/* Don't assume that UNICODE is not defined. */ +#undef CreateEvent +#define CreateEvent CreateEventA + /* In this file, the waitqueues are implemented as circular arrays. */ #define glwthread_waitqueue_t glwthread_carray_waitqueue_t diff --git a/gettext-tools/po/POTFILES.in b/gettext-tools/po/POTFILES.in index 931cf67b2..77f5e744e 100644 --- a/gettext-tools/po/POTFILES.in +++ b/gettext-tools/po/POTFILES.in @@ -10,7 +10,6 @@ gnulib-lib/argmatch.c gnulib-lib/clean-temp.c gnulib-lib/closeout.c -gnulib-lib/copy-acl.c gnulib-lib/copy-file.c gnulib-lib/csharpcomp.c gnulib-lib/csharpexec.c @@ -24,7 +23,6 @@ gnulib-lib/obstack.c gnulib-lib/pipe-filter-aux.c gnulib-lib/pipe-filter-ii.c gnulib-lib/quotearg.c -gnulib-lib/set-acl.c gnulib-lib/spawn-pipe.c gnulib-lib/w32spawn.h gnulib-lib/wait-process.c diff --git a/gettext-tools/src/read-properties.c b/gettext-tools/src/read-properties.c index 4dcb8aaeb..5ae010b54 100644 --- a/gettext-tools/src/read-properties.c +++ b/gettext-tools/src/read-properties.c @@ -600,7 +600,7 @@ properties_parse (abstract_catalog_reader_ty *this, FILE *file, const char *real_filename, const char *logical_filename) { /* Read the file into memory. */ - contents = fread_file (file, &contents_length); + contents = fread_file (file, 0, &contents_length); if (contents == NULL) { const char *errno_description = strerror (errno); diff --git a/gnulib-local/Makefile.am b/gnulib-local/Makefile.am index 9247c1c19..94349ad0d 100644 --- a/gnulib-local/Makefile.am +++ b/gnulib-local/Makefile.am @@ -1,5 +1,5 @@ ## Makefile for the gnulib-local directory of GNU gettext -## Copyright (C) 2006-2008, 2010-2012, 2014-2019 Free Software Foundation, Inc. +## Copyright (C) 2006-2008, 2010-2012, 2014-2020 Free Software Foundation, Inc. ## ## This program is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ -34,8 +34,6 @@ lib/error.h.diff \ lib/error-progname.c \ lib/error-progname.h \ lib/exitfail.h.diff \ -lib/fnmatch.c.diff \ -lib/fnmatch_loop.c.diff \ lib/getopt-core.h.diff \ lib/gettext.h \ lib/gl_array_list.h.diff \ @@ -164,7 +162,6 @@ modules/backupfile \ modules/basename \ modules/closeout \ modules/error-progname \ -modules/fnmatch.diff \ modules/gettext-runtime-misc \ modules/gettext-tools-misc \ modules/hash \ diff --git a/gnulib-local/lib/fnmatch.c.diff b/gnulib-local/lib/fnmatch.c.diff deleted file mode 100644 index 47ffc447b..000000000 --- a/gnulib-local/lib/fnmatch.c.diff +++ /dev/null @@ -1,23 +0,0 @@ -*** lib/fnmatch.c.bak 2006-07-11 13:54:17.000000000 +0200 ---- lib/fnmatch.c 2006-07-30 20:23:09.000000000 +0200 -*************** -*** 276,282 **** - fnmatch (const char *pattern, const char *string, int flags) - { - # if HANDLE_MULTIBYTE -! # define ALLOCA_LIMIT 2000 - if (__builtin_expect (MB_CUR_MAX, 1) != 1) - { - mbstate_t ps; ---- 276,286 ---- - fnmatch (const char *pattern, const char *string, int flags) - { - # if HANDLE_MULTIBYTE -! # if HAVE_ALLOCA || defined _LIBC -! # define ALLOCA_LIMIT 2000 -! # else -! # define ALLOCA_LIMIT 0 -! # endif - if (__builtin_expect (MB_CUR_MAX, 1) != 1) - { - mbstate_t ps; diff --git a/gnulib-local/lib/fnmatch_loop.c.diff b/gnulib-local/lib/fnmatch_loop.c.diff deleted file mode 100644 index 3224f9316..000000000 --- a/gnulib-local/lib/fnmatch_loop.c.diff +++ /dev/null @@ -1,277 +0,0 @@ -*** lib/fnmatch_loop.c.bak 2009-12-10 20:38:55.000000000 +0100 ---- lib/fnmatch_loop.c 2009-12-11 11:55:04.000000000 +0100 -*************** -*** 1021,1040 **** - struct patternlist - { - struct patternlist *next; - CHAR str[FLEXIBLE_ARRAY_MEMBER]; - } *list = NULL; - struct patternlist **lastp = &list; - size_t pattern_len = STRLEN (pattern); - const CHAR *p; - const CHAR *rs; - enum { ALLOCA_LIMIT = 8000 }; - - /* Parse the pattern. Store the individual parts in the list. */ - level = 0; - for (startp = p = pattern + 1; ; ++p) - if (*p == L_('\0')) - /* This is an invalid pattern. */ -! return -1; - else if (*p == L_('[')) - { - /* Handle brackets special. */ ---- 1021,1046 ---- - struct patternlist - { - struct patternlist *next; -+ int malloced; - CHAR str[FLEXIBLE_ARRAY_MEMBER]; - } *list = NULL; - struct patternlist **lastp = &list; - size_t pattern_len = STRLEN (pattern); - const CHAR *p; - const CHAR *rs; -+ #if HAVE_ALLOCA || defined _LIBC - enum { ALLOCA_LIMIT = 8000 }; -+ #else -+ enum { ALLOCA_LIMIT = 0 }; -+ #endif -+ int retval; - - /* Parse the pattern. Store the individual parts in the list. */ - level = 0; - for (startp = p = pattern + 1; ; ++p) - if (*p == L_('\0')) - /* This is an invalid pattern. */ -! goto failed; - else if (*p == L_('[')) - { - /* Handle brackets special. */ -*************** -*** 1052,1058 **** - while (*p != L_(']')) - if (*p++ == L_('\0')) - /* This is no valid pattern. */ -! return -1; - } - else if ((*p == L_('?') || *p == L_('*') || *p == L_('+') || *p == L_('@') - || *p == L_('!')) && p[1] == L_('(')) ---- 1058,1064 ---- - while (*p != L_(']')) - if (*p++ == L_('\0')) - /* This is no valid pattern. */ -! goto failed; - } - else if ((*p == L_('?') || *p == L_('*') || *p == L_('+') || *p == L_('@') - || *p == L_('!')) && p[1] == L_('(')) -*************** -*** 1075,1085 **** - plensize = plen * sizeof (CHAR); \ - newpsize = FLEXSIZEOF (struct patternlist, str, plensize); \ - if ((size_t) -1 / sizeof (CHAR) < plen \ -! || newpsize < offsetof (struct patternlist, str) \ -! || ALLOCA_LIMIT <= newpsize) \ -! return -1; \ -! newp = (struct patternlist *) alloca (newpsize); \ -! *((CHAR *) MEMPCPY (newp->str, startp, p - startp)) = L_('\0'); \ - newp->next = NULL; \ - *lastp = newp; \ - lastp = &newp->next ---- 1081,1101 ---- - plensize = plen * sizeof (CHAR); \ - newpsize = FLEXSIZEOF (struct patternlist, str, plensize); \ - if ((size_t) -1 / sizeof (CHAR) < plen \ -! || newpsize < offsetof (struct patternlist, str)) \ -! goto failed; \ -! if (newpsize < ALLOCA_LIMIT) \ -! { \ -! newp = (struct patternlist *) alloca (newpsize); \ -! newp->malloced = 0; \ -! } \ -! else \ -! { \ -! newp = (struct patternlist *) malloc (newpsize); \ -! if (!newp) \ -! goto failed; \ -! newp->malloced = 1; \ -! } \ -! *((CHAR *) MEMPCPY (newp->str, startp, p - startp)) = L_('\0'); \ - newp->next = NULL; \ - *lastp = newp; \ - lastp = &newp->next -*************** -*** 1103,1113 **** - { - case L_('*'): - if (FCT (p, string, string_end, no_leading_period, flags) == 0) -! return 0; - FALLTHROUGH; - case L_('+'): - do - { - for (rs = string; rs <= string_end; ++rs) - /* First match the prefix with the current pattern with the - current pattern. */ ---- 1119,1134 ---- - { - case L_('*'): - if (FCT (p, string, string_end, no_leading_period, flags) == 0) -! { -! retval = 0; -! goto done; -! } - FALLTHROUGH; - case L_('+'): - do - { -+ struct patternlist *next; -+ - for (rs = string; rs <= string_end; ++rs) - /* First match the prefix with the current pattern with the - current pattern. */ -*************** -*** 1130,1159 **** - : rs[-1] == '/' && NO_LEADING_PERIOD (flags), - flags & FNM_FILE_NAME - ? flags : flags & ~FNM_PERIOD) == 0))) -! /* It worked. Signal success. */ -! return 0; - } -! while ((list = list->next) != NULL); - - /* None of the patterns lead to a match. */ - return FNM_NOMATCH; - - case L_('?'): - if (FCT (p, string, string_end, no_leading_period, flags) == 0) -! return 0; - FALLTHROUGH; - case L_('@'): - do -! /* I cannot believe it but 'strcat' is actually acceptable -! here. Match the entire string with the prefix from the -! pattern list and the rest of the pattern following the -! pattern list. */ -! if (FCT (STRCAT (list->str, p), string, string_end, -! no_leading_period, -! flags & FNM_FILE_NAME ? flags : flags & ~FNM_PERIOD) == 0) -! /* It worked. Signal success. */ -! return 0; -! while ((list = list->next) != NULL); - - /* None of the patterns lead to a match. */ - return FNM_NOMATCH; ---- 1151,1203 ---- - : rs[-1] == '/' && NO_LEADING_PERIOD (flags), - flags & FNM_FILE_NAME - ? flags : flags & ~FNM_PERIOD) == 0))) -! { -! /* It worked. Signal success. */ -! retval = 0; -! goto done; -! } -! -! next = list->next; -! if (list->malloced) -! free (list); -! list = next; - } -! while (list != NULL); - - /* None of the patterns lead to a match. */ - return FNM_NOMATCH; - - case L_('?'): - if (FCT (p, string, string_end, no_leading_period, flags) == 0) -! { -! retval = 0; -! goto done; -! } - FALLTHROUGH; - case L_('@'): - do -! { -! struct patternlist *next; -! -! /* I cannot believe it but 'strcat' is actually acceptable -! here. Match the entire string with the prefix from the -! pattern list and the rest of the pattern following the -! pattern list. */ -! if (FCT (STRCAT (list->str, p), string, string_end, -! no_leading_period, -! flags & FNM_FILE_NAME ? flags : flags & ~FNM_PERIOD) == 0) -! { -! /* It worked. Signal success. */ -! retval = 0; -! goto done; -! } -! -! next = list->next; -! if (list->malloced) -! free (list); -! list = next; -! } -! while (list != NULL); - - /* None of the patterns lead to a match. */ - return FNM_NOMATCH; -*************** -*** 1177,1196 **** - : rs[-1] == '/' && NO_LEADING_PERIOD (flags), - flags & FNM_FILE_NAME ? flags : flags & ~FNM_PERIOD) - == 0)) -! /* This is successful. */ -! return 0; - } - - /* None of the patterns together with the rest of the pattern - lead to a match. */ -! return FNM_NOMATCH; - - default: - assert (! "Invalid extended matching operator"); - break; - } - -! return -1; - } - - ---- 1221,1255 ---- - : rs[-1] == '/' && NO_LEADING_PERIOD (flags), - flags & FNM_FILE_NAME ? flags : flags & ~FNM_PERIOD) - == 0)) -! { -! /* This is successful. */ -! retval = 0; -! goto done; -! } - } - - /* None of the patterns together with the rest of the pattern - lead to a match. */ -! retval = FNM_NOMATCH; -! goto done; - - default: - assert (! "Invalid extended matching operator"); - break; - } - -! failed: -! retval = -1; -! done: -! while (list != NULL) -! { -! struct patternlist *next = list->next; -! -! if (list->malloced) -! free (list); -! list = next; -! } -! return retval; - } - - diff --git a/gnulib-local/modules/fnmatch.diff b/gnulib-local/modules/fnmatch.diff deleted file mode 100644 index 59cb1e74e..000000000 --- a/gnulib-local/modules/fnmatch.diff +++ /dev/null @@ -1,19 +0,0 @@ -*** modules/fnmatch.orig 2011-06-02 22:42:23.000000000 +0200 ---- modules/fnmatch 2011-06-02 22:42:43.000000000 +0200 -*************** -*** 9,15 **** - - Depends-on: - fnmatch-h -! alloca [test $HAVE_FNMATCH = 0 || test $REPLACE_FNMATCH = 1] - attribute [test $HAVE_FNMATCH = 0 || test $REPLACE_FNMATCH = 1] - builtin-expect [test $HAVE_FNMATCH = 0 || test $REPLACE_FNMATCH = 1] - flexmember [test $HAVE_FNMATCH = 0 || test $REPLACE_FNMATCH = 1] ---- 9,15 ---- - - Depends-on: - fnmatch-h -! alloca-opt [test $HAVE_FNMATCH = 0 || test $REPLACE_FNMATCH = 1] - attribute [test $HAVE_FNMATCH = 0 || test $REPLACE_FNMATCH = 1] - builtin-expect [test $HAVE_FNMATCH = 0 || test $REPLACE_FNMATCH = 1] - flexmember [test $HAVE_FNMATCH = 0 || test $REPLACE_FNMATCH = 1] diff --git a/libtextstyle/.gitignore b/libtextstyle/.gitignore index 36a5aebdb..1f722c4a4 100644 --- a/libtextstyle/.gitignore +++ b/libtextstyle/.gitignore @@ -32,12 +32,15 @@ /lib/c-strcase.h /lib/c-strcasecmp.c /lib/c-strncasecmp.c +/lib/cloexec.c +/lib/cloexec.h /lib/close.c /lib/concat-filename.c /lib/concat-filename.h /lib/dirname.h /lib/dirname-lgpl.c /lib/dosname.h +/lib/dup2.c /lib/errno.in.h /lib/error.c /lib/error.h @@ -45,6 +48,7 @@ /lib/exitfail.h /lib/fatal-signal.c /lib/fatal-signal.h +/lib/fcntl.c /lib/fcntl.in.h /lib/fd-hook.c /lib/fd-hook.h @@ -67,6 +71,7 @@ /lib/get_ppid_of.h /lib/get_progname_of.c /lib/get_progname_of.h +/lib/getdtablesize.c /lib/gethostname.c /lib/getprogname.c /lib/getprogname.h @@ -127,6 +132,7 @@ /lib/noreturn.h /lib/obstack.c /lib/obstack.h +/lib/open.c /lib/ostream.oo.c /lib/ostream.oo.h /lib/pathmax.h