libcdio-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Libcdio-devel] modifications of ISO9660 and UDF headers for MSVC


From: Robert William Fuller
Subject: Re: [Libcdio-devel] modifications of ISO9660 and UDF headers for MSVC
Date: Tue, 31 Jan 2012 06:27:50 -0500
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110719 Lightning/1.0b3pre Thunderbird/3.1.10

On 01/29/2012 12:39 PM, Pete Batard wrote:
> Two additional patches that modify the ISO9660 and UDF headers for MSVC
> usage.
> 
> The most controversial has to be the ISO9660 as MSVC simply cannot use a
> zero sized array, even at the end of a struct, if that struct is going
> to be included in the middle of another.
> 
> Therefore, instead of defining:
> 
>      iso711_t filename_len;
>      char     filename[];
> 
> We leverage the fact that iso711_t and char are the same size and the
> following union:
> 
> union {
>      iso711_t        len;
>      char            str[1];
> } filename;

Pete,

A flashback from my Windows NT driver writing days:  I seem to recall
that MSVC will allow "char str[0]" here.  You can have a zero-length
array at the end of a structure as long as the size is explicitly zero.
 It's just done with "str[0]" instead of "str[]"?

Rob



reply via email to

[Prev in Thread] Current Thread [Next in Thread]