From 59aae5425fef1275480cc29c7bb06f2f4fcae261 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Fri, 22 Jul 2016 19:11:09 +0200 Subject: [PATCH] [registrar] Make sure we include the headers for NS[U]Integer / CGFloat to compile. Fixes #42673. (#465) https://bugzilla.xamarin.com/show_bug.cgi?id=42673 --- tools/common/StaticRegistrar.cs | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/tools/common/StaticRegistrar.cs b/tools/common/StaticRegistrar.cs index 7ce2466a2f..47ab158e57 100644 --- a/tools/common/StaticRegistrar.cs +++ b/tools/common/StaticRegistrar.cs @@ -1695,7 +1695,12 @@ namespace XamCore.Registrar { // Strip off the 'MonoTouch.' prefix if (!IsDualBuild) ns = type.Namespace.Substring (ns.IndexOf ('.') + 1); + + CheckNamespace (ns, exceptions); + } + void CheckNamespace (string ns, List exceptions) + { if (string.IsNullOrEmpty (ns)) return; @@ -1952,9 +1957,15 @@ namespace XamCore.Registrar { case "System.Double": return "double"; case "System.Boolean": return "BOOL"; // map managed 'bool' to ObjC BOOL = unsigned char case "System.Void": return "void"; - case "System.nint": return "NSInteger"; - case "System.nuint": return "NSUInteger"; - case "System.nfloat": return "CGFloat"; + case "System.nint": + CheckNamespace ("Foundation", exceptions); + return "NSInteger"; + case "System.nuint": + CheckNamespace ("Foundation", exceptions); + return "NSUInteger"; + case "System.nfloat": + CheckNamespace ("CoreGraphics", exceptions); + return "CGFloat"; case "System.DateTime": throw ErrorHelper.CreateError (4102, "The registrar found an invalid type `{0}` in signature for method `{2}`. Use `{1}` instead.", "System.DateTime", IsDualBuild ? "Foundation.NSDate" : CompatNamespace + ".Foundation.NSDate", descriptiveMethodName); case "ObjCRuntime.Selector":