mojoshader_opengl.c
branchtrunk
changeset 363 bea8bf9e5536
parent 362 1aa8a74bb5a5
child 388 5930c6cd840e
--- a/mojoshader_opengl.c	Wed Jun 18 01:22:34 2008 -0400
+++ b/mojoshader_opengl.c	Wed Jun 18 01:24:47 2008 -0400
@@ -302,7 +302,12 @@
 
 static void lookup_entry_points(void *(*lookup)(const char *fnname))
 {
-    #define DO_LOOKUP(ext, typ, fn) ctx->fn = (typ) loadsym(lookup, #fn, &ctx->have_##ext)
+    #define DO_LOOKUP(ext, typ, fn) { \
+        int exist = ctx->have_##ext; \
+        ctx->fn = (typ) loadsym(lookup, #fn, &exist); \
+        ctx->have_##ext = exist; \
+    }
+
     DO_LOOKUP(base_opengl, PFNGLGETSTRINGPROC, glGetString);
     DO_LOOKUP(base_opengl, PFNGLGETERRORPROC, glGetError);
     DO_LOOKUP(base_opengl, PFNGLGETINTEGERVPROC, glGetIntegerv);