[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-gnulib] Rewrite stdbool_.h during build?
From: |
Bruno Haible |
Subject: |
Re: [Bug-gnulib] Rewrite stdbool_.h during build? |
Date: |
Fri, 23 Apr 2004 21:57:08 +0200 |
User-agent: |
KMail/1.5 |
Derek Robert Price wrote:
> Is there a good reason that the stdbool module uses sed to rewrite the
> @HAVE__BOOL@ tag into a 0 or 1 when creating stdbool.h using a
> $(HAVE__BOOL) variable subbed into the Makefile via m4/stdbool.m4
> rather than just AC_DEFINEing HAVE__BOOL in the usual idiom?
The reason is that I plan to install stdbool.h alongside with some libraries
whose declares functions have 'bool' as argument or return type. I haven't
done it so far (gettext-po.h has some functions returning 'int' where they
actually should return 'bool'), but someday I'll do it.
Also it obviates the need for
#include "config.h"
in sources that only include standard header files: <stdio.h>, <stdbool.h>, ...
> M$VC++, as one might expect of any compiler, not just an M$ tool,
> breaks when it sees:
>
> #if !@HAVE__BOOL@
> . . .
Why would you feed the unpreprocessed file into the C compiler?
> Windows doesn't have any standard file search/replace tool like sed,
> so it would be much easier if I could just copy the file stdbool_.h
> file to stdbool.h on that platform to avoid creating new tool
> dependencies in the CVS build.
gettext distributes all Windows specific infrastructure in a directory
called windows/, all OS/2 specific infrastructure in a directory os2/,
etc. Part of this infrastructure is an stdbool.h file. The makefile
just has to add a -I..\windows to the command line, and everything is
fine without any preprocessing or file copying. You can do the same.
> Would a patch to switch over to #ifdef HAVE__BOOL be accceptable?
No, I'm not inclined to reduce the general reliability and ease-of-use
of our <stdbool.h> substitute for the sake of minimizing the effort
to port to a particular non-POSIX environment. - What would autoconf
and automake look like if the requirement was that the generated
configure files come in .bat syntax and that the Makefiles are also
acceptable to 'nmake'?
Bruno