Commit 585c4b83 authored by Joachim Eibl's avatar Joachim Eibl Committed by Michael Reeves

Fix compilation issues.

Signed-off-by: default avatarjoachim99 <joachim.eibl@gmx.de>

# Conflicts:
#	src/progress.cpp
parent 69c205c1
TEMPLATE = app
# When unresolved items remain during linking: Try adding "shared" in the CONFIG.
CONFIG += qt warn_on thread precompile_header
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport
!os2:PRECOMPILED_HEADER = stable.h
HEADERS = version.h \
diff.h \
......@@ -51,9 +52,9 @@ win32 {
QMAKE_CXXFLAGS_RELEASE += -DNDEBUG -DQT_NO_ASCII_CAST
RC_FILE = kdiff3win.rc
win32-g++ {
QMAKE_LFLAGS += -luser32 -lshell32
QMAKE_LFLAGS_RELEASE += -static-libgcc # Remove dependency to libgcc_s_dw2-1.dll
QMAKE_LFLAGS_EXCEPTIONS_ON -= -mthreads # Remove dependency to mingwm10.dll (hack, yet no problem if not multithreaded)
QMAKE_LFLAGS += -luser32 -lshell32 -luuid
#QMAKE_LFLAGS_RELEASE += -static-libgcc # Remove dependency to libgcc_s_dw2-1.dll
#QMAKE_LFLAGS_EXCEPTIONS_ON -= -mthreads # Remove dependency to mingwm10.dll (hack, yet no problem if not multithreaded)
# Better: configure -static -release -no-exceptions -fast
} else {
QMAKE_LFLAGS += user32.lib shell32.lib
......
......@@ -20,7 +20,14 @@
//////////////////////////////////////////////////////////////////////
#ifdef _WIN32
#include "stable.h"
#include <windows.h>
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8 ) /* Test for GCC > 4.8.0 */
#define INITGUID // needed for MinGW 4.8 otherwise IID_IContextMenu etc. produce undefined references during linking.
#include <guiddef.h>
#endif
#include <shlobj.h>
#include <shlguid.h>
#include <malloc.h>
......
......@@ -248,10 +248,18 @@ void ProgressDialog::recalc( bool bUpdate )
else
{
QList<ProgressLevelData>::iterator i = m_progressStack.begin();
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
m_pProgressBar->setValue( int( 1000.0 * ( i->m_current.load() * (i->m_dRangeMax - i->m_dRangeMin) / i->m_maxNofSteps.load() + i->m_dRangeMin ) ) );
#else
m_pProgressBar->setValue( int( 1000.0 * ( i->m_current * (i->m_dRangeMax - i->m_dRangeMin) / i->m_maxNofSteps + i->m_dRangeMin ) ) );
#endif
++i;
if ( i!=m_progressStack.end() )
m_pSubProgressBar->setValue( int( 1000.0 * ( i->m_current * (i->m_dRangeMax - i->m_dRangeMin) / i->m_maxNofSteps + i->m_dRangeMin ) ) );
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
m_pSubProgressBar->setValue( int( 1000.0 * ( i->m_current.load() * (i->m_dRangeMax - i->m_dRangeMin) / i->m_maxNofSteps.load() + i->m_dRangeMin ) ) );
#else
m_pSubProgressBar->setValue( int( 1000.0 * ( i->m_current * (i->m_dRangeMax - i->m_dRangeMin) / i->m_maxNofSteps + i->m_dRangeMin ) ) );
#endif
else
m_pSubProgressBar->setValue( int( 1000.0 * m_progressStack.front().m_dSubRangeMin ) );
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment