Runtime code vs compile time conditional compilation

John Birrell jb at cimlogic.com.au
Sat Feb 14 21:47:28 CST 2004


I'm new to Wine development. Today I decided to have a better look at how Wine
is built rather than just blindly running 'configure' and hoping that all would
work out. I'm a FreeBSD developer, so I tend not to trust 'configure' to DTRT.
Don't shoot me for that, please. 8-)

I came across code in libs/wine/config.c that does a runtime check on the size
of a couple of fields in 'struct stat' and executes code conditionally based on
the size of the field being greater than 32 bits. Since I was using -Wall and
-Werror, the compiler barfed when it saw an attempt to shift >= the number of bits
in the variable. If I had my way, this sort of thing should be coded as a compile
time test and only the code for the appropriate size compiled in. Is there some
sort of direction for/from Wine developers for this kind of thing?

-- 
John Birrell



More information about the wine-devel mailing list