glx: Fix build and warnings with -Dglx=dri -Dglx-direct=false
[mesa.git] / src / mapi / glapi / gen / glX_proto_send.py
index a269ff2068d412c9190dee6993e067d37fd556c7..a55c737d03e1ab87925f3cf3d39f7f2ecaa5650f 100644 (file)
@@ -441,10 +441,8 @@ __indirect_get_proc_address(const char *name)
                 print('#define %s %d' % (func.opcode_vendor_name(name), func.glx_vendorpriv))
                 print('%s gl%s(%s)' % (func.return_type, func_name, func.get_parameter_string()))
                 print('{')
-                print('    struct glx_context * const gc = __glXGetCurrentContext();')
-                print('')
                 print('#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)')
-                print('    if (gc->isDirect) {')
+                print('    if (((struct glx_context *)__glXGetCurrentContext())->isDirect) {')
                 print('        const _glapi_proc *const disp_table = (_glapi_proc *)GET_DISPATCH();')
                 print('        PFNGL%sPROC p =' % (name.upper()))
                 print('            (PFNGL%sPROC) disp_table[%d];' % (name.upper(), func.offset))