Francois Gouget : netstat: Fix compilation on systems that don' t support nameless unions.

Alexandre Julliard julliard at winehq.org
Mon Jan 7 13:42:20 CST 2013


Module: wine
Branch: master
Commit: ca9ceddd5ddf4aa549db5f0288420128eec62995
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=ca9ceddd5ddf4aa549db5f0288420128eec62995

Author: Francois Gouget <fgouget at free.fr>
Date:   Sat Jan  5 16:17:30 2013 +0100

netstat: Fix compilation on systems that don't support nameless unions.

---

 programs/netstat/netstat.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/programs/netstat/netstat.c b/programs/netstat/netstat.c
index a3f584c..4f29788 100644
--- a/programs/netstat/netstat.c
+++ b/programs/netstat/netstat.c
@@ -16,6 +16,7 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
+#define NONAMELESSUNION
 #include "netstat.h"
 #include <winsock2.h>
 #include <iphlpapi.h>
@@ -178,9 +179,9 @@ static void NETSTAT_tcp_table(void)
 
     for (i = 0; i < table->dwNumEntries; i++)
     {
-        if ((table->table[i].dwState ==  MIB_TCP_STATE_CLOSE_WAIT) ||
-            (table->table[i].dwState ==  MIB_TCP_STATE_ESTAB) ||
-            (table->table[i].dwState ==  MIB_TCP_STATE_TIME_WAIT))
+        if ((table->table[i].u.dwState ==  MIB_TCP_STATE_CLOSE_WAIT) ||
+            (table->table[i].u.dwState ==  MIB_TCP_STATE_ESTAB) ||
+            (table->table[i].u.dwState ==  MIB_TCP_STATE_TIME_WAIT))
         {
             NETSTAT_host_name(table->table[i].dwLocalAddr, HostIp);
             NETSTAT_port_name(table->table[i].dwLocalPort, HostPort);
@@ -189,7 +190,7 @@ static void NETSTAT_tcp_table(void)
 
             sprintfW(Host, fmtcolon, HostIp, HostPort);
             sprintfW(Remote, fmtcolon, RemoteIp, RemotePort);
-            NETSTAT_wprintf(fmttcpout, tcpW, Host, Remote, NETSTAT_load_message(table->table[i].dwState));
+            NETSTAT_wprintf(fmttcpout, tcpW, Host, Remote, NETSTAT_load_message(table->table[i].u.dwState));
         }
     }
     HeapFree(GetProcessHeap(), 0, table);




More information about the wine-cvs mailing list