From: Bruno Haible Date: Tue, 23 Jan 2001 17:23:30 +0000 (+0000) Subject: Avoid name clash between functions defined in libc and functions defined in X-Git-Tag: v0.10.36~178 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=66465dca1a55e2082adb562f2925bd02cb5180e4;p=thirdparty%2Fgettext.git Avoid name clash between functions defined in libc and functions defined in libintl. --- diff --git a/intl/ChangeLog b/intl/ChangeLog index a34a2a44a..c2ef102fa 100644 --- a/intl/ChangeLog +++ b/intl/ChangeLog @@ -1,3 +1,11 @@ +2001-01-07 Bruno Haible + + * 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 * libgnuintl.h: Renamed from intlh.inst.in. diff --git a/intl/gettextP.h b/intl/gettextP.h index b100e1fbd..4505058b8 100644 --- a/intl/gettextP.h +++ b/intl/gettextP.h @@ -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 @@ */ diff --git a/intl/loadmsgcat.c b/intl/loadmsgcat.c index 34f1e661a..d8c397235 100644 --- a/intl/loadmsgcat.c +++ b/intl/loadmsgcat.c @@ -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; } diff --git a/intl/plural.y b/intl/plural.y index 1407afee5..54dc7b257 100644 --- a/intl/plural.y +++ b/intl/plural.y @@ -24,6 +24,17 @@ #include #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: