MSVC and BCC32 support for Qt 4.0.1

Andreas Hausladen Andreas.Hausladen at gmx.de
Wed Aug 31 16:10:45 CEST 2005


Hallo,

I finally finished the patch against Qt 4.0.1
(qt-win-opensource-src-4.0.1) for msvc and bcc32 support.
http://andy.jgknet.de/misc/msvc-bcc32-Qt-4.0.1patch.zip (180KB)

I added precompiled header support for bcc32 via an additional tool
(misc/bcc32pch). bcc32 does not have a command line switch which allows
to force include a file (the pch header). And changing all files to
include the pch file and adding a "#pragma hdrstop" is no solution. This
tool backups the original files and injects the required pch header
lines. With this the bcc32 compile becomes much faster than msvc. And my
subjective impression with Qt 4.1.0 snapshot is that moc.exe became much
faster (I haven't compared the code yet). But I will not release the
patch for that snapshot because it is not stable and I do not have the
time to regenerate the patch every day ;-)

The Visual C++ Toolkit 2003 cannot compile with STL, so you must call
the configure program with "configure-msvc -no-stl". MSVC.NET has no
problems.


While testing all executables I found out that there are some functions
in Qt which do not test for division by zero. These errors do not appear
when compiled with a compiler who's standard c++ library mask the FPU
exceptions. But Borland's library does not mask these and so the
division by zero happen all over the place (especially in graphical
examples like "gradient").  My solution for bcc32 was to add code to
qglobal.cpp which mask the FPU exceptions.

It would be easy to say that's Borland's problem. But this is not true.
What happens if you load a DLL which resets the FPU's status word? The
worst case would be that the application crashes with division by zero
all over the place.

The first time I recognized this behaviour was when rcc.exe wanted to
generate the resources from empy (0 Byte) .resource files for
tools/porting. Unfortunatelly Windows shows a "unknown software
exception" dialog. After debugging the file the bug was obvious: a
division by zero.


Regards,
Andreas Hausladen


More information about the kde-cygwin mailing list