From f11944754972ffc2389c052f8e659af456f8dac0 Mon Sep 17 00:00:00 2001 From: "Adi Shavit @ MacBookPro" Date: Mon, 25 Jul 2016 16:33:25 +0300 Subject: [PATCH] Fixes compilation on OSX with gcc. - The symbol `typeof` collides with a non-standard gcc "keyword". See https://gcc.gnu.org/onlinedocs/gcc/Typeof.html - Renamed to `type_of`. --- code/PlyExporter.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/code/PlyExporter.cpp b/code/PlyExporter.cpp index af4d0d372..1d14c9219 100644 --- a/code/PlyExporter.cpp +++ b/code/PlyExporter.cpp @@ -56,11 +56,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. //using namespace Assimp; namespace Assimp { -// make sure typeof returns consistent output across different platforms +// make sure type_of returns consistent output across different platforms // also consider using: typeid(VAR).name() -template const char* typeof(T&) { return "unknown"; } -template<> const char* typeof(float&) { return "float"; } -template<> const char* typeof(double&) { return "double"; } +template const char* type_of(T&) { return "unknown"; } +template<> const char* type_of(float&) { return "float"; } +template<> const char* type_of(double&) { return "double"; } // ------------------------------------------------------------------------------------------------ // Worker function for exporting a scene to PLY. Prototyped and registered in Exporter.cpp @@ -146,7 +146,7 @@ PlyExporter::PlyExporter(const char* _filename, const aiScene* pScene, bool bina // definitely not good to always write float even if we might have double precision ai_real tmp = 0.0; - const char * typeName = typeof(tmp); + const char * typeName = type_of(tmp); mOutput << "element vertex " << vertices << endl; mOutput << "property " << typeName << " x" << endl;