A simple preprocessor question
A simple preprocessor question
- Subject: A simple preprocessor question
- From: Shamyl Zakariya <email@hidden>
- Date: Tue, 20 Mar 2007 13:17:02 -0400
I have a framework ( wrapping some base opengl functionality ) which
defines a macro which (in a debug build) queries for OpenGL errors,
and in a release build does nothing -- since querying for GL errors
is runtime expensive.
The macro looks like this:
#if DEBUG
#define glError() { \
GLenum err = glGetError(); \
while (err != GL_NO_ERROR) { \
printf("glError: %s caught at %s:%u\n", (char *)gluErrorString
(err), __FILE__, __LINE__); \
err = glGetError(); \
} \
}
#else
#define glError() ;
#endif
As far as I can tell, this used to work. In debug builds, the macro
expanded and would query for runtime errors. And in release builds,
it went away and my code ran quickly, like it should.
Now, at some recent point ( I can't say exactly when ) it began to
follow the #else path in both debug and release builds. I assume I'm
using the wrong preprocessor directive... so can anybody tell me how
better to bracket this?
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden