PATCH: dlls/iphlpapi/ipstats.c -- fix build breakage

Juan Lang juan_lang at yahoo.com
Sat Jun 7 15:31:27 CDT 2003


Good thinking.  Haven't patched yet, but I wanted to
mention:  there is an equivalent under Solaris and the
BSDs, where TCP_FIN_WAIT is replaced by TCPS_FIN_WAIT,
TCP_SYN_SENT by TCPS_SYN_SENT and so on.

--Juan

--- Gerald Pfeifer <pfeifer at dbai.tuwien.ac.at> wrote:
> This is part 2 of 2 of my series of patches to fix
> the build breakage
> introduced by the addition of dlls/iphlpapi.
> 
> TCP_ESTABLISHED and the like are completely
> Linux-specific, but still a
> feature test as in my patch below seems preferrable
> to allow for future
> changes in other systems.
> 
> Gerald
> 
> ChangeLog:
> In getTcpTable(), guard Linux-specific constants by
> #ifdef.
> 
> Index: ipstats.c
>
===================================================================
> RCS file: /home/wine/wine/dlls/iphlpapi/ipstats.c,v
> retrieving revision 1.2
> diff -u -3 -p -r1.2 ipstats.c
> --- ipstats.c	13 May 2003 23:37:29 -0000	1.2
> +++ ipstats.c	15 May 2003 08:42:29 -0000
> @@ -781,41 +781,62 @@ PMIB_TCPTABLE
> getTcpTable(void)
>  #if HAVE_NETINET_TCP_H
>              switch (state)
>              {
> +#ifdef TCP_ESTABLISHED
>                case TCP_ESTABLISHED:
>                 
> ret->table[ret->dwNumEntries].dwState =
> MIB_TCP_STATE_ESTAB;
>                  break;
> +#endif
> +#ifdef TCP_SYN_SEND
>                case TCP_SYN_SENT:
>                 
> ret->table[ret->dwNumEntries].dwState =
> MIB_TCP_STATE_SYN_SENT;
>                  break;
> +#endif
> +#ifdef TCP_SYN_RECV
>                case TCP_SYN_RECV:
>                 
> ret->table[ret->dwNumEntries].dwState =
> MIB_TCP_STATE_SYN_RCVD;
>                  break;
> +#endif
> +#ifdef TCP_FIN_WAIT1
>                case TCP_FIN_WAIT1:
>                 
> ret->table[ret->dwNumEntries].dwState =
> MIB_TCP_STATE_FIN_WAIT1;
>                  break;
> +#endif
> +#ifdef TCP_FIN_WAIT2
>                case TCP_FIN_WAIT2:
>                 
> ret->table[ret->dwNumEntries].dwState =
> MIB_TCP_STATE_FIN_WAIT2;
>                  break;
> +#endif
> +#ifdef TCP_TIME_WAIT
>                case TCP_TIME_WAIT:
>                 
> ret->table[ret->dwNumEntries].dwState =
> MIB_TCP_STATE_TIME_WAIT;
>                  break;
> +#endif
> +#ifdef TCP_CLOSE
>                case TCP_CLOSE:
>                 
> ret->table[ret->dwNumEntries].dwState =
> MIB_TCP_STATE_CLOSED;
>                  break;
> +#endif
> +#ifdef TCP_CLOSE_WAIT
>                case TCP_CLOSE_WAIT:
>                 
> ret->table[ret->dwNumEntries].dwState =
>                   MIB_TCP_STATE_CLOSE_WAIT;
>                  break;
> +#endif
> +#ifdef TCP_LAST_ACK
>                case TCP_LAST_ACK:
>                 
> ret->table[ret->dwNumEntries].dwState =
> MIB_TCP_STATE_LAST_ACK;
>                  break;
> +#endif
> +#ifdef TCP_LISTEN
>                case TCP_LISTEN:
>                 
> ret->table[ret->dwNumEntries].dwState =
> MIB_TCP_STATE_LISTEN;
>                  break;
> +#endif
> +#ifdef TCP_CLOSING
>                case TCP_CLOSING:
>                 
> ret->table[ret->dwNumEntries].dwState =
> MIB_TCP_STATE_CLOSING;
>                  break;
> -
> +#endif
>              }
>  #endif
>              ptr = endPtr;


__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com



More information about the wine-patches mailing list