Complete.Org: Mailing Lists: Archives: freeciv-dev: March 2005:
[Freeciv-Dev] (PR#12519) socklen_t error
Home

[Freeciv-Dev] (PR#12519) socklen_t error

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#12519) socklen_t error
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 15 Mar 2005 18:51:04 -0800
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=12519 >

Apparently socklen_t (part of C99) isn't available on some platforms. 
This patch adds a configure check.

I also removed a VMS special case.  If this special case is ever needed 
again it should use a configure check not a platform check.

-jason

? diff
Index: configure.ac
===================================================================
RCS file: /home/freeciv/CVS/freeciv/configure.ac,v
retrieving revision 1.95
diff -u -r1.95 configure.ac
--- configure.ac        13 Mar 2005 17:55:15 -0000      1.95
+++ configure.ac        16 Mar 2005 02:49:25 -0000
@@ -490,6 +490,7 @@
 AC_C_CONST
 AC_HEADER_TIME
 AC_STRUCT_TM
+AC_CHECK_TYPES([socklen_t])
 
 dnl Checks for library functions.
 AC_TYPE_SIGNAL
Index: server/sernet.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/sernet.c,v
retrieving revision 1.138
diff -u -r1.138 sernet.c
--- server/sernet.c     14 Mar 2005 21:34:27 -0000      1.138
+++ server/sernet.c     16 Mar 2005 02:49:26 -0000
@@ -715,12 +715,13 @@
 ********************************************************************/
 static int server_accept_connection(int sockfd)
 {
-
-# if defined(__VMS) && !defined(_DECC_V4_SOURCE)
-    size_t fromlen;
-# else
+  /* This used to have size_t for some platforms.  If this is necessary
+   * it should be done with a configure check not a platform check. */
+#ifdef HAVE_SOCKLEN_T
   socklen_t fromlen;
-# endif
+#else
+  int fromlen;
+#endif
 
   int new_sock;
   union my_sockaddr fromend;

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#12519) socklen_t error, Jason Short <=