diff options
author | Steven Boswell <ulatekh@yahoo.com> | 2014-03-29 14:37:30 -0400 |
---|---|---|
committer | RJ Ryan <rryan@mixxx.org> | 2014-03-29 14:37:30 -0400 |
commit | 477174772cf1b482833d03ba39211da280eb3ec3 (patch) | |
tree | d58b597f3f7296e94889867a3c8c1bc05c0b93c0 | |
parent | 955f927c77a89dcd41f57f6b9b841a5f5bd50d76 (diff) |
Various build system fixes for Windows (and particularly MingW cross-compiling to Windows). Fixes Bug #1179683.
-rw-r--r-- | build/depends.py | 3 | ||||
-rw-r--r-- | build/features.py | 4 | ||||
-rw-r--r-- | lib/fidlib-0.9.10/fidlib.c | 3 | ||||
-rw-r--r-- | lib/xwax/lut_win32.c (renamed from lib/xwax/lut.cpp) | 6 | ||||
-rwxr-xr-x | lib/xwax/timecoder_win32.c (renamed from lib/xwax/timecoder_win32.cpp) | 6 | ||||
-rw-r--r-- | src/SConscript | 8 | ||||
-rw-r--r-- | src/controllers/controllermanager.cpp | 2 | ||||
-rw-r--r-- | src/library/browse/foldertreemodel.cpp | 2 | ||||
-rw-r--r-- | src/library/treeitemmodel.cpp | 6 | ||||
-rw-r--r-- | src/sampleutil.cpp | 5 |
10 files changed, 31 insertions, 14 deletions
diff --git a/build/depends.py b/build/depends.py index 083fdba6f6..93919ee450 100644 --- a/build/depends.py +++ b/build/depends.py @@ -999,6 +999,9 @@ class MixxxCore(Feature): build.env.Append(CPPPATH=mixxx_lib_path) build.env.Append(LIBPATH=mixxx_lib_path) + # Find executables (e.g. protoc) in the winlib path + build.env.AppendENVPath('PATH', mixxx_lib_path) + # Ugh, MSVC-only hack :( see # http://www.qtforum.org/article/17883/problem-using-qstring- # fromstdwstring.html diff --git a/build/features.py b/build/features.py index 1d59d23ef8..ce21471fa4 100644 --- a/build/features.py +++ b/build/features.py @@ -383,8 +383,8 @@ class VinylControl(Feature): 'vinylcontrol/steadypitch.cpp', 'engine/vinylcontrolcontrol.cpp', ] if build.platform_is_windows: - sources.append("#lib/xwax/timecoder_win32.cpp") - sources.append("#lib/xwax/lut.cpp") + sources.append("#lib/xwax/timecoder_win32.c") + sources.append("#lib/xwax/lut_win32.c") else: sources.append("#lib/xwax/timecoder.c") sources.append("#lib/xwax/lut.c") diff --git a/lib/fidlib-0.9.10/fidlib.c b/lib/fidlib-0.9.10/fidlib.c index 690be05e37..619325287c 100644 --- a/lib/fidlib-0.9.10/fidlib.c +++ b/lib/fidlib-0.9.10/fidlib.c @@ -259,7 +259,8 @@ extern FidFilter *mkfilter(char *, ...); // // Macro for local inline routines that shouldn't be visible externally -#ifdef T_MSVC +// See Mixxx Bug #1179683 +#if defined(T_MINGW) || defined(T_MSVC) #define STATIC_INLINE static __inline #else #define STATIC_INLINE static inline diff --git a/lib/xwax/lut.cpp b/lib/xwax/lut_win32.c index a10face3f4..1ad06c2064 100644 --- a/lib/xwax/lut.cpp +++ b/lib/xwax/lut_win32.c @@ -43,16 +43,16 @@ int lut_init(struct lut *lut, int nslots) bytes = sizeof(struct slot) * nslots + sizeof(slot_no_t) * hashes; fprintf(stderr, "Lookup table has %d hashes to %d slots" - " (%d slots per hash, %zuKb)\n", + " (%d slots per hash, %u Kb)\n", hashes, nslots, nslots / hashes, bytes / 1024); - lut->slot = static_cast<struct slot*>(malloc(sizeof(struct slot) * nslots)); + lut->slot = (struct slot*)(malloc(sizeof(struct slot) * nslots)); if (lut->slot == NULL) { perror("malloc"); return -1; } - lut->table = static_cast<slot_no_t*>(malloc(sizeof(slot_no_t) * hashes)); + lut->table = (slot_no_t*)(malloc(sizeof(slot_no_t) * hashes)); if (lut->table == NULL) { perror("malloc"); return -1; diff --git a/lib/xwax/timecoder_win32.cpp b/lib/xwax/timecoder_win32.c index a197528080..ffc6985cea 100755 --- a/lib/xwax/timecoder_win32.cpp +++ b/lib/xwax/timecoder_win32.c @@ -348,7 +348,7 @@ int timecoder_monitor_init(struct timecoder *tc, int size) { assert(tc->mon == NULL); tc->mon_size = size; - tc->mon = static_cast<unsigned char*>(malloc(SQ(tc->mon_size))); + tc->mon = (unsigned char*)(malloc(SQ(tc->mon_size))); if (tc->mon == NULL) { perror("malloc"); return -1; @@ -632,9 +632,9 @@ signed int timecoder_get_position(struct timecoder *tc, double *when) if (r >= 0) { // normalize position to milliseconds, not timecode steps -- Owen - r = static_cast<double>(r) + r = (double)(r) * (1000.0 - / (static_cast<double>(tc->def->resolution) * tc->speed)); + / ((double)(tc->def->resolution) * tc->speed)); } if (when) diff --git a/src/SConscript b/src/SConscript index a0ebdce565..cf3d84e1be 100644 --- a/src/SConscript +++ b/src/SConscript @@ -40,11 +40,15 @@ if build.platform_is_windows: str_list.append('#define VER_FILEVERSION ') # Remove anything after ~ or - in the version number and replace the dots with commas str_list.append(mixxx_version.partition('~')[0].partition('-')[0].replace('.',',')) - str_list.append(','+str(vcs_revision)+'\n') + if vcs_revision: + str_list.append(','+str(vcs_revision)) + str_list.append('\n') str_list.append('#define VER_PRODUCTVERSION ') str_list.append(mixxx_version.partition('~')[0].partition('-')[0].replace('.',',')) - str_list.append(','+str(vcs_revision)+'\n') + if vcs_revision: + str_list.append(','+str(vcs_revision)) + str_list.append('\n') import datetime now = datetime.datetime.now() diff --git a/src/controllers/controllermanager.cpp b/src/controllers/controllermanager.cpp index db167c3dce..f1578f2a5c 100644 --- a/src/controllers/controllermanager.cpp +++ b/src/controllers/controllermanager.cpp @@ -78,7 +78,9 @@ ControllerManager::ControllerManager(ConfigObject<ConfigValue>* pConfig) m_pPresetInfoManager = new PresetInfoEnumerator(m_pConfig); // Instantiate all enumerators +#ifdef __PORTMIDI__ m_enumerators.append(new PortMidiEnumerator()); +#endif // __PORTMIDI__ #ifdef __HSS1394__ m_enumerators.append(new Hss1394Enumerator()); #endif diff --git a/src/library/browse/foldertreemodel.cpp b/src/library/browse/foldertreemodel.cpp index 895c98e95e..8f80f04770 100644 --- a/src/library/browse/foldertreemodel.cpp +++ b/src/library/browse/foldertreemodel.cpp @@ -1,7 +1,7 @@ #if defined (__WINDOWS__) #include <windows.h> #include <Shellapi.h> -#include <Shobjidl.h> +#include <Shlobj.h> #else #include <sys/types.h> #include <sys/stat.h> diff --git a/src/library/treeitemmodel.cpp b/src/library/treeitemmodel.cpp index 2b4577b8c7..90e1a4c5f3 100644 --- a/src/library/treeitemmodel.cpp +++ b/src/library/treeitemmodel.cpp @@ -161,6 +161,9 @@ void TreeItemModel::setRootItem(TreeItem *item) { * make sure you have initialized */ bool TreeItemModel::insertRows(QList<TreeItem*> &data, int position, int rows, const QModelIndex &parent) { + if (rows == 0) { + return true; + } TreeItem *parentItem = getItem(parent); bool success; @@ -172,6 +175,9 @@ bool TreeItemModel::insertRows(QList<TreeItem*> &data, int position, int rows, c } bool TreeItemModel::removeRows(int position, int rows, const QModelIndex &parent) { + if (rows == 0) { + return true; + } TreeItem *parentItem = getItem(parent); bool success = true; diff --git a/src/sampleutil.cpp b/src/sampleutil.cpp index 05c47d59b8..367704e98d 100644 --- a/src/sampleutil.cpp +++ b/src/sampleutil.cpp @@ -3,8 +3,9 @@ #ifdef __WINDOWS__ #pragma intrinsic(fabs)sc -typedef __int64 int64_t; -typedef __int32 int32_t; +#include <QtGlobal> +typedef qint64 int64_t; +typedef qint32 int32_t; #endif #include <QtDebug> |