* resolve.cc (get_ffi_type_from_signature): Handle case where
authortromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 26 Jan 2000 23:44:40 +0000 (23:44 +0000)
committertromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 26 Jan 2000 23:44:40 +0000 (23:44 +0000)
boolean is an int.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@31637 138bc75d-0d04-0410-961f-82ee72b054a4

libjava/ChangeLog
libjava/resolve.cc

index 844b848..e3f2139 100644 (file)
@@ -1,3 +1,8 @@
+2000-01-26  Tom Tromey  <tromey@cygnus.com>
+
+       * resolve.cc (get_ffi_type_from_signature): Handle case where
+       boolean is an int.
+
 Tue Jan 25 08:51:16 2000  Tom Tromey  <tromey@ferrule.cygnus.com>
 
        * interpret.cc (run): Don't call println.
index ae8ae90..92d66c2 100644 (file)
@@ -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;