From 673fdf6d778614d291d139ed4beecea7df6a014d Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Wed, 26 Jan 2000 23:44:40 +0000 Subject: [PATCH] resolve.cc (get_ffi_type_from_signature): Handle case where boolean is an int. * resolve.cc (get_ffi_type_from_signature): Handle case where boolean is an int. From-SVN: r31637 --- libjava/ChangeLog | 5 +++++ libjava/resolve.cc | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 844b848b647..e3f2139e4b6 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,8 @@ +2000-01-26 Tom Tromey + + * resolve.cc (get_ffi_type_from_signature): Handle case where + boolean is an int. + Tue Jan 25 08:51:16 2000 Tom Tromey * interpret.cc (run): Don't call println. diff --git a/libjava/resolve.cc b/libjava/resolve.cc index ae8ae903a37..92d66c2728a 100644 --- a/libjava/resolve.cc +++ b/libjava/resolve.cc @@ -856,6 +856,16 @@ get_ffi_type_from_signature (unsigned char* ptr) break; case 'Z': + // On some platforms a bool is a byte, on others an int. + if (sizeof (jboolean) == sizeof (jbyte)) + return &ffi_type_sint8; + else + { + JvAssert (sizeof (jbyte) == sizeof (jint)); + return &ffi_type_sint32; + } + break; + case 'B': return &ffi_type_sint8; break;