[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

proposed Autoconf patch to help fix gettext compatibility problem

From: Paul Eggert
Subject: proposed Autoconf patch to help fix gettext compatibility problem
Date: Fri, 9 Nov 2001 19:33:38 -0800 (PST)

I had a problem when compiling a test version of Bash.  It uses
gettext, and the problem was that gettext headers contained code like this:

#ifndef PARAMS
# if __STDC__ || defined __cplusplus
#  define PARAMS(args) args
# else
#  define PARAMS(args) ()
# endif

and this doesn't work as desired on Solaris, where __STDC__ is 0.

I asked Bruno Haible to append "|| PROTOTYPES" to this for the benefit
of Autoconf AC_C_PROTOTYPES users like Bash, and he replied that he
couldn't do that because it would infringe on the user namespace.
(These headers are system headers in some context.)

But he did agree to try to append "|| __PROTOTYPES" instead, as this
can't infringe on the user namespace.  Here is a proposed patch to
Autoconf to support this new feature of gettext.

(Personally, I am starting to assume at least C89, but I realize that
not everybody has that luxury.  :-)

2001-11-08  Paul Eggert  <address@hidden>

        * lib/autoconf/c.m4 (AC_C_PROTOTYPES): Define __PROTOTYPES too.
        * doc/autoconf.texi (C Compiler): AC_C_PROTOTYPES now defines
        __PROTOTYPES too.

diff -pru autoconf/doc/autoconf.texi autoconf-prototypes/doc/autoconf.texi
--- autoconf/doc/autoconf.texi  Thu Nov  8 10:29:01 2001
+++ autoconf-prototypes/doc/autoconf.texi       Fri Nov  9 19:22:02 2001
@@ -4784,9 +4784,11 @@ found in macros such as this:
 @acindex C_PROTOTYPES
 @cvindex PROTOTYPES
address@hidden __PROTOTYPES
 @cvindex PARAMS
 Check to see if function prototypes are understood by the compiler.  If
-so, define @samp{PROTOTYPES}.  In the case the compiler does not handle
+so, define @code{PROTOTYPES} and @code{__PROTOTYPES}.
+In the case the compiler does not handle
 prototypes, you should use @code{ansi2knr}, which comes with the
 Automake distribution, to unprotoize function definitions.  For
 function prototypes, you should first define @code{PARAMS}:
@@ -4809,6 +4811,9 @@ size_t my_strlen PARAMS ((const char *))
 @end example
 @end defmac
+This macro also defines @code{__PROTOTYPES}; this is for the benefit of
+header files that cannot use macros that infringe on user name space.
 @ovindex CC
diff -pru autoconf/lib/autoconf/c.m4 autoconf-prototypes/lib/autoconf/c.m4
--- autoconf/lib/autoconf/c.m4  Sat Sep 22 08:20:45 2001
+++ autoconf-prototypes/lib/autoconf/c.m4       Fri Nov  9 19:23:46 2001
@@ -1068,6 +1068,8 @@ if test "$ac_cv_prog_cc_stdc" != no; the
             [Define if the C compiler supports function prototypes.])
+            [Define like PROTOTYPES; this can be used by system headers.])

reply via email to

[Prev in Thread] Current Thread [Next in Thread]