diff options
-rw-r--r-- | src/java/com/sun/gluegen/JavaEmitter.java | 4 | ||||
-rw-r--r-- | test/junit/com/sun/gluegen/test.c | 3 | ||||
-rw-r--r-- | test/junit/com/sun/gluegen/test.h | 3 |
3 files changed, 10 insertions, 0 deletions
diff --git a/src/java/com/sun/gluegen/JavaEmitter.java b/src/java/com/sun/gluegen/JavaEmitter.java index f25c738..2a51a64 100644 --- a/src/java/com/sun/gluegen/JavaEmitter.java +++ b/src/java/com/sun/gluegen/JavaEmitter.java @@ -1279,6 +1279,10 @@ public class JavaEmitter implements GlueEmitter { if (targetType.isVoid()) { return JavaType.createForVoidPointer(); } else if (targetType.isInt()) { + // size_t is always a PointerBuffer since size is arch dependent + if ("size_t".equals(targetType.getName())) { + return JavaType.forNIOPointerBufferClass(); + } switch ((int) targetType.getSize(curMachDesc)) { case 1: return JavaType.createForCCharPointer(); case 2: return JavaType.createForCShortPointer(); diff --git a/test/junit/com/sun/gluegen/test.c b/test/junit/com/sun/gluegen/test.c index 06d5508..c511a53 100644 --- a/test/junit/com/sun/gluegen/test.c +++ b/test/junit/com/sun/gluegen/test.c @@ -8,6 +8,9 @@ int bufferTest(void * object) { return 42; } +void pbTest(size_t * object) { +} + int manyBuffersTest(void * object1, void * object2, void * object3, void * object4, void * object5) { return 42; } diff --git a/test/junit/com/sun/gluegen/test.h b/test/junit/com/sun/gluegen/test.h index 10399a6..cef2b7e 100644 --- a/test/junit/com/sun/gluegen/test.h +++ b/test/junit/com/sun/gluegen/test.h @@ -2,11 +2,14 @@ #define AL_FLANGER_DEFAULT_FEEDBACK (-0.5f) typedef unsigned long foo; +typedef unsigned long size_t; int arrayTest(long context, foo * array ); int bufferTest(void * object); +void pbTest(size_t * object); + int manyBuffersTest(void * object1, void * object2, void * object3, void * object4, void * object5); int mixedTest(long context, void * object, foo * array ); |