Menu

#12 Various patches for kdiff3 - no iostreams, no RTTI

open
nobody
None
5
2012-09-23
2012-04-04
No

I put a kdiff3 git repository here:
https://github.com/nigels-com/nvidia-kdiff3

The "upstream" branch is imported from Sourceforge svn repository.
The "master" branch has various patches applied.

The commit history is here:
https://github.com/nigels-com/nvidia-kdiff3/commits/master

I broke the change into small pieces that each ought to drop easily onto kdiff3 in sourceforge.
The only difficulty arose for fileaccess.cpp which was a conflict - better to eyeball that for yourself, I guess.

Rationale:
- For Linux I can use a statically-linked kdiff3 with Qt4 providing I avoid the libstdc++ dependency.
Indeed, these binaries would be pretty good for general distribution.
But, the issue is to avoid using iostreams, RTTI (dynamic_cast).
- I can also build statically-linked binaries for Win32, Win64, OSX ppc/i686/x86_64, but
with some QT_NO_BLAH defines to make it managable.

Patch also attached.
And thanks for kdiff3! :-)

  • Nigel

Discussion

  • Nigel Stewart

    Nigel Stewart - 2012-04-04
     
  • Nigel Stewart

    Nigel Stewart - 2012-04-04

    I wanted to point out the more valuable patch here - to make kdiff3 on Windows (built with VC8, VC9 or VC10) work out-of-the-box with Cygwin git. Turns out that git passes cygwin paths in /tmp/... to kdiff3.exe, which won't work unless kdiff3 figures out the Cygwin directory from an environment variable. It's not a nice change, but it makes kdiff3.exe very useful indeed on Windows with Cygwin and git.

    https://github.com/nigels-com/nvidia-kdiff3/commit/ca28abe23f0284270cae510fa1ee83e3454f57a6

     
  • Joachim Eibl

    Joachim Eibl - 2012-04-10

    Hi Nigel,

    Thank you for the patch.
    I've applied it as svn revision 157.

    Regarding the fileaccess-patch: I've changed it to this:

    if defined(Q_WS_WIN)

         if ( !bExistsLocal )
         {
            // git on Cygwin will put files in /tmp
            // A workaround for the a native kdiff3 binary to find them...
    
            QString cygwinBin = getenv("CYGWIN_BIN");
            if (localName.startsWith("/tmp/") && !cygwinBin.isEmpty() )
            {
               localName = QString("%1\\..%2").arg(cygwinBin).arg(name);
            }
         }
    

    endif

    Please test if it still works for you. Is it ok to correct the path only if the file does not exist, or are such paths also possible for files that should be written, but don't exist yet?
    Joachim

     
  • Nigel Stewart

    Nigel Stewart - 2012-04-11

    Hi Joachim,

    The Cygwin reasoning looks sound to me, I'll do some testing
    and follow up soon.

    • Nigel
     
  • Nigel Stewart

    Nigel Stewart - 2012-04-11

    Remaining patch for resolving VC10 warnings in 32-bit and 64-bit builds.

     
  • Nigel Stewart

    Nigel Stewart - 2012-04-11

    Hi Joachim,

    I attached an additional patch which resolves from VC10 warnings
    for 32-bit and 64-bit builds. This would bring my branch back in
    sync with kdiff3 official.

    • Nigel