This is the mail archive of the
mailing list for the Cygwin project.
Re: Make ip.h and tcp.h work under -fnative-struct or -fms-bitfields
- From: Wu Yongwei <adah at netstd dot com>
- To: cygwin-patches <cygwin-patches at cygwin dot com>
- Date: Mon, 28 Oct 2002 17:38:15 +0800
- Subject: Re: Make ip.h and tcp.h work under -fnative-struct or -fms-bitfields
- Organization: Kingnet Security, Inc.
Oops, what kind of problem can occur? I did not think of that. But I
suppose u_char is symmetric with other definitions, and it always works
for me under GCC or MSVC (while __attribute__((packed)) works only for GCC).
--- Original Message from Danny Smith ---
--- Wu Yongwei <firstname.lastname@example.org> wrote:
> These header files use "u_int xxx:4, yyy:4", which in the MS convetion
> will generate 4-byte instead of 1-byte bit fields.
> 2002-10-28 Wu Yongwei <email@example.com>
> * ip.h (struct ip): Use u_char to indicate bitfields to make it
> work with -fnative-struct/-fms-bitfields.
> (struct ip_timestamp): Ditto.
> * tcp.h (struct tcphdr): Ditto.
Changing types like that can cause problems.
Wouldn't it be better to just use __attribute__((packed)) to pack the