Skip to content

Commit 08fc225

Browse files
committed
Adding Windows Phone 8.1 Silverlight support.
1 parent 922b02d commit 08fc225

File tree

12 files changed

+71
-32
lines changed

12 files changed

+71
-32
lines changed

Release/include/cpprest/ws_client.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
#ifndef _CASA_WS_CLIENT_H
2929
#define _CASA_WS_CLIENT_H
3030

31-
#if defined(__cplusplus_winrt) || !defined(_M_ARM)
31+
#if (defined(__cplusplus_winrt) || !defined(_M_ARM)) && !defined(CPPREST_EXCLUDE_WEBSOCKETS)
3232

3333
#include <memory>
3434
#include <limits>
@@ -37,7 +37,6 @@
3737

3838
#include "cpprest/xxpublic.h"
3939

40-
#if _NOT_PHONE8_
4140
#if defined(_MSC_VER) && (_MSC_VER >= 1800)
4241
#include <ppltasks.h>
4342
namespace pplx = Concurrency;
@@ -467,6 +466,5 @@ class websocket_client
467466

468467
}}}}
469468

470-
#endif // _NOT_PHONE8_
471469
#endif
472470
#endif /* _CASA_WS_CLIENT_H */

Release/include/cpprest/ws_msg.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,14 @@
2727
#ifndef _CASA_WS_MSG_H
2828
#define _CASA_WS_MSG_H
2929

30-
#if defined(__cplusplus_winrt) || !defined(_M_ARM)
30+
#if (defined(__cplusplus_winrt) || !defined(_M_ARM)) && !defined(CPPREST_EXCLUDE_WEBSOCKETS)
3131

3232
#include <memory>
3333
#include <limits>
3434

3535
#include "cpprest/xxpublic.h"
3636
#include "cpprest/producerconsumerstream.h"
3737

38-
#if _NOT_PHONE8_
3938
#if defined(_MSC_VER) && (_MSC_VER >= 1800)
4039
#include <ppltasks.h>
4140
namespace pplx = Concurrency;
@@ -280,6 +279,5 @@ class websocket_incoming_message
280279

281280
}}}}
282281

283-
#endif // _NOT_PHONE8_
284282
#endif
285283
#endif /* _CASA_WS_MSG_H */

Release/include/cpprest/xxpublic.h

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -44,30 +44,15 @@
4444
#endif
4545
#endif
4646

47-
// forward declarations of windows types
48-
49-
// for UINT_PTR types used in winsock APIs
50-
#ifdef _MS_WINDOWS
51-
#include <BaseTsd.h>
52-
#endif
53-
5447
// for guids, used in comm.h
55-
#ifdef MS_TARGET_APPLE
48+
#if defined(MS_TARGET_APPLE)
5649
#include "cpprest/details/apple_compat.h"
57-
#else
58-
#ifdef _MS_WINDOWS
59-
#include <Guiddef.h>
60-
#include "cpprest/details/windows_compat.h"
61-
#else
50+
#elif !defined(_MS_WINDOWS)
6251
#include "boost/uuid/uuid.hpp"
6352
#endif
64-
#endif
6553

6654
#define UNREACHABLE __assume(0)
6755

6856
#ifdef __clang__
6957
#include <cstdio>
70-
#endif
71-
72-
// Define the _NOT_PHONE8_ as non-windows or windows desktop without arm configuration or windows store app or windows phone8.1
73-
#define _NOT_PHONE8_ !defined(WINAPI_FAMILY) || (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP && !defined(_M_ARM)) || WINAPI_FAMILY == WINAPI_FAMILY_APP || (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP && _WIN32_WINNT == _WIN32_WINNT_WINBLUE)
58+
#endif

Release/src/build/vs11.wp8/casablanca110.wp8.vcxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434

