mex should treat C files as C++

Thomas Weber thomas.weber.mail at gmail.com
Thu Jan 8 15:25:26 CST 2009


On Thu, Jan 08, 2009 at 04:25:55PM +0100, Thomas Weber wrote:
> Am Donnerstag, den 08.01.2009, 16:00 +0100 schrieb Søren Hauberg:
> > tor, 08 01 2009 kl. 05:54 -0800, skrev dbateman:
> > > true and false are not valid C keywords. Adding
> > > 
> > > #define true 1
> > > #define false 0
> > > 
> > > somewhere, but keep compiling the code with gcc would be a cleaner solution.
> > 
> > Okay, so I tried compiling the offending code in Matlab, and it breaks
> > there as well. I've been struck by this problem with many peoples mex
> > code so I thought Matlab did something weird like always compiling with
> > a C++ compiler, but it turns out they don't. I guess Visual Studio
> > allows this behaviour which just makes people sloppy.
> 
> You can include stdlib.h.

Urgs, that should be stdbool.h.

	Thomas


More information about the Bug-octave mailing list