Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit 804d9c1

Browse files
committed
Merge branch 'master' of github.com:ServiceStack/ServiceStack.Text
2 parents b0a0f27 + d9ec3a4 commit 804d9c1

File tree

2 files changed

+30
-4
lines changed

2 files changed

+30
-4
lines changed

src/ServiceStack.Text/PclExport.Net40.cs

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,11 @@
2323
#if !__IOS__
2424
using System.Reflection.Emit;
2525
using FastMember = ServiceStack.Text.FastMember;
26-
#elif __UNIFIED__
26+
#endif
27+
28+
#if __UNIFIED__
2729
using Preserve = Foundation.PreserveAttribute;
28-
#else
30+
#elif __IOS__
2931
using Preserve = MonoTouch.Foundation.PreserveAttribute;
3032
#endif
3133

@@ -125,6 +127,7 @@ public override void RegisterLicenseFromConfig()
125127
{
126128
#if ANDROID
127129
#elif __IOS__
130+
#elif __MAC__
128131
#else
129132
//Automatically register license key stored in <appSettings/>
130133
var licenceKeyText = System.Configuration.ConfigurationManager.AppSettings[AppSettingsKey];
@@ -670,7 +673,25 @@ private static DynamicMethod CreateDynamicSetMethod(MemberInfo memberInfo)
670673
#endif
671674
}
672675

673-
#if __IOS__
676+
#if __MAC__
677+
public class MacPclExport : IosPclExport
678+
{
679+
public static new MacPclExport Provider = new MacPclExport();
680+
681+
public MacPclExport()
682+
{
683+
PlatformName = "MAC";
684+
SupportsEmit = SupportsExpression = true;
685+
}
686+
687+
public new static void Configure()
688+
{
689+
Configure(Provider);
690+
}
691+
}
692+
#endif
693+
694+
#if __IOS__ || __MAC__
674695
[Preserve(AllMembers = true)]
675696
internal class Poco
676697
{

src/ServiceStack.Text/PclExport.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ public static class Platforms
2222
{
2323
public const string WindowsStore = "WindowsStore";
2424
public const string Android = "Android";
25-
public const string IOS = "IOS";
25+
public const string IOS = "IOS";
26+
public const string Mac = "MAC";
2627
public const string Silverlight5 = "Silverlight5";
2728
public const string WindowsPhone = "WindowsPhone";
2829
}
@@ -40,6 +41,8 @@ public static PclExport Instance
4041
= new XboxPclExport()
4142
#elif __IOS__
4243
= new IosPclExport()
44+
#elif __MAC__
45+
= new MacPclExport()
4346
#elif ANDROID
4447
= new AndroidPclExport()
4548
#else
@@ -58,6 +61,8 @@ static PclExport()
5861
return;
5962
if (ConfigureProvider("ServiceStack.AndroidPclExportClient, ServiceStack.Pcl.Android"))
6063
return;
64+
if (ConfigureProvider("ServiceStack.MacPclExportClient, ServiceStack.Pcl.Mac20"))
65+
return;
6166
if (ConfigureProvider("ServiceStack.WinStorePclExportClient, ServiceStack.Pcl.WinStore"))
6267
return;
6368
if (ConfigureProvider("ServiceStack.Net40PclExportClient, ServiceStack.Pcl.Net45"))

0 commit comments

Comments
 (0)