[Top][All Lists]

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

Re: Macro to test for stdbool.h

From: Paul Eggert
Subject: Re: Macro to test for stdbool.h
Date: Wed, 7 Nov 2001 12:05:37 -0800 (PST)

I very much like the idea of having a macro like this, but I worry
about the fact that it creates a file stdbool.h.  Suppose that file is
left around from a previous build: won't that possibly screw up the
next build if it doesn't want stdbool.h?  Surely the output file
should be removed before the test is run; it should also be removed if
config.status is run.

Also, the shell var STDBOOL_H doesn't seem right: shouldn't it have a
reserved prefix?  And I don't see how it's propagated from configure
to config.status.

There also seem to be some m4 quoting issues, as usual....

Some minor quibbles.  Please replace:

#ifdef __BEOS__
# undef false
# undef true


#ifdef false
# undef false
#ifdef true
# undef true

so that the code is not BeOS-specific.

The following code seems pretty verbose:

#if false
int A[-1];
#define b -1
#if true
#undef b
#define b 1
int B[b];

and also it doesn't check that bool is defined and is a valid type.
Wouldn't the following be shorter and clearer?

bool a1[false || !true ? -1 : 1];
#if !defined false || !true || !defined bool
int a2[-1];

The documentation is a little unclear and its indexing isn't right.
Here's a suggested rewrite:

@defmac AC_HEADER_STDBOOL (@var{directory})
If @file{stdbool.h} does not work correctly, create a file
@address@hidden/stdbool.h} (default @file{./stdbool.h}) that
does work.  This macro invokes @code{AC_CONFIG_COMMANDS} so it
is an instantiating macro; see @ref{Configuration Actions}.
@end defmac

reply via email to

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