From: Bruno Haible Date: Sat, 10 Nov 2001 00:26:33 +0000 (+0000) Subject: Make PARAMS work better on Solaris. X-Git-Tag: v0.11~312 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=16fc59ed82f19035c88eb0f72899ca669655d405;p=thirdparty%2Fgettext.git Make PARAMS work better on Solaris. --- diff --git a/ChangeLog b/ChangeLog index d086616d3..45cc9baa7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2001-11-10 Bruno Haible + + * acconfig.h (PARAMS): Also test for __GNUC__, __SUNPRO_C, __cplusplus + and __PROTOTYPES because on 64-bit Solaris, we need prototypes + although __STDC__ is often defined to 0. __GNUC__ covers GCC, + __SUNPRO_C covers Sun cc, regardless of compilation flags. + __PROTOTYPES, __cplusplus are just for consistency with libgnuintl.h. + 2001-11-03 Bruno Haible * ltmain.sh: chmod 777 the .libs directory, so that "make install" diff --git a/acconfig.h b/acconfig.h index 68847033f..9238b0a41 100644 --- a/acconfig.h +++ b/acconfig.h @@ -6,7 +6,7 @@ #define DEFAULT_OUTPUT_ALIGNMENT 1 #ifndef PARAMS -# if __STDC__ +# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES # define PARAMS(args) args # else # define PARAMS(args) () diff --git a/intl/ChangeLog b/intl/ChangeLog index e14a7639f..b86d004d3 100644 --- a/intl/ChangeLog +++ b/intl/ChangeLog @@ -1,3 +1,20 @@ +2001-11-10 Bruno Haible + + * libgnuintl.h (_INTL_PARAMS): Renamed from PARAMS, to avoid polluting + the user's namespace. + Also test for __GNUC__, __SUNPRO_C and __PROTOTYPES because on + 64-bit Solaris, we need prototypes although __STDC__ is often defined + to 0. __GNUC__ covers GCC, __SUNPRO_C covers Sun cc, regardless of + compilation flags. __PROTOTYPES covers other compilers when compiling + programs using autoconf's AC_C_PROTOTYPES. + * gettextP.h (PARAMS): Also test for __SUNPRO_C, because 64-bit Solaris + cc needs prototypes although it defines __STDC__ to 0 by default. + Also test for __cplusplus and __PROTOTYPES, just for consistency with + libgnuintl.h. + * hash-string.h (PARAMS): Likewise. + * loadinfo.h (PARAMS): Likewise. + * plural-exp.h (PARAMS): Likewise. + 2001-10-31 Bruno Haible * plural.y: Include , needed for NULL with SunOS 4 cc. diff --git a/intl/gettextP.h b/intl/gettextP.h index c4a3ee9d8..bf77e5658 100644 --- a/intl/gettextP.h +++ b/intl/gettextP.h @@ -37,7 +37,7 @@ /* @@ end of prolog @@ */ #ifndef PARAMS -# if __STDC__ +# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES # define PARAMS(args) args # else # define PARAMS(args) () diff --git a/intl/hash-string.h b/intl/hash-string.h index ccb7acca6..b267a8778 100644 --- a/intl/hash-string.h +++ b/intl/hash-string.h @@ -19,7 +19,7 @@ /* @@ end of prolog @@ */ #ifndef PARAMS -# if __STDC__ +# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES # define PARAMS(Args) Args # else # define PARAMS(Args) () diff --git a/intl/libgnuintl.h b/intl/libgnuintl.h index f891deb96..7fd547ef0 100644 --- a/intl/libgnuintl.h +++ b/intl/libgnuintl.h @@ -42,11 +42,13 @@ # define gettext gettext #endif -#ifndef PARAMS -# if __STDC__ || defined __cplusplus -# define PARAMS(args) args +/* Use _INTL_PARAMS, not PARAMS, in order to avoid clashes with identifiers + used by programs. Similarly, test __PROTOTYPES, not PROTOTYPES. */ +#ifndef _INTL_PARAMS +# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES +# define _INTL_PARAMS(args) args # else -# define PARAMS(args) () +# define _INTL_PARAMS(args) () # endif #endif @@ -57,49 +59,56 @@ extern "C" { /* Look up MSGID in the current default message catalog for the current LC_MESSAGES locale. If not found, returns MSGID itself (the default text). */ -extern char *gettext PARAMS ((const char *__msgid)); +extern char *gettext _INTL_PARAMS ((const char *__msgid)); /* Look up MSGID in the DOMAINNAME message catalog for the current LC_MESSAGES locale. */ -extern char *dgettext PARAMS ((const char *__domainname, const char *__msgid)); +extern char *dgettext _INTL_PARAMS ((const char *__domainname, + const char *__msgid)); /* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY locale. */ -extern char *dcgettext PARAMS ((const char *__domainname, const char *__msgid, - int __category)); +extern char *dcgettext _INTL_PARAMS ((const char *__domainname, + const char *__msgid, + int __category)); /* Similar to `gettext' but select the plural form corresponding to the number N. */ -extern char *ngettext PARAMS ((const char *__msgid1, const char *__msgid2, - unsigned long int __n)); +extern char *ngettext _INTL_PARAMS ((const char *__msgid1, + const char *__msgid2, + unsigned long int __n)); /* Similar to `dgettext' but select the plural form corresponding to the number N. */ -extern char *dngettext PARAMS ((const char *__domainname, const char *__msgid1, - const char *__msgid2, unsigned long int __n)); +extern char *dngettext _INTL_PARAMS ((const char *__domainname, + const char *__msgid1, + const char *__msgid2, + unsigned long int __n)); /* Similar to `dcgettext' but select the plural form corresponding to the number N. */ -extern char *dcngettext PARAMS ((const char *__domainname, const char *__msgid1, - const char *__msgid2, unsigned long int __n, - int __category)); +extern char *dcngettext _INTL_PARAMS ((const char *__domainname, + const char *__msgid1, + const char *__msgid2, + unsigned long int __n, + int __category)); /* Set the current default message catalog to DOMAINNAME. If DOMAINNAME is null, return the current default. If DOMAINNAME is "", reset to the default of "messages". */ -extern char *textdomain PARAMS ((const char *__domainname)); +extern char *textdomain _INTL_PARAMS ((const char *__domainname)); /* Specify that the DOMAINNAME message catalog will be found in DIRNAME rather than in the system locale data base. */ -extern char *bindtextdomain PARAMS ((const char *__domainname, - const char *__dirname)); +extern char *bindtextdomain _INTL_PARAMS ((const char *__domainname, + const char *__dirname)); /* Specify the character encoding in which the messages from the DOMAINNAME message catalog will be returned. */ -extern char *bind_textdomain_codeset PARAMS ((const char *__domainname, - const char *__codeset)); +extern char *bind_textdomain_codeset _INTL_PARAMS ((const char *__domainname, + const char *__codeset)); /* Optimized version of the functions above. */ diff --git a/intl/loadinfo.h b/intl/loadinfo.h index f1abe8ef2..d180962f5 100644 --- a/intl/loadinfo.h +++ b/intl/loadinfo.h @@ -33,7 +33,7 @@ */ #ifndef PARAMS -# if __STDC__ +# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES # define PARAMS(args) args # else # define PARAMS(args) () diff --git a/intl/plural-exp.h b/intl/plural-exp.h index 52eec48b6..a4b8e965d 100644 --- a/intl/plural-exp.h +++ b/intl/plural-exp.h @@ -21,7 +21,7 @@ #define _PLURAL_EXP_H #ifndef PARAMS -# if __STDC__ +# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES # define PARAMS(args) args # else # define PARAMS(args) () diff --git a/lib/ChangeLog b/lib/ChangeLog index 5550aef02..539b0f166 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,22 @@ +2001-11-10 Bruno Haible + + * argmatch.h (PARAMS): Also test for __SUNPRO_C, because 64-bit Solaris + cc needs prototypes although it defines __STDC__ to 0 by default. + Also test for __cplusplus and __PROTOTYPES, just for consistency with + libgnuintl.h. + * c-ctype.h (PARAMS): Likewise. + * gcd.h (PARAMS): Likewise. + * getline.h (PARAMS): Likewise. + * hash.h (PARAMS): Likewise. + * linebreak.h (PARAMS): Likewise. + * mbswidth.h (PARAMS): Likewise. + * mkdtemp.h (PARAMS): Likewise. + * setenv.h (PARAMS): Likewise. + * strpbrk.h (PARAMS): Likewise. + * strstr.h (PARAMS): Likewise. + * system.h (PARAMS): Likewise. + * tmpdir.h (PARAMS): Likewise. + 2001-11-05 Bruno Haible * tmpdir.c: Include string.h. diff --git a/lib/argmatch.h b/lib/argmatch.h index 32b318b33..380985ea9 100644 --- a/lib/argmatch.h +++ b/lib/argmatch.h @@ -28,11 +28,11 @@ # include # ifndef PARAMS -# if PROTOTYPES || (defined (__STDC__) && __STDC__) +# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES # define PARAMS(args) args # else # define PARAMS(args) () -# endif /* GCC. */ +# endif /* ANSI C. */ # endif /* Not PARAMS. */ /* Assert there are as many real arguments as there are values diff --git a/lib/c-ctype.h b/lib/c-ctype.h index 919710262..64222c59b 100644 --- a/lib/c-ctype.h +++ b/lib/c-ctype.h @@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define C_CTYPE_H #ifndef PARAMS -# if defined (__GNUC__) || __STDC__ +# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES # define PARAMS(args) args # else # define PARAMS(args) () diff --git a/lib/gcd.h b/lib/gcd.h index 8fadde2ec..37ff21ea5 100644 --- a/lib/gcd.h +++ b/lib/gcd.h @@ -20,7 +20,7 @@ #define _GCD_H #ifndef PARAMS -# if defined (__GNUC__) || __STDC__ +# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES # define PARAMS(args) args # else # define PARAMS(args) () diff --git a/lib/getline.h b/lib/getline.h index a2aa231df..5d3458020 100644 --- a/lib/getline.h +++ b/lib/getline.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1995, 2000 Free Software Foundation, Inc. +/* Copyright (C) 1995, 2000, 2001 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 @@ -20,7 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ # include # ifndef PARAMS -# if defined (__GNUC__) || __STDC__ +# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES # define PARAMS(args) args # else # define PARAMS(args) () diff --git a/lib/hash.h b/lib/hash.h index c6ce3e015..d568c11e9 100644 --- a/lib/hash.h +++ b/lib/hash.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1995, 2000 Free Software Foundation, Inc. +/* Copyright (C) 1995, 2000, 2001 Free Software Foundation, Inc. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as @@ -31,7 +31,7 @@ typedef struct hash_table hash_table; # ifndef PARAMS -# if defined (__GNUC__) || __STDC__ +# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES # define PARAMS(Args) Args # else # define PARAMS(Args) () diff --git a/lib/linebreak.h b/lib/linebreak.h index 5c7b7e732..f45e80e19 100644 --- a/lib/linebreak.h +++ b/lib/linebreak.h @@ -20,7 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define _LINEBREAK_H #ifndef PARAMS -# if defined (__GNUC__) || __STDC__ +# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES # define PARAMS(args) args # else # define PARAMS(args) () diff --git a/lib/mbswidth.h b/lib/mbswidth.h index 7b2482a54..1f9c66001 100644 --- a/lib/mbswidth.h +++ b/lib/mbswidth.h @@ -18,7 +18,7 @@ #include #ifndef PARAMS -# if defined (__GNUC__) || __STDC__ +# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES # define PARAMS(Args) Args # else # define PARAMS(Args) () diff --git a/lib/mkdtemp.h b/lib/mkdtemp.h index b56128eb0..dbc47ac36 100644 --- a/lib/mkdtemp.h +++ b/lib/mkdtemp.h @@ -16,7 +16,7 @@ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef PARAMS -# if defined (__GNUC__) || __STDC__ +# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES # define PARAMS(Args) Args # else # define PARAMS(Args) () diff --git a/lib/setenv.h b/lib/setenv.h index df8fa83fb..26eec1067 100644 --- a/lib/setenv.h +++ b/lib/setenv.h @@ -16,7 +16,7 @@ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef PARAMS -# if defined (__GNUC__) || __STDC__ +# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES # define PARAMS(Args) Args # else # define PARAMS(Args) () diff --git a/lib/strpbrk.h b/lib/strpbrk.h index bc01c3d65..67aa525d9 100644 --- a/lib/strpbrk.h +++ b/lib/strpbrk.h @@ -16,7 +16,7 @@ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef PARAMS -# if defined (__GNUC__) || __STDC__ +# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES # define PARAMS(Args) Args # else # define PARAMS(Args) () diff --git a/lib/strstr.h b/lib/strstr.h index 5b897579a..0162d0971 100644 --- a/lib/strstr.h +++ b/lib/strstr.h @@ -16,7 +16,7 @@ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef PARAMS -# if defined (__GNUC__) || __STDC__ +# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES # define PARAMS(Args) Args # else # define PARAMS(Args) () diff --git a/lib/system.h b/lib/system.h index 966aa3de8..47c19804c 100644 --- a/lib/system.h +++ b/lib/system.h @@ -19,7 +19,7 @@ #define _SYSTEM_H 1 #ifndef PARAMS -# if defined (__GNUC__) || __STDC__ +# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES # define PARAMS(args) args # else # define PARAMS(args) () diff --git a/lib/tmpdir.h b/lib/tmpdir.h index 8fe7c31c5..2a8a37d66 100644 --- a/lib/tmpdir.h +++ b/lib/tmpdir.h @@ -16,7 +16,7 @@ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef PARAMS -# if defined (__GNUC__) || __STDC__ +# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES # define PARAMS(Args) Args # else # define PARAMS(Args) ()