1616
1717using Xamarin . Bundler ;
1818
19- #if MTOUCH || MMP || BUNDLER
19+ #if LEGACY_TOOLS || BUNDLER
2020using Xamarin . Utils ;
2121using TAssembly = Mono . Cecil . AssemblyDefinition ;
2222using TType = Mono . Cecil . TypeReference ;
3333using R = ObjCRuntime . Runtime ;
3434#endif
3535
36- #if ! ( MTOUCH || MMP || BUNDLER )
36+ #if ! ( LEGACY_TOOLS || BUNDLER )
3737using ProductException = ObjCRuntime . RuntimeException ;
3838#endif
3939
40- #if ! MTOUCH && ! MMP && ! BUNDLER
40+ #if ! LEGACY_TOOLS && ! BUNDLER
4141// static registrar needs them but they might not be marked (e.g. if System.Console is not used)
4242[ assembly: Preserve ( typeof ( System . Action ) ) ]
4343[ assembly: Preserve ( typeof ( System . Action < string > ) ) ]
@@ -89,15 +89,11 @@ public static List<ProductException> GetMT4127 (TMethod impl, List<TMethod> ifac
8989 }
9090
9191 abstract partial class Registrar {
92- #if MTOUCH || MMP || BUNDLER
92+ #if LEGACY_TOOLS || BUNDLER
9393 public Application App { get ; protected set ; }
9494#endif
9595
96- #if MMP || MTOUCH || BUNDLER
97- static string NFloatTypeName { get => Driver . IsDotNet ? "System.Runtime.InteropServices.NFloat" : "System.nfloat" ; }
98- #else
9996 const string NFloatTypeName = "System.Runtime.InteropServices.NFloat" ;
100- #endif
10197
10298 Dictionary < TAssembly , object > assemblies = new Dictionary < TAssembly , object > ( ) ; // Use Dictionary instead of HashSet to avoid pulling in System.Core.dll.
10399 // locking: all accesses must lock 'types'.
@@ -135,7 +131,7 @@ internal class ObjCType {
135131 public bool IsInformalProtocol ;
136132 public bool IsWrapper ;
137133 public bool IsGeneric ;
138- #if ! MTOUCH && ! MMP && ! BUNDLER
134+ #if ! LEGACY_TOOLS && ! BUNDLER
139135 public IntPtr Handle ;
140136#else
141137 public TType ProtocolWrapperType ;
@@ -152,7 +148,7 @@ internal class ObjCType {
152148
153149 public bool IsCategory { get { return CategoryAttribute is not null ; } }
154150
155- #if MTOUCH || MMP || BUNDLER
151+ #if LEGACY_TOOLS || BUNDLER
156152 HashSet < ObjCType > all_protocols ;
157153 // This contains all protocols in the type hierarchy.
158154 // Given a type T that implements a protocol with super protocols:
@@ -630,7 +626,7 @@ public bool IsConstructor {
630626 }
631627 }
632628
633- #if ! MMP && ! MTOUCH && ! BUNDLER
629+ #if ! LEGACY_TOOLS && ! BUNDLER
634630 // The ArgumentSemantic enum is public, and
635631 // I don't want to add another enum value there which
636632 // is just an internal implementation detail, so just
@@ -881,7 +877,7 @@ public Trampoline Trampoline {
881877 if ( trampoline != Trampoline . None )
882878 return trampoline ;
883879
884- #if MTOUCH || MMP || BUNDLER
880+ #if LEGACY_TOOLS || BUNDLER
885881 throw ErrorHelper . CreateError ( 8018 , Errors . MT8018 ) ;
886882#else
887883 var mi = ( System . Reflection . MethodInfo ) Method ;
@@ -1045,7 +1041,7 @@ public override string FullName {
10451041 }
10461042
10471043 internal class ObjCField : ObjCMember {
1048- #if ! MTOUCH && ! MMP && ! BUNDLER
1044+ #if ! LEGACY_TOOLS && ! BUNDLER
10491045 public int Size ;
10501046 public byte Alignment ;
10511047#else
@@ -1328,18 +1324,18 @@ internal static string AppKit {
13281324 }
13291325#endif
13301326
1331- #if MTOUCH || MMP || BUNDLER
1327+ #if LEGACY_TOOLS || BUNDLER
13321328 internal string AssemblyName {
13331329 get {
13341330 switch ( App . Platform ) {
13351331 case ApplePlatform . iOS :
1336- return Driver . IsDotNet ? "Microsoft.iOS" : "Xamarin .iOS";
1332+ return "Microsoft.iOS" ;
13371333 case ApplePlatform . TVOS :
1338- return Driver . IsDotNet ? "Microsoft.tvOS" : "Xamarin.TVOS ";
1334+ return "Microsoft.tvOS" ;
13391335 case ApplePlatform . MacOSX :
1340- return Driver . IsDotNet ? "Microsoft.macOS" : "Xamarin.Mac ";
1336+ return "Microsoft.macOS" ;
13411337 case ApplePlatform . MacCatalyst :
1342- return Driver . IsDotNet ? "Microsoft.MacCatalyst" : "Xamarin .MacCatalyst";
1338+ return "Microsoft.MacCatalyst" ;
13431339 default :
13441340 throw ErrorHelper . CreateError ( 71 , Errors . MX0071 , App . Platform , App . ProductName ) ;
13451341 }
@@ -1376,7 +1372,7 @@ public string PlatformAssembly {
13761372 }
13771373 }
13781374
1379- #if MTOUCH || MMP || BUNDLER
1375+ #if LEGACY_TOOLS || BUNDLER
13801376 // "#if MTOUCH" code does not need locking when accessing 'types', because mtouch is single-threaded.
13811377 public Dictionary < TType , ObjCType > Types {
13821378 get { return types ; }
@@ -1821,7 +1817,7 @@ ObjCType [] GetProtocols (ObjCType type, ref List<Exception> exceptions)
18211817 Type = iface ,
18221818 IsProtocol = true ,
18231819 } ;
1824- #if MMP || MTOUCH || BUNDLER
1820+ #if LEGACY_TOOLS || BUNDLER
18251821 objcType . ProtocolWrapperType = GetProtocolAttributeWrapperType ( objcType . Type ) ;
18261822 objcType . IsWrapper = objcType . ProtocolWrapperType is not null ;
18271823#endif
@@ -1985,7 +1981,7 @@ ObjCType RegisterTypeUnsafe (TType type, ref List<Exception> exceptions)
19851981 isInformalProtocol = pAttr . IsInformal ;
19861982 isProtocol = true ;
19871983
1988- #if MMP || MTOUCH || BUNDLER
1984+ #if LEGACY_TOOLS || BUNDLER
19891985 if ( pAttr . FormalSinceVersion is not null && pAttr . FormalSinceVersion > App . SdkVersion )
19901986 isInformalProtocol = ! isInformalProtocol ;
19911987#endif
@@ -2019,7 +2015,7 @@ ObjCType RegisterTypeUnsafe (TType type, ref List<Exception> exceptions)
20192015 objcType . VerifyAdoptedProtocolsNames ( ref exceptions ) ;
20202016 objcType . BaseType = isProtocol ? null : ( baseObjCType ?? objcType ) ;
20212017 objcType . Protocols = GetProtocols ( objcType , ref exceptions ) ;
2022- #if MMP || MTOUCH || BUNDLER
2018+ #if LEGACY_TOOLS || BUNDLER
20232019 objcType . ProtocolWrapperType = ( isProtocol && ! isInformalProtocol ) ? GetProtocolAttributeWrapperType ( objcType . Type ) : null ;
20242020#endif
20252021 objcType . IsWrapper = ( isProtocol && ! isInformalProtocol ) ? ( GetProtocolAttributeWrapperType ( objcType . Type ) is not null ) : ( objcType . RegisterAttribute is not null && objcType . RegisterAttribute . IsWrapper ) ;
@@ -2142,7 +2138,7 @@ ObjCType RegisterTypeUnsafe (TType type, ref List<Exception> exceptions)
21422138 }
21432139 }
21442140
2145- #if MMP || MTOUCH || BUNDLER
2141+ #if LEGACY_TOOLS || BUNDLER
21462142 // Special fields
21472143 if ( is_first_nonWrapper ) {
21482144 // static registrar
@@ -2209,7 +2205,7 @@ ObjCType RegisterTypeUnsafe (TType type, ref List<Exception> exceptions)
22092205 }
22102206 } else {
22112207 TMethod method = null ;
2212- #if MTOUCH || MMP || BUNDLER
2208+ #if LEGACY_TOOLS || BUNDLER
22132209 method = attrib . Method ;
22142210#endif
22152211 var objcMethod = new ObjCMethod ( this , objcType , method ) {
@@ -2258,14 +2254,14 @@ ObjCType RegisterTypeUnsafe (TType type, ref List<Exception> exceptions)
22582254 objcType . Add ( new ObjCField ( ) {
22592255 DeclaringType = objcType ,
22602256 Name = ca . Name ?? GetPropertyName ( property ) ,
2261- #if ! MTOUCH && ! MMP && ! BUNDLER
2257+ #if ! LEGACY_TOOLS && ! BUNDLER
22622258 Size = 8 ,
22632259 Alignment = ( byte ) 3 ,
22642260#endif
22652261 FieldType = "@" ,
22662262 IsProperty = true ,
22672263 IsStatic = IsStatic ( property ) ,
2268- #if MTOUCH || MMP || BUNDLER
2264+ #if LEGACY_TOOLS || BUNDLER
22692265 Property = property ,
22702266#endif
22712267 } , ref exceptions ) ;
@@ -2546,7 +2542,7 @@ public void RegisterAssembly (TAssembly assembly)
25462542
25472543 if ( exceptions . Count > 0 ) {
25482544 Exception ae = exceptions . Count == 1 ? exceptions [ 0 ] : new AggregateException ( exceptions ) ;
2549- #if ! MTOUCH && ! MMP && ! BUNDLER
2545+ #if ! LEGACY_TOOLS && ! BUNDLER
25502546 Runtime . NSLog ( ae . ToString ( ) ) ;
25512547#endif
25522548 throw ae ;
@@ -2661,7 +2657,7 @@ protected string GetExportedTypeName (TType type)
26612657 string GetBoolEncoding ( )
26622658 {
26632659 // map managed 'bool' to ObjC BOOL = 'unsigned char' in OSX and 32bit iOS architectures and 'bool' in 64bit iOS architectures
2664- #if MTOUCH || MMP || BUNDLER
2660+ #if LEGACY_TOOLS || BUNDLER
26652661 switch ( App . Platform ) {
26662662 case ApplePlatform . iOS :
26672663 case ApplePlatform . TVOS :
@@ -2786,7 +2782,7 @@ protected void UnlockRegistrar ()
27862782 System . Threading . Monitor . Exit ( types ) ;
27872783 }
27882784
2789- #if MTOUCH || MMP || BUNDLER
2785+ #if LEGACY_TOOLS || BUNDLER
27902786 internal static void NSLog ( string format , params object [ ] args )
27912787 {
27922788 Console . WriteLine ( format , args ) ;
0 commit comments