3535
<ItemDefinitionGroup>
3636
<ClCompile>
37-
<PreprocessorDefinitions>WINAPI_FAMILY=WINAPI_FAMILY_PHONE_APP;_ASYNCRT_EXPORT;_PPLX_EXPORT;_PHONE8_;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
37+
<PreprocessorDefinitions>CPPREST_EXCLUDE_WEBSOCKETS;WINAPI_FAMILY=WINAPI_FAMILY_PHONE_APP;_ASYNCRT_EXPORT;_PPLX_EXPORT;_PHONE8_;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
3838
<AdditionalUsingDirectories>$(WindowsSDK_MetadataPath);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
3939
<CompileAsWinRT>true</CompileAsWinRT>
4040
<AdditionalIncludeDirectories>$(CasablancaIncludeDir);$(CasablancaSrcDir)\pch;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), build.root))\Build\version.props" />
4+
<PropertyGroup Label="Globals">
5+
<ProjectGuid>{E5F8A2F0-F713-4673-A42F-2CC4E8FB171B}</ProjectGuid>
6+
<Keyword>Win32Proj</Keyword>
7+
<DefaultLanguage>en-US</DefaultLanguage>
8+
<MinimumVisualStudioVersion>12.0</MinimumVisualStudioVersion>
9+
<SccProjectName>SAK</SccProjectName>
10+
<SccAuxPath>SAK</SccAuxPath>
11+
<SccLocalPath>SAK</SccLocalPath>
12+
<SccProvider>SAK</SccProvider>
13+
<WindowsAppContainer>true</WindowsAppContainer>
14+
<PostBuildEventUseInBuild>true</PostBuildEventUseInBuild>
15+
<ConfigurationType>DynamicLibrary</ConfigurationType>
16+
<PlatformToolset>v120</PlatformToolset>
17+
<WinRTProject>true</WinRTProject>
18+
<TargetXP>false</TargetXP>
19+
<!-- This is only necessary for dev12 toolset, due to an msbuild change introduced in dev12 -->
20+
<OutDir>$(OutDir)\$(MsBuildProjectName)</OutDir>
21+
<ApplicationType>Windows Phone Silverlight</ApplicationType>
22+
<ApplicationTypeRevision>8.1</ApplicationTypeRevision>
23+
</PropertyGroup>
24+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
25+
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), build.root))\Build\Config.Definitions.props" />
26+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
27+
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), build.root))\Build\Release.Product.Settings" />
28+
<ImportGroup Label="PropertySheets">
29+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
30+
</ImportGroup>
31+
<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
32+
<DebugFileSuffix>d</DebugFileSuffix>
33+
</PropertyGroup>
34+
<PropertyGroup>
35+
<TargetName>$(CppRestBaseFileName)120$(DebugFileSuffix)_wp81_$(CppRestSDKVersionFileSuffix)</TargetName>
36+
</PropertyGroup>
37+
<ItemDefinitionGroup>
38+
<ClCompile>
39+
<PreprocessorDefinitions>CPPREST_EXCLUDE_WEBSOCKETS;WINAPI_FAMILY=WINAPI_FAMILY_PHONE_APP;_ASYNCRT_EXPORT;_PPLX_EXPORT;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
40+
<AdditionalUsingDirectories>$(WindowsSdkDir)\References\CommonConfiguration\Neutral;$(VSInstallDir)\vc\vcpackages;$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
41+
<CompileAsWinRT>true</CompileAsWinRT>
42+
<AdditionalIncludeDirectories>$(CasablancaIncludeDir);$(CasablancaSrcDir)\pch;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
43+
<PrecompiledHeader>Use</PrecompiledHeader>
44+
<PrecompiledHeaderFile>stdafx.h</PrecompiledHeaderFile>
45+
<AdditionalOptions>-Zm250 %(AdditionalOptions)</AdditionalOptions>
46+
</ClCompile>
47+
<Link>
48+
<AdditionalDependencies>msxml6.lib;WindowsPhoneCore.lib;RuntimeObject.lib;PhoneAppModelHost.lib;%(AdditionalDependencies)</AdditionalDependencies>
49+
<GenerateWindowsMetadata>true</GenerateWindowsMetadata>
50+
</Link>
51+
</ItemDefinitionGroup>
52+
<Import Project="../sources.proj" />
53+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
54+
</Project>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<packages>
3+
</packages>

Release/src/build/vs12/casablanca120.vcxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
</ItemGroup>
3939
<ItemDefinitionGroup>
4040
<ClCompile>
41-
<PreprocessorDefinitions>_ASYNCRT_EXPORT;AZURESTORAGESERVICES_EXPORTS;_PPLX_EXPORT;WIN32;_MBCS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
41+
<PreprocessorDefinitions>_ASYNCRT_EXPORT;_PPLX_EXPORT;WIN32;_MBCS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
4242
<AdditionalIncludeDirectories>$(CasablancaIncludeDir);$(CasablancaSrcDir)\pch;$(WebsocketppIncludeDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
4343
<PrecompiledHeader>Use</PrecompiledHeader>
4444
<PrecompiledHeaderFile>stdafx.h</PrecompiledHeaderFile>

Release/src/dirs.proj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
<ItemGroup Condition="'$(OsVersion)|$(DevToolsVersion)'=='6.3|120' and '$(Platform)'!='x64'">
2828
<ProjectFile Include="build\vs12.wp81\casablanca120.wp81.vcxproj" />
29+
<ProjectFile Include="build\vs12.wps81\casablanca120.wps81.vcxproj" />
2930
</ItemGroup>
3031

3132
<ItemGroup Condition="'$(DevToolsVersion)'=='140'">

Release/src/utilities/asyncrt_utils.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525

2626
#include "stdafx.h"
2727

28+
#include <mutex>
29+
2830
#if defined(__cplusplus_winrt)
2931
using namespace Platform;
3032
using namespace Windows::Storage::Streams;

Release/src/websockets/client/ws_client.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
#include <memory>
3535
#include <thread>
3636

37-
#if (!defined(WINAPI_FAMILY) || WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP) && !defined(_M_ARM) && (!defined(_MSC_VER) || (_MSC_VER < 1900))
37+
#if ((!defined(WINAPI_FAMILY) || WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP) && !defined(_M_ARM) && (!defined(_MSC_VER) || (_MSC_VER < 1900))) && !defined(CPPREST_EXCLUDE_WEBSOCKETS)
3838
#if defined(__GNUC__)
3939
#include "pplx/threadpool.h"
4040
#pragma GCC diagnostic push

0 commit comments

Comments
 (0)