Menu

#34 Native Win32 fixes

open
None
7
2004-11-04
2004-04-05
No

I have been able to get xxdiff to compile natively
(using Qt Non-Commercial 2.30 and MS Visual C 6) . To
do this, some fixes were required (patch attached).

The non-commercial Qt 2.30 is available from
ftp://ftp.trolltech.com/qt/non-commercial.

Details of the patch:

app.ccp: MSVC 6 doesn't do the latest scoping for
'for(Type x;;)'

buffer.cpp: The old MS-DOS CR/LF line end problem. When
the files are read in text mode (which means # of bytes
read != filesize) builderFiles2 went past the end of a
file, resulting in a crash. If that crash was fixed,
then there was garbage at the end of the comparision.
To fix this, the files are read in binary mode; this
also means that files with Unix line-ends will show up
as different from files with MS-DOS line-ends.

central.cpp: The font used for the filenames was
unreadable; I simply turned off the point size reduction.

exceptions.cpp: It appears there is a conflicting macro
in stdlib.h and one of the Qt or xxdiff header files.
Changing the order of includes fixed it.

main.cpp: In the native Win32 mode, there is no console
for the application. This means that all streams output
- cout, cerr - disappears. To fix this, I use the Win32
MessageBox function to display messages that would go
to cerr. Unfortunately, this means that some messages
are excessively long; a proper solution would use a
window with a scrolled text area for the message, if
required.

Also in main.cpp, 'environ' is not used; and in any
event setting this variable corrupts the environment
(in Win32, this is a global pointer to the environment).

main.h: extern char** environ must not be declared.

resParser.cpp: Location of .xxdiffrc must be done
differently under Windows. I look for HOMEDRIVE and
HOMEPATH to specify a drive and folder; if either is
not found, the root of C (C:\) is used. The filename is
xxdiffrc, not .xxdiffrc, as well.

A native Win32 GNU diff is also required to make this
work; you can use either the now-free Microsoft
Services For Unix or http://unxutils.sourceforge.net; I
have tested with the latter only.

Discussion

  • Grant McDorman

    Grant McDorman - 2004-04-05

    Path for native Win32 operation

     
  • Martin Blais

    Martin Blais - 2004-11-03
    • assigned_to: nobody --> blais
     
  • Martin Blais

    Martin Blais - 2004-11-04
    • priority: 5 --> 7
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.