This is the mail archive of the java-patches@sourceware.cygnus.com 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]

in_addr_t is not defined on SunOS4...


... and inet_addr was assumed to return such a type.  I've hacked it
to explicitly use the return type of inet_addr (__typeof) to
initialize laddr, because I'm not sure in_addr_t is supposed to be
defined in sys/types.h on all platforms in which it would be useful.
Does anybody have an authoritative information?

Here's the patch.  Installed in branch and mainline.  (SunOS4 is
almost getting there!)

Index: libjava/ChangeLog
from  Alexandre Oliva  <oliva@dcc.unicamp.br>
	* java/net/natInetAddress.cc (aton, HAVE_INET_ADDR): Typedef
	in_addr_t to the return type of inet_addr, just in case it is not
	defined.
	
Index: libjava/java/net/natInetAddress.cc
===================================================================
RCS file: /cvs/java/libgcj/libjava/java/net/natInetAddress.cc,v
retrieving revision 1.6.2.1
diff -u -r1.6.2.1 natInetAddress.cc
--- libjava/java/net/natInetAddress.cc	1999/08/01 00:14:00	1.6.2.1
+++ libjava/java/net/natInetAddress.cc	1999/08/21 12:34:29
@@ -71,6 +71,10 @@
       blen = 4;
     }
 #elif defined(HAVE_INET_ADDR)
+  /* FIXME.  On SunOS4, in_addr_t is not defined, and inet_addr
+     returns struct in_addr.  Should we detect it in configure?  Which
+     header files?  */
+  typedef __typeof(inet_addr (hostname)) in_addr_t;
   in_addr_t laddr = inet_addr (hostname);
   if (laddr != (in_addr_t)(-1))
     {

-- 
Alexandre Oliva http://www.dcc.unicamp.br/~oliva IC-Unicamp, Bra[sz]il
oliva@{dcc.unicamp.br,guarana.{org,com}} aoliva@{acm.org,computer.org}
oliva@{gnu.org,kaffe.org,{egcs,sourceware}.cygnus.com,samba.org}
** I may forward mail about projects to mailing lists; please use them

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