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

Aric Stewart aric at codeweavers.com
Tue Apr 17 06:15:22 PDT 2012


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.

   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


More information about the Spice-devel mailing list