This is the mail archive of the
java-patches@sourceware.cygnus.com
mailing list for the Java project.
Re: in_addr_t is not defined on SunOS4...
On Aug 21, 1999, Alexandre Oliva <oliva@dcc.unicamp.br> wrote:
> On Aug 21, 1999, Alexandre Oliva <oliva@dcc.unicamp.br> wrote:
>> ... 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?
> After some research, I found out it was only typedef in sys/types.h on
> DU4.0d; I couldn't find it in any other platform I've got, so I'll
> assume it's safe to AC_CHECK_TYPE it.
The default type I had chosen in the posted patch, `struct in_addr',
would not work, since the code assumed an integral type, so I'm
installing this additional change, that makes in a `jint' that, as a
32bit value, should work perfectly well for an IPv4 address.
Index: configure.in
===================================================================
RCS file: /cvs/java/libgcj/libjava/configure.in,v
retrieving revision 1.11.2.9
diff -u -r1.11.2.9 configure.in
--- configure.in 1999/08/21 13:15:59 1.11.2.9
+++ configure.in 1999/08/21 13:31:07
@@ -518,7 +518,7 @@
AC_CHECK_HEADERS(dirent.h)
AC_CHECK_TYPE([ssize_t], [int])
-AC_CHECK_TYPE([in_addr_t], [struct in_addr])
+AC_CHECK_TYPE([in_addr_t], [jint])
AC_MSG_CHECKING([whether struct sockaddr_in6 is in netinet/in.h])
AC_TRY_COMPILE([#include <netinet/in.h>], [struct sockaddr_in6 addr6;],
Index: acconfig.h
===================================================================
RCS file: /cvs/java/libgcj/libjava/acconfig.h,v
retrieving revision 1.2.2.2
diff -u -r1.2.2.2 acconfig.h
--- acconfig.h 1999/08/21 13:15:58 1.2.2.2
+++ acconfig.h 1999/08/21 13:31:07
@@ -58,7 +58,7 @@
/* Define to `int' if `ssize_t' is not defined. */
#undef ssize_t
-/* Define to `struct in_addr' if `in_addr_t' is not defined. */
+/* Define to `jint' if `in_addr_t' is not defined. */
#undef in_addr_t
/* Define if inet6 structures are defined in netinet/in.h. */
--
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