Compile errors with latest Xcode/clang

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
swdr
Posts: 2
Joined: Sun Jul 08, 2012 8:41 am

Compile errors with latest Xcode/clang

Post by swdr »

I couldn't compile the latest trunk using the latest version of Xcode and clang. Here is a patch to fix the two issues.

Code: Select all

diff --git a/source/Irrlicht/COpenGLExtensionHandler.h b/source/Irrlicht/COpenGLExtensionHandler.h
index 9ca7a31..6a0b9d5 100644
--- a/source/Irrlicht/COpenGLExtensionHandler.h
+++ b/source/Irrlicht/COpenGLExtensionHandler.h
@@ -2367,7 +2367,7 @@ inline void COpenGLExtensionHandler::extGlProgramParameteri(GLhandleARB program,
 #elif defined(GL_ARB_geometry_shader4)
    glProgramParameteriARB(program, pname, value);
 #elif defined(GL_EXT_geometry_shader4)
-   glProgramParameteriEXT((long GLuint)program, pname, value);
+   glProgramParameteriEXT((GLuint)(uintptr_t)program, pname, value);
 #elif defined(GL_NV_geometry_program4) || defined(GL_NV_geometry_shader4)
    glProgramParameteriNV(program, pname, value);
 #else
diff --git a/source/Irrlicht/MacOSX/CIrrDeviceMacOSX.h b/source/Irrlicht/MacOSX/CIrrDeviceMacOSX.h
index 4e452be..45ea701 100644
--- a/source/Irrlicht/MacOSX/CIrrDeviceMacOSX.h
+++ b/source/Irrlicht/MacOSX/CIrrDeviceMacOSX.h
@@ -19,9 +19,15 @@
 #include <OpenGL/OpenGL.h>
 #include <map>
 
+#if defined( __OBJC__ )
+@class NSWindow;
+@class NSOpenGLContext;
+@class NSBitmapImageRep;
+#else
 class NSWindow;
 class NSOpenGLContext;
 class NSBitmapImageRep;
+#endif
 
 namespace irr
 {
 
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: Compile errors with latest Xcode/clang

Post by hendu »

That double cast looks ugly, is it really necessary?
CuteAlien
Admin
Posts: 9809
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Compile errors with latest Xcode/clang

Post by CuteAlien »

Also a C99 type, I know we have 2012 and C99 sounds it should work everywhere this days, but I remember that last time I thought so (maybe 2-4 years ago) I still run into some platform where it caused trouble (don't remember anymore which one). Compiling certainly has to be fixed (but not by me as I can't test that platform).

Anyway, I'm moving this to bugreports, thanks for reporting.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: Compile errors with latest Xcode/clang

Post by hendu »

Just say Visual Studio, we all know you mean it :)
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Re: Compile errors with latest Xcode/clang

Post by Nadro »

This bug exist in a 32 or 64 bytes of compilation mode? I checked trunk with XCode 4.1 and it worked fine, but it looks like I will have to check it one more time. Thanks for report.
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: Compile errors with latest Xcode/clang

Post by hybrid »

This is a weird type problem in the OpenGL specs. I think we might have to do some more ifdefs and mayv´be drop support for one of the extension methods.
swdr
Posts: 2
Joined: Sun Jul 08, 2012 8:41 am

Re: Compile errors with latest Xcode/clang

Post by swdr »

I tried compiling in 64 bit mode with Xcode 4.3.3 (using clang 3.1). Sorry, should have added that information right from the beginning.

I see that the double cast is rather ugly and not really necessary, my mistake. Also I didn't realize that those C99 types still are an issue on some compilers.
Post Reply