Commit 6ef0c148 authored by Ghislain MARY's avatar Ghislain MARY

Fix compilation on Windows desktop.

parent 3eb5b409
......@@ -28,7 +28,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v110_wp80</PlatformToolset>
<PlatformToolset>v110</PlatformToolset>
<IgnoreImportLibrary>false</IgnoreImportLibrary>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
......@@ -41,7 +41,7 @@
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v110_wp80</PlatformToolset>
<PlatformToolset>v110</PlatformToolset>
<IgnoreImportLibrary>false</IgnoreImportLibrary>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
......@@ -57,7 +57,7 @@
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\$(TargetName)\</OutDir>
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)$(Platform)\$(Configuration)\$(TargetName)\</IntDir>
</PropertyGroup>
<PropertyGroup>
......@@ -220,11 +220,11 @@
<ClCompile Include="..\..\..\..\src\telephonyevents.c" />
<ClCompile Include="..\..\..\..\src\utils.c" />
<ClCompile Include="..\..\..\..\src\winrttimer.cpp">
<CompileAsWinRT>true</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Platform)'=='ARM'">true</CompileAsWinRT>
</ClCompile>
<ClCompile Include="..\..\..\..\src\zrtp.c" />
</ItemGroup>
<ItemGroup>
<ItemGroup Condition="'$(Platform)'=='ARM'">
<Reference Include="Windows">
<IsWinMDFile>true</IsWinMDFile>
</Reference>
......@@ -234,7 +234,7 @@
</Reference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsPhone\v$(TargetPlatformVersion)\Microsoft.Cpp.WindowsPhone.$(TargetPlatformVersion).targets" />
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsPhone\v$(TargetPlatformVersion)\Microsoft.Cpp.WindowsPhone.$(TargetPlatformVersion).targets" Condition="'$(Platform)'=='ARM'" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
\ No newline at end of file
......@@ -148,7 +148,7 @@ typedef __int16 int16_t;
typedef SOCKET ortp_socket_t;
#if WINAPI_FAMILY_APP
#ifdef WINAPI_FAMILY_PHONE_APP
typedef CONDITION_VARIABLE ortp_cond_t;
typedef SRWLOCK ortp_mutex_t;
#else
......
......@@ -9,7 +9,7 @@
typedef struct __STRUCT_SHARED_DATA__
{
DWORD m_nReference;
#if WINAPI_FAMILY_APP
#ifdef WINAPI_FAMILY_PHONE_APP
ULONGLONG m_ullStartTime;
#else
DWORD m_dwStartTime;
......@@ -29,7 +29,7 @@ extern DWORD dwoRTPLogLevel;
#define SHMEMSIZE sizeof(SHARED_DATA)
#if WINAPI_FAMILY_APP
#ifdef WINAPI_FAMILY_PHONE_APP
static SHARED_DATA sharedData;
#endif
static LPSHARED_DATA lpSharedData;
......@@ -59,7 +59,7 @@ BOOL WINAPI DllMain(
return FALSE;
}
#if WINAPI_FAMILY_APP
#ifdef WINAPI_FAMILY_PHONE_APP
fInit = TRUE;
lpSharedData = &sharedData;
#else
......@@ -94,7 +94,7 @@ BOOL WINAPI DllMain(
{
OutputDebugString("--> dll_entry.c - oRTP.dll - Initializing module\n");
#if WINAPI_FAMILY_APP
#ifdef WINAPI_FAMILY_PHONE_APP
lpSharedData->m_ullStartTime = GetTickCount64();
#else
lpSharedData->m_dwStartTime = GetTickCount();
......@@ -146,7 +146,7 @@ BOOL WINAPI DllMain(
ortp_exit();
UnregisterLog(&dwoRTPLogLevel, "LOG_ORTP");
#if !WINAPI_FAMILY_APP
#ifndef WINAPI_FAMILY_PHONE_APP
// Unmap shared memory from the process's address space.
UnmapViewOfFile(lpSharedData);
lpSharedData = NULL;
......
......@@ -202,7 +202,7 @@ int __ortp_thread_create(pthread_t *thread, pthread_attr_t *attr, void * (*routi
int WIN_mutex_init(ortp_mutex_t *mutex, void *attr)
{
#if WINAPI_FAMILY_APP
#ifdef WINAPI_FAMILY_PHONE_APP
InitializeSRWLock(mutex);
#else
*mutex=CreateMutex(NULL, FALSE, NULL);
......@@ -212,7 +212,7 @@ int WIN_mutex_init(ortp_mutex_t *mutex, void *attr)
int WIN_mutex_lock(ortp_mutex_t * hMutex)
{
#if WINAPI_FAMILY_APP
#ifdef WINAPI_FAMILY_PHONE_APP
AcquireSRWLockExclusive(hMutex);
#else
WaitForSingleObject(*hMutex, INFINITE); /* == WAIT_TIMEOUT; */
......@@ -222,7 +222,7 @@ int WIN_mutex_lock(ortp_mutex_t * hMutex)
int WIN_mutex_unlock(ortp_mutex_t * hMutex)
{
#if WINAPI_FAMILY_APP
#ifdef WINAPI_FAMILY_PHONE_APP
ReleaseSRWLockExclusive(hMutex);
#else
ReleaseMutex(*hMutex);
......@@ -232,7 +232,7 @@ int WIN_mutex_unlock(ortp_mutex_t * hMutex)
int WIN_mutex_destroy(ortp_mutex_t * hMutex)
{
#if !WINAPI_FAMILY_APP
#ifndef WINAPI_FAMILY_PHONE_APP
CloseHandle(*hMutex);
#endif
return 0;
......@@ -268,7 +268,7 @@ int WIN_thread_join(ortp_thread_t thread_h, void **unused)
{
if (thread_h!=NULL)
{
WaitForSingleObject(thread_h, INFINITE);
WaitForSingleObjectEx(thread_h, INFINITE, FALSE);
CloseHandle(thread_h);
}
return 0;
......@@ -276,7 +276,7 @@ int WIN_thread_join(ortp_thread_t thread_h, void **unused)
int WIN_cond_init(ortp_cond_t *cond, void *attr)
{
#if WINAPI_FAMILY_APP
#ifdef WINAPI_FAMILY_PHONE_APP
InitializeConditionVariable(cond);
#else
*cond=CreateEvent(NULL, FALSE, FALSE, NULL);
......@@ -286,7 +286,7 @@ int WIN_cond_init(ortp_cond_t *cond, void *attr)
int WIN_cond_wait(ortp_cond_t* hCond, ortp_mutex_t * hMutex)
{
#if WINAPI_FAMILY_APP
#ifdef WINAPI_FAMILY_PHONE_APP
SleepConditionVariableSRW(hCond, hMutex, INFINITE, 0);
#else
//gulp: this is not very atomic ! bug here ?
......@@ -299,7 +299,7 @@ int WIN_cond_wait(ortp_cond_t* hCond, ortp_mutex_t * hMutex)
int WIN_cond_signal(ortp_cond_t * hCond)
{
#if WINAPI_FAMILY_APP
#ifdef WINAPI_FAMILY_PHONE_APP
WakeConditionVariable(hCond);
#else
SetEvent(*hCond);
......@@ -315,7 +315,7 @@ int WIN_cond_broadcast(ortp_cond_t * hCond)
int WIN_cond_destroy(ortp_cond_t * hCond)
{
#if !WINAPI_FAMILY_APP
#ifndef WINAPI_FAMILY_PHONE_APP
CloseHandle(*hCond);
#endif
return 0;
......@@ -511,7 +511,7 @@ static HANDLE event=NULL;
/* portable named pipes */
ortp_pipe_t ortp_server_pipe_create(const char *name){
#if WINAPI_FAMILY_APP
#ifdef WINAPI_FAMILY_PHONE_APP
ortp_error("%s not supported!", __FUNCTION__);
return INVALID_HANDLE_VALUE;
#else
......@@ -534,7 +534,7 @@ even if nobody connects to the pipe.
ortp_server_pipe_close() makes this function to exit.
*/
ortp_pipe_t ortp_server_pipe_accept_client(ortp_pipe_t server){
#if WINAPI_FAMILY_APP
#ifdef WINAPI_FAMILY_PHONE_APP
ortp_error("%s not supported!", __FUNCTION__);
return INVALID_HANDLE_VALUE;
#else
......@@ -557,7 +557,7 @@ ortp_pipe_t ortp_server_pipe_accept_client(ortp_pipe_t server){
}
int ortp_server_pipe_close_client(ortp_pipe_t server){
#if WINAPI_FAMILY_APP
#ifdef WINAPI_FAMILY_PHONE_APP
ortp_error("%s not supported!", __FUNCTION__);
return -1;
#else
......@@ -566,7 +566,7 @@ int ortp_server_pipe_close_client(ortp_pipe_t server){
}
int ortp_server_pipe_close(ortp_pipe_t spipe){
#if WINAPI_FAMILY_APP
#ifdef WINAPI_FAMILY_PHONE_APP
ortp_error("%s not supported!", __FUNCTION__);
return -1;
#else
......@@ -577,7 +577,7 @@ int ortp_server_pipe_close(ortp_pipe_t spipe){
}
ortp_pipe_t ortp_client_pipe_connect(const char *name){
#if WINAPI_FAMILY_APP
#ifdef WINAPI_FAMILY_PHONE_APP
ortp_error("%s not supported!", __FUNCTION__);
return INVALID_HANDLE_VALUE;
#else
......@@ -626,7 +626,7 @@ typedef struct MapInfo{
static OList *maplist=NULL;
void *ortp_shm_open(unsigned int keyid, int size, int create){
#if WINAPI_FAMILY_APP
#ifdef WINAPI_FAMILY_PHONE_APP
ortp_error("%s not supported!", __FUNCTION__);
return NULL;
#else
......@@ -672,7 +672,7 @@ void *ortp_shm_open(unsigned int keyid, int size, int create){
}
void ortp_shm_close(void *mem){
#if WINAPI_FAMILY_APP
#ifdef WINAPI_FAMILY_PHONE_APP
ortp_error("%s not supported!", __FUNCTION__);
#else
OList *elem;
......@@ -701,7 +701,7 @@ void ortp_shm_close(void *mem){
void ortp_get_cur_time(ortpTimeSpec *ret){
#if defined(_WIN32_WCE) || defined(WIN32)
#if WINAPI_FAMILY_APP
#ifdef WINAPI_FAMILY_PHONE_APP
ULONGLONG timemillis = GetTickCount64();
ret->tv_sec = timemillis / 1000;
ret->tv_nsec = (timemillis % 1000) * 1000000LL;
......
......@@ -90,7 +90,7 @@ RtpTimer posix_timer={ 0,
#else //WIN32
#if WINAPI_FAMILY_APP
#ifdef WINAPI_FAMILY_PHONE_APP
#include "winrttimer.h"
......
......@@ -35,7 +35,7 @@
#if (_WIN32_WINNT >= 0x0600)
#include <delayimp.h>
#undef ExternC /* avoid redefinition... */
#if !WINAPI_FAMILY_APP
#ifndef WINAPI_FAMILY_PHONE_APP
#include <QOS2.h>
#endif
#endif
......
......@@ -33,12 +33,12 @@
#if (_WIN32_WINNT >= 0x0600)
#include <delayimp.h>
#undef ExternC
#if !WINAPI_FAMILY_APP
#ifndef WINAPI_FAMILY_PHONE_APP
#include <QOS2.h>
#endif
#endif
#if (defined(WIN32) || defined(_WIN32_WCE)) && !WINAPI_FAMILY_APP
#if (defined(WIN32) || defined(_WIN32_WCE)) && !defined(WINAPI_FAMILY_PHONE_APP)
#include <Mswsock.h>
#endif
......@@ -577,7 +577,7 @@ int rtp_session_set_dscp(RtpSession *session, int dscp){
// Don't do anything if socket hasn't been created yet
if (session->rtp.socket == (ortp_socket_t)-1) return 0;
#if (_WIN32_WINNT >= 0x0600) && !WINAPI_FAMILY_APP
#if (_WIN32_WINNT >= 0x0600) && !defined(WINAPI_FAMILY_PHONE_APP)
memset(&ovi, 0, sizeof(ovi));
ovi.dwOSVersionInfoSize = sizeof(ovi);
GetVersionEx((LPOSVERSIONINFO) & ovi);
......@@ -665,7 +665,7 @@ int rtp_session_set_dscp(RtpSession *session, int dscp){
ortp_error("Fail to set DSCP value on rtcp socket: %s",getSocketError());
}
}
#if (_WIN32_WINNT >= 0x0600) && !WINAPI_FAMILY_APP
#if (_WIN32_WINNT >= 0x0600) && !defined(WINAPI_FAMILY_PHONE_APP)
}
#endif
return retval;
......
......@@ -1170,7 +1170,7 @@ stunRand(void)
#if defined(_WIN32_WCE)
tick = GetTickCount ();
#elif WINAPI_FAMILY_APP
#elif defined(WINAPI_FAMILY_PHONE_APP)
tick = GetTickCount64();
#elif defined(_MSC_VER)
{
......
#include <windows.h>
#ifdef WINAPI_FAMILY_PHONE_APP
#using <Windows.winmd>
#include "winrttimer.h"
......@@ -7,8 +10,6 @@
using namespace Windows::Foundation;
using namespace Windows::System::Threading;
#if WINAPI_FAMILY_APP
class WinRTTimer
{
public:
......
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