]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Avoid name clash between functions defined in libc and functions defined in
authorBruno Haible <bruno@clisp.org>
Tue, 23 Jan 2001 17:23:30 +0000 (17:23 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 23 Jan 2001 17:23:30 +0000 (17:23 +0000)
libintl.

intl/ChangeLog
intl/gettextP.h
intl/loadmsgcat.c
intl/plural.y

index a34a2a44a84d067e4c2563ef51374654e7f06c93..c2ef102fae4687bd5361f84083427a23e8fcd737 100644 (file)
@@ -1,3 +1,11 @@
+2001-01-07  Bruno Haible  <haible@clisp.cons.org>
+
+       * gettextP.h (__gettextdebug): Remove declaration.
+       (gettext_free_exp__, gettextparse__): New non-libc declarations.
+       * plural.y [!_LIBC]: Define gettextparse__, gettext_free_exp__, not
+       __gettextparse, __gettext_free_exp.
+       * loadmsgcat.c [!_LIBC]: Use gettextparse__, not __gettextparse.
+
 2001-01-07  Bruno Haible  <haible@clisp.cons.org>
 
        * libgnuintl.h: Renamed from intlh.inst.in.
index b100e1fbd11e6d485b5e2ffc6a8854664832a64d..4505058b8acb894437d20105d4b6f2efc795a72d 100644 (file)
@@ -224,10 +224,15 @@ extern char *bind_textdomain_codeset__ PARAMS ((const char *__domainname,
                                                const char *__codeset));
 #endif
 
-extern int __gettextdebug;
+#ifdef _LIBC
 extern void __gettext_free_exp PARAMS ((struct expression *exp))
      internal_function;
 extern int __gettextparse PARAMS ((void *arg));
+#else
+extern void gettext_free_exp__ PARAMS ((struct expression *exp))
+     internal_function;
+extern int gettextparse__ PARAMS ((void *arg));
+#endif
 
 /* @@ begin of epilog @@ */
 
index 34f1e661a39b927063d9241e305ebd1111b4de72..d8c397235dd9793e6741478cb35e1ab858a60250 100644 (file)
@@ -89,6 +89,16 @@ char *alloca ();
 # define munmap __munmap
 #endif
 
+/* Names for the libintl functions are a problem.  They must not clash
+   with existing names and they should follow ANSI C.  But this source
+   code is also used in GNU C Library where the names have a __
+   prefix.  So we have to make a difference here.  */
+#ifdef _LIBC
+# define PLURAL_PARSE __gettextparse
+#else
+# define PLURAL_PARSE gettextparse__
+#endif
+
 /* For those losing systems which don't have `alloca' we have to add
    some additional code emulating it.  */
 #ifdef HAVE_ALLOCA
@@ -431,7 +441,7 @@ _nl_load_domain (domain_file)
             is passed down to the parser.  */
          plural += 7;
          args.cp = plural;
-         if (__gettextparse (&args) != 0)
+         if (PLURAL_PARSE (&args) != 0)
            goto no_plural;
          domain->plural = args.res;
        }
index 1407afee52cbf77089c4e95a5486c9769b993fbe..54dc7b257465b15865c9ed0168f8c260c1d49720 100644 (file)
 #include <stdlib.h>
 #include "gettextP.h"
 
+/* Names for the libintl functions are a problem.  They must not clash
+   with existing names and they should follow ANSI C.  But this source
+   code is also used in GNU C Library where the names have a __
+   prefix.  So we have to make a difference here.  */
+#ifdef _LIBC
+# define FREE_EXPRESSION __gettext_free_exp
+#else
+# define FREE_EXPRESSION gettext_free_exp__
+# define __gettextparse gettextparse__
+#endif
+
 #define YYLEX_PARAM    &((struct parse_args *) arg)->cp
 #define YYPARSE_PARAM  arg
 %}
@@ -166,8 +177,8 @@ new_exp_2 (op, left, right)
     }
   else
     {
-      __gettext_free_exp (left);
-      __gettext_free_exp (right);
+      FREE_EXPRESSION (left);
+      FREE_EXPRESSION (right);
     }
 
   return newp;
@@ -194,9 +205,9 @@ new_exp_3 (op, bexp, tbranch, fbranch)
     }
   else
     {
-      __gettext_free_exp (bexp);
-      __gettext_free_exp (tbranch);
-      __gettext_free_exp (fbranch);
+      FREE_EXPRESSION (bexp);
+      FREE_EXPRESSION (tbranch);
+      FREE_EXPRESSION (fbranch);
     }
 
   return newp;
@@ -204,7 +215,7 @@ new_exp_3 (op, bexp, tbranch, fbranch)
 
 void
 internal_function
-__gettext_free_exp (exp)
+FREE_EXPRESSION (exp)
      struct expression *exp;
 {
   if (exp == NULL)
@@ -214,7 +225,7 @@ __gettext_free_exp (exp)
   switch (exp->operation)
     {
     case qmop:
-      __gettext_free_exp (exp->val.args3.fbranch);
+      FREE_EXPRESSION (exp->val.args3.fbranch);
       /* FALLTHROUGH */
 
     case mult:
@@ -226,8 +237,8 @@ __gettext_free_exp (exp)
     case not_equal:
     case land:
     case lor:
-      __gettext_free_exp (exp->val.args2.right);
-      __gettext_free_exp (exp->val.args2.left);
+      FREE_EXPRESSION (exp->val.args2.right);
+      FREE_EXPRESSION (exp->val.args2.left);
       break;
 
     default: