RFC: Compiling as 16 bit

Morten Rønne morten.roenne at tdcadsl.dk
Thu Sep 2 14:43:59 CDT 2010

On 02-09-2010 21:21, Alexandre Julliard wrote:
> Morten Rønne<morten.roenne at tdcadsl.dk>  writes:
>> I am looking for a way to change windef.h so that it will create the
>> correct base types for both 16 and 32 bit compile.
>> Openwatcom defines the symbol __I86__ while compiling for 16 bit, is
>> it acceptable that I use that to create 16 bit types?
>> It seems that _MSC_VER will change a few cases of int to long, but far
>> from enough.
>> Is _MSC_VER intended to be a 16 bit compile flag?
>> Or should I use something else more wine like (e.g. __WINE_16BIT_COMPILE).
>> Also compiling 16 bit give some errors in other include files (after I
>> have defined proper sizes for the 16 bit compile)
>> ../../../include/winnt.h(3529): Error! E1040: Field width too large
>>              unsigned NameIsString:1;
>>              unsigned NameOffset:31;
>> #else
>>              unsigned NameOffset:31;
>>              unsigned NameIsString:1;
>> #endif
>> As it can be seen the include file uses unsigned directly and not a
>> type like DWORD or ULONG that would be a "safe" 32 bit.
>> Would it be acceptable to change this and others to a "proper" type
>> which I know to be size safe?
> I don't think it makes sense to invest time into developing a 16-bit
> Winelib environment, and we certainly don't want to add 16-bit crap in
> the standard Win32 headers. These things should be part of the 16-bit
> compiler environment.
I can understand that, but the problem is that in order to write proper 
test of the 16 bit environment I need to include the definitions of the 
structs that make up the 16 bit execution environment e.g. 
wine/winbase16.h and others.
That file (and probably also the others) will in turn include windef.h 
and winbase.h, which will in turn include winnt.h and so on.
Ending up in a problem due to size errors.

Or are you saying that I should change wine/winbase16.h to not include 
windef.h and winbase.h and make sure that they don't include anything 
from "windows 32" include files?
Or should I duplicate all those file for the test enviroment, so that I 
have to maintain the same structs in two different files?

Best Regards
Morten Rønne

More information about the wine-devel mailing list