[Spice-devel] messages.h unable to be used in VC++

Alon Levy alevy at redhat.com
Tue Apr 17 08:52:53 PDT 2012


On Tue, Apr 17, 2012 at 08:15:22AM -0500, Aric Stewart wrote:
> Hello all,
> 
>   Working away at making the current tip of spice build the win32 client.  I
> have run into another problem.
> 
>   Since the last working win32 cllient build the code generated by
> spice_codegen.py has shifted from CPP files to C files. The generated files
> include messages.h.
> 
>   Inside messages.h there is a structure SpiceMsgEmpty which is empty. Empty
> structures in C have 0 bytes and are not defined in the spec. VC++ treats
> this as a hard error (C2015) and so refuses to compile the code. gcc does
> not treat this as an error, so mingw and gcc builds have not noticed this.
> 
>   How do we want to handle this.
> 
>   We could put a single padding member in that structure that would allow
> the compile to work, but it would make the structure size expand to a byte
> and have an unused member.

Looks like this should just work. Maybe you could try this?

> 
>   If I have the VC++ build path continue to generate cpp files instead of C
> files then there are issues with the bindings defined in
> client_demarshallers.h and the SPICE_BEGIN_DECLS lines will have to be
> #ifdefed out for win32.
> 
>   Thanks!
> -aric
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel


More information about the Spice-devel mailing list