From e5a1add3d6bc24eb554185bfd9b787c9e553c271 Mon Sep 17 00:00:00 2001 From: Kenneth Russel Date: Tue, 7 Feb 2006 04:11:51 +0000 Subject: Fixed build breakage on X11 platforms after change to GlueGen's argument name substitution to include offset arguments for arrays git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@586 232f8b59-042b-4e1e-8c03-345bb8c30851 --- make/glx-x11.cfg | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/make/glx-x11.cfg b/make/glx-x11.cfg index 801c035ee..5680a419a 100644 --- a/make/glx-x11.cfg +++ b/make/glx-x11.cfg @@ -27,14 +27,11 @@ CustomJavaCode GLX public static native long RootWindow(long display, int screen TemporaryCVariableDeclaration XGetVisualInfo int count; TemporaryCVariableAssignment XGetVisualInfo count = _ptr3[0]; ReturnValueCapacity XGetVisualInfo count * sizeof(XVisualInfo) -# FIXME: this is terrible but currently needed because we have two -# overloadings for the third argument (IntBuffer and int[]) and can't -# specify different glue code for different overloadings -# -# The NoNio directive which was present in an earlier version of -# GlueGen, which resolved this more cleanly, is also not yet available -# in this version. -ReturnedArrayLength XGetVisualInfo ((((Object) {3}) instanceof Buffer) ? ((IntBuffer) ((Object) {3})).get(0) : ((int[]) ((Object) {3}))[0]) + +# Helper routine to make the ReturnedArrayLength expression below work correctly +CustomJavaCode GLX private static int getFirstElement(IntBuffer buf) { return buf.get(buf.position()); } +CustomJavaCode GLX private static int getFirstElement(int[] arr, int offset) { return arr[offset]; } +ReturnedArrayLength XGetVisualInfo getFirstElement({3}) ReturnValueCapacity glXChooseVisual sizeof(XVisualInfo) ReturnValueCapacity glXGetVisualFromFBConfig sizeof(XVisualInfo) ReturnValueCapacity glXGetVisualFromFBConfigSGIX sizeof(XVisualInfo) -- cgit v1.2.3