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

Commit 9205ce3

Browse files
committed
Add new MacPclExport for Xamarin.Mac
1 parent afca55f commit 9205ce3

File tree

1 file changed

+24
-3
lines changed

1 file changed

+24
-3
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
{

0 commit comments

Comments
 (0)