glx: gcc 2.95 build fix (move declaration before code)
authorBrian Paul <brianp@vmware.com>
Sun, 18 Jan 2009 16:59:07 +0000 (09:59 -0700)
committerBrian Paul <brianp@vmware.com>
Sun, 18 Jan 2009 17:00:34 +0000 (10:00 -0700)
Adapted from patch by Matthieu Herbb <matthieu.herrb@laas.fr>

src/glx/x11/glxcmds.c

index 1d373ed29d81bea9ec76403b50107b76eeca9b90..c68b6ac4efef75bec5d2197e9737d3f64722a1d6 100644 (file)
@@ -864,6 +864,12 @@ PUBLIC void glXSwapBuffers(Display *dpy, GLXDrawable drawable)
     GLXContext gc;
     GLXContextTag tag;
     CARD8 opcode;
+#ifdef USE_XCB
+    xcb_connection_t *c;
+#else
+    xGLXSwapBuffersReq *req;
+#endif
+
 #ifdef GLX_DIRECT_RENDERING
     __GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, drawable, NULL);
 
@@ -892,12 +898,10 @@ PUBLIC void glXSwapBuffers(Display *dpy, GLXDrawable drawable)
     }
 
 #ifdef USE_XCB
-    xcb_connection_t* c = XGetXCBConnection(dpy);
+    c = XGetXCBConnection(dpy);
     xcb_glx_swap_buffers(c, tag, drawable);
     xcb_flush(c);
 #else
-    xGLXSwapBuffersReq *req;
-
     /* Send the glXSwapBuffers request */
     LockDisplay(dpy);
     GetReq(GLXSwapBuffers,req);