Commit b23468d0 authored by Jussi Lindgren's avatar Jussi Lindgren

Build: Various fixes towards VS2013 compatibility

parent 0001080c
......@@ -19,6 +19,8 @@
#include <windows.h>
#include <cstring>
#include <algorithm> // std::min, etc on VS2013
#include <openvibe/ovITimeArithmetics.h>
#define boolean OpenViBE::boolean
......@@ -664,7 +666,7 @@ boolean CDriverMicromedSystemPlusEvolution::dropData(void)
do
{
uint32 l_ui32MaxByteRecv=min((uint32)m_oFgetStructBuffDataSize(), (uint32)(m_oFgetDataLength()-l_ui32TotalReceived));
uint32 l_ui32MaxByteRecv=std::min((uint32)m_oFgetStructBuffDataSize(), (uint32)(m_oFgetDataLength()-l_ui32TotalReceived));
if(this->MyReceive((char*)m_pStructBuffData, l_ui32MaxByteRecv)==-1)
{
return false;
......@@ -728,7 +730,7 @@ boolean CDriverMicromedSystemPlusEvolution::loop(void)
uint32 l_ui32ReceivedSampleCount=0;
do
{
l_ui32MaxByteRecv=min(m_ui32BuffSize, min(m_oFgetDataLength()-l_ui32TotalReceived, (m_ui32nbSamplesBlock-m_ui32BuffDataIndex*m_oHeader.getChannelCount())*m_ui32DataSizeInByte));
l_ui32MaxByteRecv=std::min(m_ui32BuffSize, std::min(m_oFgetDataLength()-l_ui32TotalReceived, (m_ui32nbSamplesBlock-m_ui32BuffDataIndex*m_oHeader.getChannelCount())*m_ui32DataSizeInByte));
if(this->MyReceive((char*)m_pStructBuffData, l_ui32MaxByteRecv)==-1)
{
return false;
......
......@@ -7,6 +7,8 @@
#include <iostream>
#include <cstring>
#include <algorithm> // std::min, etc on VS2013
#include <xml/IReader.h>
#include <xml/IWriter.h>
#include <xml/IXMLHandler.h>
......
......@@ -20,6 +20,8 @@
#include <cstdlib>
#include <algorithm> // std::min, etc on VS2013
using namespace OpenViBE;
using namespace OpenViBE::Kernel;
using namespace OpenViBE::Plugins;
......
......@@ -14,25 +14,44 @@
FUNCTION(OV_LINK_BOOST_LIB BOOST_COMPONENT BOOST_VERSION)
IF(WIN32)
INCLUDE(CMakeDetermineVSServicePack)
DetermineVSServicePack( MSVC_SERVICE_PACK )
STRING(REGEX MATCH "vc90.*" MSVC_VER90 ${MSVC_SERVICE_PACK})
IF(${CMAKE_MAJOR_VERSION} LESS 3)
INCLUDE(CMakeDetermineVSServicePack)
DetermineVSServicePack( MSVC_SERVICE_PACK )
ELSE(${CMAKE_MAJOR_VERSION} LESS 3)
SET(MSVC_SERVICE_PACK "unknown")
MESSAGE(STATUS "st ${CMAKE_CXX_COMPILER_VERSION}")
IF(${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER "16.0.0")
SET(MSVC_SERVICE_PACK "vc100")
ENDIF()
IF(${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER "17.0.0")
SET(MSVC_SERVICE_PACK "vc110")
ENDIF()
IF(${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER "18.0.0")
SET(MSVC_SERVICE_PACK "vc120")
ENDIF()
ENDIF(${CMAKE_MAJOR_VERSION} LESS 3)
MESSAGE(STATUS "pack ${MSVC_SERVICE_PACK}")
SET(LIB_BOOST "unknown-platform-NOTFOUND")
SET(LIB_BOOST_DEBUG "unknown-platform-NOTFOUND")
STRING(REGEX MATCH "vc90.*" MSVC_VER90 ${MSVC_SERVICE_PACK})
IF(MSVC_VER90)
SET(LIB_BOOST "libboost_${BOOST_COMPONENT}-vc90-mt-${BOOST_VERSION}.lib")
SET(LIB_BOOST_DEBUG "libboost_${BOOST_COMPONENT}-vc90-mt-gd-${BOOST_VERSION}.lib")
ENDIF(MSVC_VER90)
STRING(REGEX MATCH "vc100.*" MSVC_VER100 ${MSVC_SERVICE_PACK})
IF(MSVC_VER100)
SET(LIB_BOOST "libboost_${BOOST_COMPONENT}-vc100-mt-${BOOST_VERSION}.lib")
SET(LIB_BOOST_DEBUG "libboost_${BOOST_COMPONENT}-vc100-mt-gd-${BOOST_VERSION}.lib")
ENDIF(MSVC_VER100)
STRING(REGEX MATCH "vc110.*" MSVC_VER110 ${MSVC_SERVICE_PACK})
IF(MSVC_VER110)
SET(LIB_BOOST "libboost_${BOOST_COMPONENT}-vc110-mt-${BOOST_VERSION}.lib")
SET(LIB_BOOST_DEBUG "libboost_${BOOST_COMPONENT}-vc110-mt-gd-${BOOST_VERSION}.lib")
ENDIF(MSVC_VER110)
STRING(REGEX MATCH "vc120.*" MSVC_VER120 ${MSVC_SERVICE_PACK})
IF(MSVC_VER120)
SET(LIB_BOOST "libboost_${BOOST_COMPONENT}-vc100-mt-${BOOST_VERSION}.lib")
SET(LIB_BOOST_DEBUG "libboost_${BOOST_COMPONENT}-vc100-mt-gd-${BOOST_VERSION}.lib")
ENDIF(MSVC_VER120)
SET(LIB_BOOST_PATH "-NOTFOUND")
FIND_LIBRARY(LIB_BOOST_PATH NAMES ${LIB_BOOST} PATHS ${OV_CUSTOM_DEPENDENCIES_PATH}/boost/lib NO_DEFAULT_PATH)
......
......@@ -15,7 +15,9 @@
// - Steffen Heimes
// Define if you have the strtoll variants.
#if _MSC_VER >= 1300
#if _MSC_VER >= 1800
// ...
#elif _MSC_VER >= 1300
# define HAVE_STRTOULL 1
namespace std {
static inline long long strtoull(char const* str, char** str_end, int base)
......
......@@ -92,7 +92,7 @@ void CLogListenerFile::log(const time64 time64Value)
ss << " (0x" << hex << time64Value.m_ui64TimeValue << ")";
}
m_fsFileStream << ss;
m_fsFileStream << ss.str();
}
else
{
......
......@@ -15,6 +15,8 @@
#include <cstdlib>
#include <limits>
#include <algorithm> // std::min, etc on VS2013
//___________________________________________________________________//
// //
......
......@@ -4,6 +4,8 @@
#include <cfloat>
#include <cstring>
#include <algorithm> // std::min, etc on VS2013
using namespace OpenViBE;
using namespace OpenViBE::Plugins;
using namespace OpenViBE::Kernel;
......
......@@ -4,6 +4,8 @@
#include <iostream>
#include <algorithm> // std::min, etc on VS2013
#include <openvibe/ovITimeArithmetics.h>
using namespace OpenViBE;
......@@ -134,7 +136,7 @@ bool CTimeBasedEpoching::COutputHandler::process()
if(m_ui32SampleIndex<m_ui32SampleCountPerEpoch) // Some samples should be filled
{
// Copies samples to buffer
const uint32 l_ui32SamplesToFill=min(m_ui32SampleCountPerEpoch-m_ui32SampleIndex, l_ui32InputSampleCount-l_ui32SamplesProcessed);
const uint32 l_ui32SamplesToFill=std::min(m_ui32SampleCountPerEpoch-m_ui32SampleIndex, l_ui32InputSampleCount-l_ui32SamplesProcessed);
for(uint32 i=0; i<m_ui32ChannelCount; i++)
{
System::Memory::copy(
......@@ -180,7 +182,7 @@ bool CTimeBasedEpoching::COutputHandler::process()
else
{
// The next few samples are useless
const uint32 l_ui32SamplesToSkip=min(m_ui32SampleCountBetweenEpoch-m_ui32SampleIndex, l_ui32InputSampleCount-l_ui32SamplesProcessed);
const uint32 l_ui32SamplesToSkip=std::min(m_ui32SampleCountBetweenEpoch-m_ui32SampleIndex, l_ui32InputSampleCount-l_ui32SamplesProcessed);
m_ui32SampleIndex+=l_ui32SamplesToSkip;
l_ui32SamplesProcessed+=l_ui32SamplesToSkip;
......
......@@ -3,6 +3,8 @@
#include <iostream>
#include <fstream>
#include <algorithm> // std::min, etc on VS2013
using namespace OpenViBE;
using namespace OpenViBE::Kernel;
using namespace OpenViBE::Plugins;
......@@ -151,7 +153,7 @@ void CBoxAlgorithmEBMLStreamSpy::processBinaryBlock(const void* pBuffer, const E
{
uint64 l_ui64Count=(ui64BufferSize/sizeof(T));
const T* l_pBuffer=static_cast<const T*>(pBuffer);
for(uint64 i=0; i<min(m_ui64ExpandValuesCount, l_ui64Count); i++)
for(uint64 i=0; i<std::min(m_ui64ExpandValuesCount, l_ui64Count); i++)
{
getLogManager() << (i==0?"":" ") << l_pBuffer[i];
}
......
......@@ -10,39 +10,45 @@ if exist "win32-dependencies.cmd" (
)
REM ########################################################################################################################
REM # To force build with VS 2008 with VS 2010 / VS 2012 installed as well, set the following to 1
SET SKIP_VS2010=0
SET SKIP_VS2012=0
SET VSTOOLS=
SET VSCMake=
SET OV_USE_VS2012=
if %SKIP_VS2012% == 1 (
echo Visual Studio 2012 detection skipped as requested
) else (
if exist "%VS110COMNTOOLS%vsvars32.bat" (
echo Found VS110 tools at "%VS110COMNTOOLS%" ...
CALL "%VS110COMNTOOLS%vsvars32.bat"
SET VSCMake=Visual Studio 11
SET OV_USE_VS2012=1
goto terminate
)
REM ########################################################################################################################
REM #
REM # By default, this script tries to find the newest VS first. If you want to use another version, execute e.g. GOTO VS2012
REM #
REM GOTO VS2012
:VS2013
if exist "%VS120COMNTOOLS%vsvars32.bat" (
echo Found VS120 tools at "%VS120COMNTOOLS%" ...
CALL "%VS120COMNTOOLS%vsvars32.bat"
SET VSCMake=Visual Studio 12
SET OV_USE_VS2013=1
goto terminate
)
if %SKIP_VS2010% == 1 (
echo Visual Studio 2010 detection skipped as requested
) else (
if exist "%VS100COMNTOOLS%vsvars32.bat" (
echo Found VS100 tools at "%VS100COMNTOOLS%" ...
CALL "%VS100COMNTOOLS%vsvars32.bat"
SET VSCMake=Visual Studio 10
goto terminate
)
:VS2012
if exist "%VS110COMNTOOLS%vsvars32.bat" (
echo Found VS110 tools at "%VS110COMNTOOLS%" ...
echo But VS2012 is not officially supported, if you want to try to use it, edit this script.
REM echo Found VS110 tools at "%VS120COMNTOOLS%" ...
REM CALL "%VS110COMNTOOLS%vsvars32.bat"
REM SET VSCMake=Visual Studio 11
REM SET OV_USE_VS2012=1
REM goto terminate
)
:VS2010
if exist "%VS100COMNTOOLS%vsvars32.bat" (
echo Found VS100 tools at "%VS100COMNTOOLS%" ...
CALL "%VS100COMNTOOLS%vsvars32.bat"
SET VSCMake=Visual Studio 10
goto terminate
)
:VS2008
if exist "%VS90COMNTOOLS%vsvars32.bat" (
echo Found VS90 tools at "%VS90COMNTOOLS%" ...
CALL "%VS90COMNTOOLS%vsvars32.bat"
......
......@@ -13,14 +13,21 @@ SET "OV_PATH_DATA=%OV_PATH_ROOT%\share\openvibe"
SET "OV_PATH_LIB=%OV_PATH_ROOT%\bin"
SET "PATH=%OV_PATH_ROOT%\bin;%PATH%"
REM Choose Visual Studio, try the non-free version first ...
REM Choose Visual Studio
REM Try the non-free version first ...
IF EXIST "%VSINSTALLDIR%\Common7\IDE\devenv.exe" (
"%VSINSTALLDIR%\Common7\IDE\devenv.exe" ..\local-tmp\visual\OpenViBE.sln
) else (
if defined OV_USE_VS2012 (
"%VSINSTALLDIR%\Common7\IDE\WDExpress.exe" ..\local-tmp\visual\OpenViBE.sln
) else (
"%VSINSTALLDIR%\Common7\IDE\VCExpress.exe" ..\local-tmp\visual\OpenViBE.sln
)
goto terminate
)
REM VS2012 Express
IF EXIST "%VSINSTALLDIR%\Common7\IDE\WDExpress.exe"
"%VSINSTALLDIR%\Common7\IDE\WDExpress.exe" ..\local-tmp\visual\OpenViBE.sln
goto terminate
)
REM Default, e.g. 2010 Express
"%VSINSTALLDIR%\Common7\IDE\VCExpress.exe" ..\local-tmp\visual\OpenViBE.sln
:terminate
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