summary refs log tree commit diff
path: root/intl/loadmsgcat.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2001-01-05 05:52:11 +0000
committerUlrich Drepper <drepper@redhat.com>2001-01-05 05:52:11 +0000
commit61402fd68972a73caa984ab03199bf05e18b73e5 (patch)
tree8438ac7b2ba82a76226bb2588a74c33ee629f578 /intl/loadmsgcat.c
parent03fbfeb50862cc05552c55c20207d54889416628 (diff)
downloadglibc-61402fd68972a73caa984ab03199bf05e18b73e5.tar.gz
glibc-61402fd68972a73caa984ab03199bf05e18b73e5.tar.xz
glibc-61402fd68972a73caa984ab03199bf05e18b73e5.zip
Update.
2000-07-31  Bruno Haible  <haible@clisp.cons.org>

	* intl/plural.y: Include config.h. Needed to define 'inline' away for
	C compilers that don't support it.
	(yylex): Don't use gcc specific case range syntax.
	* intl/loadmsgcat.c (INIT_GERMANIC_PLURAL): New macro, for old
	compilers.

2000-10-12  Bruno Haible  <haible@clisp.cons.org>

	* intl/finddomain.c: Remove unneeded includes.

2000-10-12  Bruno Haible  <haible@clisp.cons.org>

	* intl/localealias.c (memcpy): Return first argument, just like the
	real memcpy function does.
	* intl/bindtextdom.c (memcpy): Likewise.
	* intl/finddomain.c (memcpy): Likewise.
	* intl/l10nflist.c (memcpy): Likewise.
	* intl/textdomain.c (memcpy): Likewise.
	From Paul Eggert <eggert@twinsun.com>.
Diffstat (limited to 'intl/loadmsgcat.c')
-rw-r--r--intl/loadmsgcat.c37
1 files changed, 36 insertions, 1 deletions
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;
     }