This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix build failure on non-C99 targets


Hello,

Libjava builds are again broken on non-C99 targets.  The following patch is 
sufficient to restore them.  Tested on sparc64-sun-solaris2.9 and 
sparc-sun-solaris2.[5678].  Is it good enough?


2004-11-28  Eric Botcazou  <ebotcazou@libertysurf.fr>

	* link.cc (link_symbol_table): Do not use intptr_t.


-- 
Eric Botcazou
Index: link.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/link.cc,v
retrieving revision 1.3
diff -u -p -r1.3 link.cc
--- link.cc	27 Nov 2004 12:37:31 -0000	1.3
+++ link.cc	28 Nov 2004 21:25:47 -0000
@@ -1073,7 +1073,7 @@ _Jv_Linker::link_symbol_table (jclass kl
       if (found)
 	{
 	  klass->itable->addresses[index * 2] = cls;
-	  klass->itable->addresses[index * 2 + 1] = (void *)(intptr_t) i;
+	  klass->itable->addresses[index * 2 + 1] = (void *)(unsigned long) i;
 	  if (debug_link)
 	    {
 	      fprintf (stderr, "  interfaces[%d] = %p (interface %s@%p : %s(%s))\n",
@@ -1085,7 +1085,7 @@ _Jv_Linker::link_symbol_table (jclass kl
 		       (const char*)signature->chars());
 	      fprintf (stderr, "            [%d] = offset %d\n",
 		       index + 1,
-		       (int)(intptr_t)klass->itable->addresses[index * 2 + 1]);
+		       (int)(unsigned long)klass->itable->addresses[index * 2 + 1]);
 	    }
 
 	}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]