autoconf-patches
[Top][All Lists]
Advanced

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

Re: AC_DEFINE defaulting to 1


From: Akim Demaille
Subject: Re: AC_DEFINE defaulting to 1
Date: 12 Sep 2002 15:20:11 +0200
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Honest Recruiter)

| > From: Akim Demaille <address@hidden>
| > Date: 11 Sep 2002 17:23:02 +0200
| > 
| > I think the doc should be fixed: I see no reason to prevent someone
| > from just defining to nothing :(
| 
| I too have been confused by this in the past, so I installed the
| following doc patch.
| 
| 2002-09-11  Paul Eggert  <address@hidden>
| 
|       * doc/autoconf.texi (Defining Symbols): Explain that
|       AC_DEFINE(var) defaults to 1, but AC_DEFINE(var,,description) does
|       not; and the AC_DEFINE(var) case is obsolescent.
| 
| Index: autoconf.texi
| ===================================================================
| RCS file: /cvsroot/autoconf/autoconf/doc/autoconf.texi,v
| retrieving revision 1.671
| retrieving revision 1.672
| diff -p -u -r1.671 -r1.672
| --- autoconf.texi     11 Sep 2002 10:11:27 -0000      1.671
| +++ autoconf.texi     11 Sep 2002 19:03:59 -0000      1.672
| @@ -6087,8 +6087,7 @@ output.
|  
|  @defmac AC_DEFINE (@var{variable}, @ovar{value}, @ovar{description})
|  @acindex DEFINE
| -Define C preprocessor variable @var{variable}.  If @var{value} is given,
| -set @var{variable} to that value (verbatim), otherwise set it to 1.
| +Define the C preprocessor variable @var{variable} to @var{value} (verbatim).
|  @var{value} should not contain literal newlines, and if you are not
|  using @code{AC_CONFIG_HEADERS} it should not contain any @samp{#}
|  characters, as @command{make} tends to eat them.  To use a shell variable
| @@ -6103,6 +6102,12 @@ The following example defines the C prep
|  @example
|  AC_DEFINE(EQUATION, "$a > $b")
|  @end example
| +
| +If neither @var{value} nor @var{description} are given, then
| address@hidden defaults to 1 instead of to the empty string.  This is for
| +backwards compatiblity with older versions of Autoconf, but this usage
| +is obsolescent and may be withdrawn in future versions of Autoconf.
| +
|  @end defmac
|  
|  @defmac AC_DEFINE_UNQUOTED (@var{variable}, @ovar{value}, @ovar{description})

Which I patched too :)


Index: ChangeLog
from  Akim Demaille  <address@hidden>

        * doc/autoconf.texi (Defining Symbols): Present two different
        prototypes for AC_DEFINE and AC_DEFINE_UNQUOTED to emphasize the
        difference between 1 argument calls, and 2-3 argument calls.

Index: doc/autoconf.texi
===================================================================
RCS file: /cvsroot/autoconf/autoconf/doc/autoconf.texi,v
retrieving revision 1.675
diff -u -u -r1.675 autoconf.texi
--- doc/autoconf.texi 12 Sep 2002 13:15:41 -0000 1.675
+++ doc/autoconf.texi 12 Sep 2002 13:21:59 -0000
@@ -6088,7 +6088,8 @@
 @xref{Configuration Headers}, for more information about this kind of
 output.
 
address@hidden AC_DEFINE (@var{variable}, @ovar{value}, @ovar{description})
address@hidden AC_DEFINE (@var{variable}, @var{value}, @ovar{description})
address@hidden AC_DEFINE (@var{variable})
 @acindex DEFINE
 Define the C preprocessor variable @var{variable} to @var{value} (verbatim).
 @var{value} should not contain literal newlines, and if you are not
@@ -6110,10 +6111,10 @@
 @var{value} defaults to 1 instead of to the empty string.  This is for
 backwards compatibility with older versions of Autoconf, but this usage
 is obsolescent and may be withdrawn in future versions of Autoconf.
-
 @end defmac
 
address@hidden AC_DEFINE_UNQUOTED (@var{variable}, @ovar{value}, 
@ovar{description})
address@hidden AC_DEFINE_UNQUOTED (@var{variable}, @var{value}, 
@ovar{description})
address@hidden AC_DEFINE_UNQUOTED (@var{variable})
 @acindex DEFINE_UNQUOTED
 Like @code{AC_DEFINE}, but three shell expansions are
 performed---once---on @var{variable} and @var{value}: variable expansion





BTW, I never really considered making it obsolescent, but indeed, it
would be nice as this macro do not behavior like the others do.  If we
really mean to make it obsolete, in the near future, we should add a
warning on 1 argument calls.




reply via email to

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