From 1d20b1785087231ff8ebf5f9c50571e426f77a39 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Wed, 22 Jan 2014 20:17:40 -0500 Subject: [PATCH] Fix most of limelight common build for Windows Phone --- limelight-common/Platform.h | 4 +- limelight-common/PlatformSockets.h | 7 +++ limelight-common/PlatformThreads.c | 4 +- limelight-common/limelight-common.vcxproj | 56 +++++++++++++++++++++++ 4 files changed, 68 insertions(+), 3 deletions(-) diff --git a/limelight-common/Platform.h b/limelight-common/Platform.h index b5cc3df..a50ba9a 100644 --- a/limelight-common/Platform.h +++ b/limelight-common/Platform.h @@ -1,12 +1,12 @@ #pragma once +#include +#include #ifdef _WIN32 #include #else #include -#include -#include #include #endif diff --git a/limelight-common/PlatformSockets.h b/limelight-common/PlatformSockets.h index f78dcf6..cf77f1a 100644 --- a/limelight-common/PlatformSockets.h +++ b/limelight-common/PlatformSockets.h @@ -6,6 +6,13 @@ #include #define SetLastSocketError(x) WSASetLastError(x) #define LastSocketError() WSAGetLastError() + +#undef WINAPI_FAMILY +#define WINAPI_FAMILY WINAPI_FAMILY_DESKTOP_APP +#include +#undef WINAPI_FAMILY +#define WINAPI_FAMILY WINAPI_FAMILY_PHONE_APP + #else #include #include diff --git a/limelight-common/PlatformThreads.c b/limelight-common/PlatformThreads.c index 7e2de08..2fa6fbe 100644 --- a/limelight-common/PlatformThreads.c +++ b/limelight-common/PlatformThreads.c @@ -35,8 +35,10 @@ void* ThreadProc(void* context) { #endif void PltSleepMs(int ms) { -#ifdef LC_WINDOWS +#if defined(LC_WINDOWS) Sleep(ms); +#elif defined (LC_WINDOWS_PHONE) + WaitForSingleObjectEx(GetCurrentThread(), ms, FALSE); #else long usecs = (long)ms * 1000; usleep(usecs); diff --git a/limelight-common/limelight-common.vcxproj b/limelight-common/limelight-common.vcxproj index 71f5a97..263bc38 100644 --- a/limelight-common/limelight-common.vcxproj +++ b/limelight-common/limelight-common.vcxproj @@ -1,10 +1,18 @@  + + Debug + ARM + Debug Win32 + + Release + ARM + Release Win32 @@ -20,6 +28,11 @@ StaticLibrary true v120 + + + StaticLibrary + true + v110_wp80 Unicode @@ -29,15 +42,28 @@ true Unicode + + StaticLibrary + false + v110_wp80 + true + Unicode + + + + + + + @@ -53,6 +79,19 @@ true + + + + + Level3 + Disabled + WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) + + + Windows + true + + Level3 @@ -70,6 +109,23 @@ true + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) + + + Windows + true + true + true + +