[SciPy-dev] patch: allow arrayobject.h to compile in c++ compiler

Andrew Straw strawman at astraw.com
Tue Nov 22 01:20:12 CST 2005

Bool is defined in C++ compilers, so if arrayobject.h defines Bool, the
compiler issues an error: "redeclaration of C++ built-in type `int'".

And, in an apparent shortcoming of Trac, I can't seem to submit a
patch.  Is that really so?

Here's a patch which allows C++ source to be compiled against

Index: scipy/base/include/scipy/arrayobject.h
--- scipy/base/include/scipy/arrayobject.h      (revision 1517)
+++ scipy/base/include/scipy/arrayobject.h      (working copy)
@@ -103,7 +103,9 @@
 #  define ULONGLONG_SUFFIX(x) (x##UL)

+#ifndef Bool
 typedef unsigned char Bool;
 #ifndef FALSE
 #define FALSE 0

More information about the Scipy-dev mailing list