Per title, this is an implementation of stdbool.h, to start off the
project of clang getting its own headers.  I picked stdbool.h because
it is one of the simplest standard headers, being that it only has
four straightforward macros.  It would be embarrassing if I screwed it
up somehow :)

I'm not completely sure if I got the license part right... is some
sort of special exception needed in the headers so programs compiled
with clang aren't under the clang license?

sabre indicated on IRC that he might get the build system and driver
and whatnot setup for clang to have its own headers sometime in the
near future, so I prepared this to allow for testing.

-Eli
Index: Headers/stdbool.h
===================================================================
--- Headers/stdbool.h   (revision 0)
+++ Headers/stdbool.h   (revision 0)
@@ -0,0 +1,19 @@
+/*===---- stdbool.h - Standard header for booleans -------------------------===
+ *
+ *                     The LLVM Compiler Infrastructure
+ *
+ * This file is distributed under the University of Illinois Open Source
+ * License. See LICENSE.TXT for details.
+ *
+ *===-----------------------------------------------------------------------===
+ */
+
+#ifndef __STDBOOL_H
+#define __STDBOOL_H
+
+#define bool _Bool
+#define true 1
+#define false 0
+#define __bool_true_false_are_defined 1
+
+#endif /* __STDBOOL_H */
_______________________________________________
cfe-dev mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev

Reply via email to