On Tue, 11 Sep 2018 14:07:04 +0100, Stuart Henderson wrote: > FreeBSD have this commit to their openttd port: > > : Update of LLVM components in -head to version 5.0.0 apparently had broken > : OpenTTD due to a conflict of ``type'' being defined (differently) and used > : in both libc++ and the game itself: > : > : In file included from /usr/include/c++/v1/math.h:310: > : /usr/include/c++/v1/limits:234:95: error: member reference base type 'int' > : is not a structure or union > : _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() > : _NOEXCEPT {return type(0);} > : > : .../openttd-1.7.1/src/3rdparty/squirrel/squirrel/sqobject.h:99:25: note: > : expanded from macro 'type' > : #define type(obj) ((obj)._type) > : > : Mend the problem by #includ'ing <math.h> prior to Squirrel's (programming > : language OpenTTD uses internally for scripting). > : > : Reported by: pkg-fallout > > This affects openttd and supertux in our tree with the WIP libc++ diff, > same change fixes both. > > OK?
I cannot test it right now, but if this fixes it, OK (for supertux). > Index: supertux/patches/patch-external_squirrel_squirrel_sqvm_cpp > =================================================================== > RCS file: supertux/patches/patch-external_squirrel_squirrel_sqvm_cpp > diff -N supertux/patches/patch-external_squirrel_squirrel_sqvm_cpp > --- /dev/null 1 Jan 1970 00:00:00 -0000 > +++ supertux/patches/patch-external_squirrel_squirrel_sqvm_cpp 11 Sep > 2018 13:03:29 -0000 > @@ -0,0 +1,17 @@ > +$OpenBSD$ > + > +Unbreak with newer libc++. FreeBSD r447202 > + > +Index: external/squirrel/squirrel/sqvm.cpp > +--- external/squirrel/squirrel/sqvm.cpp.orig > ++++ external/squirrel/squirrel/sqvm.cpp > +@@ -1,8 +1,8 @@ > + /* > + see copyright notice in squirrel.h > + */ > +-#include "sqpcheader.h" > + #include <math.h> > ++#include "sqpcheader.h" > + #include <stdlib.h> > + #include "sqopcodes.h" > + #include "sqvm.h" > Index: openttd/patches/patch-src_3rdparty_squirrel_squirrel_sqvm_cpp > =================================================================== > RCS file: openttd/patches/patch-src_3rdparty_squirrel_squirrel_sqvm_cpp > diff -N openttd/patches/patch-src_3rdparty_squirrel_squirrel_sqvm_cpp > --- /dev/null 1 Jan 1970 00:00:00 -0000 > +++ openttd/patches/patch-src_3rdparty_squirrel_squirrel_sqvm_cpp 11 Sep > 2018 13:03:29 -0000 > @@ -0,0 +1,18 @@ > +$OpenBSD$ > + > +Unbreak with newer libc++. FreeBSD r447202 > + > +Index: src/3rdparty/squirrel/squirrel/sqvm.cpp > +--- src/3rdparty/squirrel/squirrel/sqvm.cpp.orig > ++++ src/3rdparty/squirrel/squirrel/sqvm.cpp > +@@ -4,9 +4,9 @@ > + > + #include "../../../stdafx.h" > + > ++#include <math.h> > + #include <squirrel.h> > + #include "sqpcheader.h" > +-#include <math.h> > + #include "sqopcodes.h" > + #include "sqfuncproto.h" > + #include "sqvm.h" >