Fixes: Build on windows

This commit is contained in:
Daniel Molkentin
2009-02-02 18:50:14 +01:00
parent 66e9410f3d
commit 7d63307bda
2 changed files with 15 additions and 8 deletions

View File

@@ -35,7 +35,14 @@
#include <cstring> #include <cstring>
#include <locale> #include <locale>
#include <qglobal.h>
#include "binpatch.h" #include "binpatch.h"
#ifdef Q_OS_WIN
# define strcasecmp _stricmp
# define strncasecmp _strnicmp
#endif
// returns positive value if it finds a null termination inside the buffer // returns positive value if it finds a null termination inside the buffer
long BinPatch::getBufferStringLength(char *data, char *end) long BinPatch::getBufferStringLength(char *data, char *end)

View File

@@ -42,8 +42,10 @@
#include <QtCore/QDebug> #include <QtCore/QDebug>
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
const char * const oldInstallBase = "C:/qt-greenhouse/Trolltech/Code_less_create_more/" # define QT_INSTALL_DIR "C:/qt-greenhouse/Trolltech/Code_less_create_more/Trolltech/Code_less_create_more/Troll/4.4.3";
"Trolltech/Code_less_create_more/Troll/4.4.3";
const char * const oldInstallBase = QT_INSTALL_DIR;
const char * const oldSourceBase = QT_INSTALL_DIR;
#else #else
const char * const oldSourceBase = "/home/berlin/dev/qt-4.4.3-temp/qt-x11-opensource-src-4.4.3"; const char * const oldSourceBase = "/home/berlin/dev/qt-4.4.3-temp/qt-x11-opensource-src-4.4.3";
const char * const oldInstallBase = "/home/berlin/dev/qt-4.4.3-shipping/qt"; const char * const oldInstallBase = "/home/berlin/dev/qt-4.4.3-shipping/qt";
@@ -627,9 +629,9 @@ void patchQMakeSpec(const char *path)
out << all; out << all;
} }
#ifndef Q_OS_WIN
const char * const textFileFileNames[] = const char * const textFileFileNames[] =
{ {
#ifndef Q_OS_WIN
// *.la // *.la
"/lib/libQtCore.la", "/lib/libQtCore.la",
"/lib/libQt3Support.la", "/lib/libQt3Support.la",
@@ -692,8 +694,8 @@ const char * const textFileFileNames[] =
// misc // misc
"/mkspecs/qconfig.pri" "/mkspecs/qconfig.pri"
#endif
}; };
#endif
void replaceInTextFile(const char * fileName, void replaceInTextFile(const char * fileName,
const char * oldText, const char * newText, const char * oldText, const char * newText,
@@ -726,6 +728,7 @@ void replaceInTextFile(const char * fileName,
void patchTextFiles(const char *newInstallBase) void patchTextFiles(const char *newInstallBase)
{ {
#ifndef Q_OS_WIN
const char * const baseQtPath = newInstallBase; const char * const baseQtPath = newInstallBase;
const char * const newSourceBase = newInstallBase; const char * const newSourceBase = newInstallBase;
const int fileCount = sizeof(textFileFileNames) / sizeof(const char *); const int fileCount = sizeof(textFileFileNames) / sizeof(const char *);
@@ -733,16 +736,13 @@ void patchTextFiles(const char *newInstallBase)
char * const fileName = allocFileNameCopyAppend(baseQtPath, textFileFileNames[i]); char * const fileName = allocFileNameCopyAppend(baseQtPath, textFileFileNames[i]);
logFileName(fileName); logFileName(fileName);
logDiff(oldSourceBase, newSourceBase); logDiff(oldSourceBase, newSourceBase);
#ifndef Q_OS_WIN
logDiff(oldInstallBase, newInstallBase); logDiff(oldInstallBase, newInstallBase);
#endif
replaceInTextFile(fileName, replaceInTextFile(fileName,
#ifndef Q_OS_WIN
oldSourceBase, newSourceBase, oldSourceBase, newSourceBase,
#endif
oldInstallBase, newInstallBase); oldInstallBase, newInstallBase);
delete[] fileName; delete[] fileName;
} }
#endif
patchQMakeSpec(newInstallBase); patchQMakeSpec(newInstallBase);
} }