libgcj/226: Fails to compile: "implicit declaration of function`int __builtin_expect(...)"

Gregory R. Warnes warnes@biostat.washington.edu
Thu May 18 14:50:00 GMT 2000


The following reply was made to PR libgcj/226; it has been noted by GNATS.

From: "Gregory R. Warnes" <warnes@biostat.washington.edu>
To: java-gnats@sourceware.cygnus.com, tromey@cygnus.com
Cc:  
Subject: Re: libgcj/226: Fails to compile: "implicit declaration of function
 `int __builtin_expect(...)"
Date: Thu, 18 May 2000 21:46:07 +0000 (GMT)

 Temporary workaround: #define it.  (patch below)
 
 It would probably be a good idea to add an autoconf test for
 __builtin_expect .  If the verfion of gcc doesn't know about it, then use
 the #define.  I'd give it a whack, but I've never touched autoconf.
 
 I did do an altavista search, and such a test turns up in the libc config
 script at  http://mirror.schell.de/libc/configure .
 
 -Greg
 
 --- libgcj/libjava/java/lang/Class.h-orig	Thu May 18 14:36:09 2000
 +++ libgcj/libjava/java/lang/Class.h	Thu May 18 14:35:25 2000
 @@ -18,6 +18,10 @@
  #include <java/lang/String.h>
  #include <java/net/URL.h>
  
 +#ifndef HAVE_BUILTIN_EXPECT
 +#define  __builtin_expect( stmt, flag ) (stmt)
 +#endif
 +
  // We declare these here to avoid including gcj/cni.h.
  extern "C" void _Jv_InitClass (jclass klass);
  extern "C" void _Jv_RegisterClasses (jclass *classes);
 
 
 


More information about the Java-prs mailing list