# HG changeset patch # User Chris Cannam # Date 1476795835 -3600 # Node ID c811991a5efafa9fee2966795c6ea6a2d1211422 # Parent fef49844b3f8184b64e289352b3eca7b6642a8df MSVC build fixes diff -r fef49844b3f8 -r c811991a5efa base/Profiler.cpp --- a/base/Profiler.cpp Tue Sep 20 09:16:13 2016 +0100 +++ b/base/Profiler.cpp Tue Oct 18 14:03:55 2016 +0100 @@ -47,15 +47,11 @@ dump(); } +#ifndef NO_TIMING void Profiles::accumulate( -#ifndef NO_TIMING const char* id, clock_t time, RealTime rt -#else - const char*, clock_t, RealTime -#endif ) { -#ifndef NO_TIMING ProfilePair &pair(m_profiles[id]); ++pair.first; pair.second.first += time; @@ -72,8 +68,8 @@ if (rt > worstPair.second) { worstPair.second = rt; } +} #endif -} void Profiles::dump() const { diff -r fef49844b3f8 -r c811991a5efa base/Profiler.h --- a/base/Profiler.h Tue Sep 20 09:16:13 2016 +0100 +++ b/base/Profiler.h Tue Oct 18 14:03:55 2016 +0100 @@ -25,8 +25,6 @@ #include "system/System.h" -#include -#include #include #include "RealTime.h" @@ -41,6 +39,11 @@ #endif #endif +#ifndef NO_TIMING +#include +#include +#endif + /** * Profiling classes */ @@ -56,12 +59,15 @@ static Profiles* getInstance(); ~Profiles(); +#ifndef NO_TIMING void accumulate(const char* id, clock_t time, RealTime rt); +#endif void dump() const; protected: Profiles(); +#ifndef NO_TIMING typedef std::pair TimePair; typedef std::pair ProfilePair; typedef std::map ProfileMap; @@ -70,6 +76,7 @@ ProfileMap m_profiles; LastCallMap m_lastCalls; WorstCallMap m_worstCalls; +#endif static Profiles* m_instance; }; diff -r fef49844b3f8 -r c811991a5efa base/RealTime.cpp --- a/base/RealTime.cpp Tue Sep 20 09:16:13 2016 +0100 +++ b/base/RealTime.cpp Tue Oct 18 14:03:55 2016 +0100 @@ -24,7 +24,6 @@ #include #include "RealTime.h" -#include "sys/time.h" #include "Debug.h" diff -r fef49844b3f8 -r c811991a5efa base/RealTime.h --- a/base/RealTime.h Tue Sep 20 09:16:13 2016 +0100 +++ b/base/RealTime.h Tue Oct 18 14:03:55 2016 +0100 @@ -28,7 +28,11 @@ #include -struct timeval; +#ifdef _MSC_VER +#include "winsock.h" // struct timeval is in here +#else +#include "sys/time.h" +#endif /** * RealTime represents time values to nanosecond precision diff -r fef49844b3f8 -r c811991a5efa base/TempDirectory.cpp --- a/base/TempDirectory.cpp Tue Sep 20 09:16:13 2016 +0100 +++ b/base/TempDirectory.cpp Tue Oct 18 14:03:55 2016 +0100 @@ -25,7 +25,7 @@ #include #include -#include +//#include #include TempDirectory * diff -r fef49844b3f8 -r c811991a5efa data/fileio/FileReadThread.cpp --- a/data/fileio/FileReadThread.cpp Tue Sep 20 09:16:13 2016 +0100 +++ b/data/fileio/FileReadThread.cpp Tue Oct 18 14:03:55 2016 +0100 @@ -19,7 +19,14 @@ #include "base/Thread.h" #include + +#ifdef _MSC_VER +#include +#define _lseek lseek +#else #include +#endif + #include //#define DEBUG_FILE_READ_THREAD 1 diff -r fef49844b3f8 -r c811991a5efa svcore.pro --- a/svcore.pro Tue Sep 20 09:16:13 2016 +0100 +++ b/svcore.pro Tue Oct 18 14:03:55 2016 +0100 @@ -17,8 +17,10 @@ LIBS += -L../sv-dependency-builds/win32-mingw/lib } win32-msvc* { - INCLUDEPATH += ../sv-dependency-builds/win32-msvc/include - LIBS += -L../sv-dependency-builds/win32-msvc/lib + # We actually expect MSVC to be used only for 64-bit builds, + # though the qmake spec is still called win32-msvc* + INCLUDEPATH += ../sv-dependency-builds/win64-msvc/include + LIBS += -L../sv-dependency-builds/win64-msvc/lib } macx* { INCLUDEPATH += ../sv-dependency-builds/osx/include @@ -30,6 +32,9 @@ macx* { DEFINES += HAVE_COREAUDIO } + win32-msvc* { + DEFINES += NOMINMAX + } } CONFIG += staticlib qt thread warn_on stl rtti exceptions c++11 diff -r fef49844b3f8 -r c811991a5efa system/System.h --- a/system/System.h Tue Sep 20 09:16:13 2016 +0100 +++ b/system/System.h Tue Oct 18 14:03:55 2016 +0100 @@ -59,6 +59,11 @@ #define getpid _getpid +#if defined(_MSC_VER) +#include +typedef SSIZE_T ssize_t; +#endif + extern "C" { /* usleep is now in mingw void usleep(unsigned long usec);