khtml crashes on win32/msvc

Christian Ehrlicher Ch.Ehrlicher at gmx.de
Wed Feb 28 17:28:59 GMT 2007


Alexander Neundorf schrieb:
> Hi,
> 
> here my unimportant opinion:
> 
> On Wednesday 28 February 2007 13:35, Ch.Ehrlicher at gmx.de wrote:
>> Hi,
>>
>> I've two problems with khtml on win32/msvc:
>>
>> 1) msvc can't handle structs with boolean bitfields:
>>
>> struct InheritedFlags {
>>  ...
>>       bool _border_collapse : 1 ;
>> };
>>
>> -> needs to be
>>
>> struct InheritedFlags {
>>  ...
>>       unsigned _border_collapse : 1 ;
>> };
> 
> Sounds good IMO.
> 
>> 2) msvc can't handle structs with enum bitfields (when count(bits) > 1):
>>
>> - setting a value works fine
>> - reading does not work because an enum is defined as a signed int -> I get
>> negative values the workaround for this is to perform a bitwise and ->
>>
>> #ifdef Q_CC_MSVC
>>  #define KHTML_ENUM_MSVC_FIX(v, t, s)  ((t)(v & 1<<(s-1)))
>> #else
>>  #define KHTML_ENUM_MSVC_FIX(v, t, s)  t
>> #endif
>>
>> EUserInput userInput(InheritedFlags it) {
>>     return KHTML_ENUM_MSVC_FIX(it.f._user_input, EUserInput, 2);
>> }
> 
> This looks a bit ugly.
> Maybe there is a compiler switch where you can changed how enums are handled ?
> 
I know that it's ugly, but I could not find an option to make enums 
unsigned. msdn clearly says, that an enum is int or int64 :(


Christian




More information about the kfm-devel mailing list