From c04a8e9b4c8a595e6eb5feed1f7db07e46a4073c Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Tue, 28 Jan 2014 19:24:04 -0500 Subject: [PATCH] Fix debugging on WP with a huge hack --- limelight-common/Limelight-internal.h | 3 --- limelight-common/Platform.h | 10 ++++++++++ limelight-common/PlatformThreads.c | 4 ++++ 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/limelight-common/Limelight-internal.h b/limelight-common/Limelight-internal.h index e952dd1..abf08e3 100644 --- a/limelight-common/Limelight-internal.h +++ b/limelight-common/Limelight-internal.h @@ -5,9 +5,6 @@ #include "PlatformSockets.h" #include "Video.h" -#include -#define Limelog printf - char* allocateConfigDataForStreamConfig(PSTREAM_CONFIGURATION streamConfig); int getConfigDataSize(PSTREAM_CONFIGURATION streamConfig); diff --git a/limelight-common/Platform.h b/limelight-common/Platform.h index a50ba9a..c43cd9e 100644 --- a/limelight-common/Platform.h +++ b/limelight-common/Platform.h @@ -21,6 +21,16 @@ # define LC_POSIX #endif +#include +#ifdef LC_WINDOWS_PHONE +extern WCHAR DbgBuf[512]; +#define Limelog(s, ...) \ + swprintf(DbgBuf, sizeof(DbgBuf) / sizeof(WCHAR), L ## s, ##__VA_ARGS__); \ + OutputDebugString(DbgBuf) +#else +#define Limelog printf +#endif + #if defined(LC_WINDOWS_PHONE) || defined(LC_WINDOWS) #include #define LC_ASSERT _ASSERTE diff --git a/limelight-common/PlatformThreads.c b/limelight-common/PlatformThreads.c index 2fa6fbe..94e4e96 100644 --- a/limelight-common/PlatformThreads.c +++ b/limelight-common/PlatformThreads.c @@ -12,6 +12,10 @@ VOID WINAPI ApcFunc(ULONG_PTR parameter) { } #endif +#if defined(LC_WINDOWS_PHONE) +WCHAR DbgBuf[512]; +#endif + #ifdef LC_WINDOWS DWORD WINAPI ThreadProc(LPVOID lpParameter) { struct thread_context *ctx = (struct thread_context *)lpParameter;