diff options
Diffstat (limited to 'intl')
-rw-r--r-- | intl/bindtextdom.c | 2 | ||||
-rw-r--r-- | intl/finddomain.c | 4 | ||||
-rw-r--r-- | intl/l10nflist.c | 2 | ||||
-rw-r--r-- | intl/loadmsgcat.c | 37 | ||||
-rw-r--r-- | intl/localealias.c | 2 | ||||
-rw-r--r-- | intl/plural.y | 7 | ||||
-rw-r--r-- | intl/textdomain.c | 2 |
7 files changed, 47 insertions, 9 deletions
diff --git a/intl/bindtextdom.c b/intl/bindtextdom.c index 7de81c6cb5..45000a6b58 100644 --- a/intl/bindtextdom.c +++ b/intl/bindtextdom.c @@ -35,7 +35,7 @@ void free (); #else # include <strings.h> # ifndef memcpy -# define memcpy(Dst, Src, Num) bcopy (Src, Dst, Num) +# define memcpy(Dst, Src, Num) (bcopy (Src, Dst, Num), (Dst)) # endif #endif diff --git a/intl/finddomain.c b/intl/finddomain.c index dc215ad126..1109c5ebc0 100644 --- a/intl/finddomain.c +++ b/intl/finddomain.c @@ -21,8 +21,6 @@ # include <config.h> #endif -#include <ctype.h> -#include <errno.h> #include <stdio.h> #include <sys/types.h> @@ -41,7 +39,7 @@ void free (); #else # include <strings.h> # ifndef memcpy -# define memcpy(Dst, Src, Num) bcopy (Src, Dst, Num) +# define memcpy(Dst, Src, Num) (bcopy (Src, Dst, Num), (Dst)) # endif #endif diff --git a/intl/l10nflist.c b/intl/l10nflist.c index 4cd6615bac..2017311ab3 100644 --- a/intl/l10nflist.c +++ b/intl/l10nflist.c @@ -33,7 +33,7 @@ #else # include <strings.h> # ifndef memcpy -# define memcpy(Dst, Src, Num) bcopy (Src, Dst, Num) +# define memcpy(Dst, Src, Num) (bcopy (Src, Dst, Num), (Dst)) # endif #endif #if !HAVE_STRCHR && !defined _LIBC diff --git a/intl/loadmsgcat.c b/intl/loadmsgcat.c index 6b09815437..4e792d20cb 100644 --- a/intl/loadmsgcat.c +++ b/intl/loadmsgcat.c @@ -85,8 +85,11 @@ cached by one of GCC's features. */ int _nl_msg_cat_cntr; +#if defined __GNUC__ \ + || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L) + /* These structs are the constant expression for the germanic plural - form determination. */ + form determination. It represents the expression "n != 1". */ static const struct expression plvar = { .operation = var, @@ -111,6 +114,37 @@ static struct expression germanic_plural = } }; +#define INIT_GERMANIC_PLURAL() + +#else + +/* For compilers without support for ISO C 99 struct/union initializers: + Initialization at run-time. */ + +static struct expression plvar; +static struct expression plone; +static struct expression germanic_plural; + +static void +init_germanic_plural () +{ + if (plone.val.num == 0) + { + plvar.operation = var; + + plone.operation = num; + plone.val.num = 1; + + germanic_plural.operation = not_equal; + germanic_plural.val.args2.left = &plvar; + germanic_plural.val.args2.right = &plone; + } +} + +#define INIT_GERMANIC_PLURAL() init_germanic_plural () + +#endif + /* Load the message catalogs specified by FILENAME. If it is no valid message catalog do nothing. */ @@ -370,6 +404,7 @@ _nl_load_domain (domain_file) for `one', the plural form otherwise. Yes, this is also what English is using since English is a Germanic language. */ no_plural: + INIT_GERMANIC_PLURAL (); domain->plural = &germanic_plural; domain->nplurals = 2; } diff --git a/intl/localealias.c b/intl/localealias.c index 426db49b97..63e8069047 100644 --- a/intl/localealias.c +++ b/intl/localealias.c @@ -64,7 +64,7 @@ void free (); #else # include <strings.h> # ifndef memcpy -# define memcpy(Dst, Src, Num) bcopy (Src, Dst, Num) +# define memcpy(Dst, Src, Num) (bcopy (Src, Dst, Num), (Dst)) # endif #endif #if !HAVE_STRCHR && !defined _LIBC diff --git a/intl/plural.y b/intl/plural.y index c13dbafab8..32ad7515e5 100644 --- a/intl/plural.y +++ b/intl/plural.y @@ -18,6 +18,10 @@ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + #include <stdarg.h> #include <stdlib.h> #include "gettext.h" @@ -228,7 +232,8 @@ yylex (YYSTYPE *lval, const char **pexp) result = *exp++; switch (result) { - case '0' ... '9': + case '0': case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': { unsigned long int n = exp[-1] - '0'; while (exp[0] >= '0' && exp[0] <= '9') diff --git a/intl/textdomain.c b/intl/textdomain.c index fe9f171815..02f4a4bc0c 100644 --- a/intl/textdomain.c +++ b/intl/textdomain.c @@ -29,7 +29,7 @@ #else # include <strings.h> # ifndef memcpy -# define memcpy(Dst, Src, Num) bcopy (Src, Dst, Num) +# define memcpy(Dst, Src, Num) (bcopy (Src, Dst, Num), (Dst)) # endif #endif |