From 60a0ba42808656f010b7c6b815cef0ca1bfc7909 Mon Sep 17 00:00:00 2001 From: Ari Koivula Date: Wed, 14 May 2014 17:50:27 +0300 Subject: [PATCH] Update VS project files to link win32-pthread. - I haven't found a good way of including external dependencies to VS projects yet. Win32-pthreads is assumed to be found at the same level as kvazaar dir and has the files x86/pthreadVC2.lib and x64/pthreadVC2.lib. - Win32-pthreads also requires the pthreadVC2.dll to be in PATH when running the program. Not sure what to do about that yet. We might need an installer for windows to handle that. - Disable openmp as it's no longer used. - Stop linking Ws2_32.lib as that hasn't been used for ages. --- build/C_Properties.props | 6 +++--- build/kvazaar_lib/kvazaar_lib.vcxproj | 18 ++++++++++++++++++ build/kvazaar_lib/kvazaar_lib.vcxproj.filters | 6 ++++++ src/threads.h | 2 +- 4 files changed, 28 insertions(+), 4 deletions(-) diff --git a/build/C_Properties.props b/build/C_Properties.props index 9d8881e9..ab4e26f8 100644 --- a/build/C_Properties.props +++ b/build/C_Properties.props @@ -13,12 +13,12 @@ AssemblyAndSourceCode MultiThreadedDebugDLL WIN32;WIN64;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - $(SolutionDir)..\src;$(SolutionDir)..\src\extras;$(SolutionDir)..\;%(AdditionalIncludeDirectories) + $(SolutionDir)..\..\pthreads\include;$(SolutionDir)..\src;$(SolutionDir)..\src\extras;$(SolutionDir)..\;%(AdditionalIncludeDirectories) 4244;4204;4206;4028 - true + false - Ws2_32.lib;%(AdditionalDependencies) + %(AdditionalDependencies) true Console diff --git a/build/kvazaar_lib/kvazaar_lib.vcxproj b/build/kvazaar_lib/kvazaar_lib.vcxproj index 873eb6f0..92789485 100644 --- a/build/kvazaar_lib/kvazaar_lib.vcxproj +++ b/build/kvazaar_lib/kvazaar_lib.vcxproj @@ -75,21 +75,37 @@ ARCH_X86_64=1 + + $(SolutionDir)..\..\pthreads\x64 + pthreadVC2.lib + ARCH_X86_64=0;PREFIX + + $(SolutionDir)..\..\pthreads\x86 + pthreadVC2.lib + ARCH_X86_64=0;PREFIX + + $(SolutionDir)..\..\pthreads\x86 + pthreadVC2.lib + ARCH_X86_64=1 + + $(SolutionDir)..\..\pthreads\x64 + pthreadVC2.lib + @@ -110,6 +126,7 @@ + @@ -130,6 +147,7 @@ + diff --git a/build/kvazaar_lib/kvazaar_lib.vcxproj.filters b/build/kvazaar_lib/kvazaar_lib.vcxproj.filters index 5f77fce9..ebab9e19 100644 --- a/build/kvazaar_lib/kvazaar_lib.vcxproj.filters +++ b/build/kvazaar_lib/kvazaar_lib.vcxproj.filters @@ -78,6 +78,9 @@ Source Files + + Source Files + @@ -140,6 +143,9 @@ Header Files + + Header Files + diff --git a/src/threads.h b/src/threads.h index 8fc766d4..a04b7950 100644 --- a/src/threads.h +++ b/src/threads.h @@ -20,9 +20,9 @@ ****************************************************************************/ #include -#include #ifdef __GNUC__ +#include #define ATOMIC_INC(ptr) __sync_add_and_fetch((volatile int32_t*)ptr, 1) #define ATOMIC_DEC(ptr) __sync_add_and_fetch((volatile int32_t*)ptr, -1)