Complete.Org: Mailing Lists: Archives: freeciv-dev: April 2003:
[Freeciv-Dev] Re: (PR#4042) 1.14.0: gtk2 compile error with mingw32
Home

[Freeciv-Dev] Re: (PR#4042) 1.14.0: gtk2 compile error with mingw32

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients:;
Subject: [Freeciv-Dev] Re: (PR#4042) 1.14.0: gtk2 compile error with mingw32
From: "Per I. Mathisen" <per@xxxxxxxxxxx>
Date: Sun, 20 Apr 2003 13:54:46 -0700
Reply-to: rt@xxxxxxxxxxxxxx

On Sun, 20 Apr 2003, Per I. Mathisen wrote:
> connectdlg.c: In function `try_to_autoconnect':
> connectdlg.c:344: `ECONNREFUSED' undeclared (first use in this function)

This is my quick and dirty fix. It is by no means the final word on this
issue, but it will solve the immediate problem at hand.

  - Per

Index: client/clinet.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/clinet.c,v
retrieving revision 1.84
diff -u -r1.84 clinet.c
--- client/clinet.c     20 Apr 2003 19:26:17 -0000      1.84
+++ client/clinet.c     20 Apr 2003 20:52:22 -0000
@@ -184,7 +184,11 @@
     (void) mystrlcpy(errbuf, mystrerror(errno), errbufsize);
     my_closesocket(aconnection.sock);
     aconnection.sock = -1;
+#ifdef WIN32_NATIVE
+    return -1;
+#else
     return errno;
+#endif
   }
 
   if (aconnection.buffer) {
Index: client/gui-gtk/connectdlg.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk/connectdlg.c,v
retrieving revision 1.41
diff -u -r1.41 connectdlg.c
--- client/gui-gtk/connectdlg.c 12 Apr 2003 18:24:41 -0000      1.41
+++ client/gui-gtk/connectdlg.c 20 Apr 2003 20:52:22 -0000
@@ -357,6 +357,8 @@
   case 0:                      /* Success! */
     return FALSE;              /*  Tells GTK not to call this
                                   function again */
+#ifndef WIN32_NATIVE
+  /* See PR#4042 for more info on issues with try_to_connect() and errno. */
   case ECONNREFUSED:           /* Server not available (yet) */
     if (!warning_shown) {
       freelog(LOG_NORMAL, _("Connection to server refused. "
@@ -366,6 +368,7 @@
       warning_shown = 1;
     }
     return TRUE;               /*  Tells GTK to keep calling this function */
+#endif
   default:                     /* All other errors are fatal */
     freelog(LOG_FATAL,
            _("Error contacting server \"%s\" at port %d "
Index: client/gui-gtk-2.0/connectdlg.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk-2.0/connectdlg.c,v
retrieving revision 1.21
diff -u -r1.21 connectdlg.c
--- client/gui-gtk-2.0/connectdlg.c     17 Apr 2003 03:11:52 -0000      1.21
+++ client/gui-gtk-2.0/connectdlg.c     20 Apr 2003 20:52:22 -0000
@@ -363,6 +363,8 @@
   case 0:                      /* Success! */
     return FALSE;              /*  Tells GTK not to call this
                                   function again */
+#ifndef WIN32_NATIVE
+  /* See PR#4042 for more info on issues with try_to_connect() and errno. */
   case ECONNREFUSED:           /* Server not available (yet) */
     if (!warning_shown) {
       freelog(LOG_NORMAL, _("Connection to server refused. "
@@ -372,6 +374,7 @@
       warning_shown = 1;
     }
     return TRUE;               /*  Tells GTK to keep calling this function */
+#endif
   default:                     /* All other errors are fatal */
     freelog(LOG_FATAL,
            _("Error contacting server \"%s\" at port %d "

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] Re: (PR#4042) 1.14.0: gtk2 compile error with mingw32, Per I. Mathisen <=