request.h: size of unnamed array is negative
Charles Davis
cdavis5x at gmail.com
Sat Apr 13 23:21:21 CDT 2013
On Apr 13, 2013, at 9:40 PM, Hugh McMaster wrote:
> Am 13.04.2013 15:39, schrieb Hugh McMaster:
>> I've been adding a new handler to Wine's server. Unfortunately, I've run into a problem with C_ASSERT that I can't seem to resolve.
>>
>> In server/request.h, I've added the following code:
>>
>> C_ASSERT( FIELD_OFFSET(struct get_desktop_workarea_request, spi_workarea) == 16 );
>> C_ASSERT( sizeof(struct get_desktop_workarea_request) == 16 );
>> C_ASSERT( FIELD_OFFSET(struct get_desktop_workarea_reply, screen_x) == 4 );
>> C_ASSERT( FIELD_OFFSET(struct get_desktop_workarea_reply, screen_y) == 4 );
>> C_ASSERT( sizeof(struct get_desktop_workarea_reply) == 8 );
>>
>> But the compiler ends with output errors, as in the following:
>>
>> In file included from request.c:69:0:
>> request.h:1527:1: error: size of unnamed array is negative
>> request.h:1528:1: error: size of unnamed array is negative
>> request.h:1529:1: error: size of unnamed array is negative
>> request.h:1530:1: error: size of unnamed array is negative
>> request.h:1531:1: error: size of unnamed array is negative
>>
>> Each error represents the C_ASSERT code listed above.
>>
>> I'm probably missing something obvious here. Can someone please offer any advice on resolving these errors?
>
>>> we'd need more info like the actual struct get_desktop_workarea_request
>
> Hallo André, I missed your response to the list.
>
> This is what I have done. Wine compiles perfectly if I uncomment the C_ASSERT lines. I note that Charles Davis said in another response that request.h should not be modified.
>
> *** server/protocol.def ***
> /* Retrieve the desktop workarea */
> @REQ(get_desktop_workarea)
> RECT spi_workarea; /* values from SystemParametersInfo */
That should be a rectangle_t. The server doesn't actually use native Windows types.
Chip
More information about the wine-devel
mailing list