Complete.Org: Mailing Lists: Archives: freeciv-dev: May 2004:
[Freeciv-Dev] (PR#8706) freeciv won't compile for win32
Home

[Freeciv-Dev] (PR#8706) freeciv won't compile for win32

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#8706) freeciv won't compile for win32
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Sat, 8 May 2004 12:14:06 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=8706 >

This patch fixes it, as well as fixing two related stylistic problems.

- winsock.h is needed in netintf.h.

- min_free_port has been renamed as find_next_free_port.  I think Raimar 
and I both thought this function was static so we didn't notice the 
prototype or the user in gui-win32.

- 5555 shouldn't be hard-coded in find_next_free_port.  Instead use 
DEFAULT_SOCK_PORT.

- The min_free_port prototype is removed.

I will apply immediately.

jason

? diff
Index: client/connectdlg_common.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/connectdlg_common.c,v
retrieving revision 1.11
diff -u -r1.11 connectdlg_common.c
--- client/connectdlg_common.c  4 May 2004 16:57:58 -0000       1.11
+++ client/connectdlg_common.c  8 May 2004 19:11:19 -0000
@@ -145,7 +145,7 @@
   append_output_window(_("Starting server..."));
 
   /* find a free port */ 
-  server_port = find_next_free_port(5555);
+  server_port = find_next_free_port(DEFAULT_SOCK_PORT);
 
   server_pid = fork();
   
Index: client/connectdlg_common.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/connectdlg_common.h,v
retrieving revision 1.2
diff -u -r1.2 connectdlg_common.h
--- client/connectdlg_common.h  1 May 2004 17:33:01 -0000       1.2
+++ client/connectdlg_common.h  8 May 2004 19:11:19 -0000
@@ -23,8 +23,6 @@
 void client_kill_server(void);
 bool is_server_running(void);
 
-int min_free_port(void);
-
 void send_client_wants_hack(char *filename);
 void send_start_saved_game(void);
 void send_save_game(char *filename);
Index: client/gui-win32/connectdlg.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-win32/connectdlg.c,v
retrieving revision 1.19
diff -u -r1.19 connectdlg.c
--- client/gui-win32/connectdlg.c       10 Apr 2004 11:23:01 -0000      1.19
+++ client/gui-win32/connectdlg.c       8 May 2004 19:11:19 -0000
@@ -849,7 +849,7 @@
 static void start_server_for_new_game(void)
 {
   char cmdline[512];
-  server_port=min_free_port();
+  server_port = find_next_free_port(DEFAULT_SOCK_PORT);
   my_snprintf(cmdline,sizeof(cmdline),"civserver -p %d",server_port);
   start_server(cmdline);   
 }
@@ -937,7 +937,7 @@
 static void start_server_load_game(char *filename)
 {
   char cmdline[512];
-  server_port=min_free_port();
+  server_port = find_next_free_port(DEFAULT_SOCK_PORT);
   my_snprintf(cmdline,sizeof(cmdline),"civserver -p %d -f \"%s\"",
              server_port,filename);
   start_server(cmdline);
Index: utility/netintf.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/utility/netintf.h,v
retrieving revision 1.10
diff -u -r1.10 netintf.h
--- utility/netintf.h   4 May 2004 16:57:59 -0000       1.10
+++ utility/netintf.h   8 May 2004 19:11:20 -0000
@@ -36,6 +36,9 @@
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
+#ifdef HAVE_WINSOCK
+# include <winsock.h>
+#endif
 
 #include "ioz.h"
 #include "shared.h"            /* bool type */

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#8706) freeciv won't compile for win32, Jason Short <=