[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
ncurses: <stdbool.h>
From: |
Ralf S. Engelschall |
Subject: |
ncurses: <stdbool.h> |
Date: |
Sat, 21 Oct 2006 10:08:20 +0200 |
User-agent: |
Mutt/1.5.13 OpenPKG/CURRENT (2006-08-11) |
NCurses determines the presence of the <stdbool.h> header during its
own build time but the result is used in a public header <curses.h>.
It cannot be assumed that the application building against this public
header <curses.h> also uses the same compiler NCurses was built with.
Hence the public header <curses.h> has to perform an own in-place check
for <stdbool.h>. This way NCurses can be build with OpenPKG's GCC 3.x
while an application could build against the provided <curses.h> with an
arbitrary C compiler (usually a non-GCC 3.x vendor compiler!).
The following patch we are using in the OpenPKG "ncurses" package (see
http://www.openpkg.org/product/packages/?package=ncurses) for over 2
years now with perfect portability results on _all_ major Unix platforms
(OpenPKG is a cross-platform software distribution).
Index: include/curses.h.in
--- include/curses.h.in.orig 2004-02-22 09:36:58.000000000 +0100
+++ include/curses.h.in 2004-02-22 09:37:14.000000000 +0100
@@ -61,7 +61,11 @@
* User-definable tweak to disable the include of <stdbool.h>.
*/
#ifndef NCURSES_ENABLE_STDBOOL_H
-#define NCURSES_ENABLE_STDBOOL_H @cf_cv_header_stdbool_h@
+#if defined(__STDC__) && (__STDC_VERSION__ >= 199901L) && !defined(__osf__)
+#define NCURSES_ENABLE_STDBOOL_H 1
+#else
+#define NCURSES_ENABLE_STDBOOL_H 0
+#endif
#endif
Ralf S. Engelschall
address@hidden
www.engelschall.com
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- ncurses: <stdbool.h>,
Ralf S. Engelschall <=