khtml crashes on win32/msvc
Ch.Ehrlicher at gmx.de
Ch.Ehrlicher at gmx.de
Wed Feb 28 12:35:05 GMT 2007
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 ;
};
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);
}
Is it ok to handle the msvc bugs this way?
If yes, I would like to check this changes in asap.
Thx,
Christian Ehrlicher
--
Ist Ihr Browser Vista-kompatibel? Jetzt die neuesten
Browser-Versionen downloaden: http://www.gmx.net/de/go/browser
More information about the kfm-devel
mailing list