Alexander Neundorf schrieb:
Hi,
here my unimportant opinion:
Wednesday 28 February 2007 13:35, Ch.Ehrlicher (AT) gmx (DOT) 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 IM
>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