Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Xcode16] Allow the runtime to compile with Xcode 16 beta 2. #5

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Make.config
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,8 @@ MACCATALYST_NUGET_VERSION_FULL=$(MACCATALYST_NUGET_VERSION_NO_METADATA)+$(NUGET_

# Xcode version should have both a major and a minor version (even if the minor version is 0)
XCODE_VERSION=16.0
XCODE_URL=https://dl.internalx.com/internal-files/xcodes/Xcode_16-beta.xip
XCODE_DEVELOPER_ROOT=/Applications/Xcode_16.0.0-beta.app/Contents/Developer
XCODE_URL=https://dl.internalx.com/internal-files/xcodes/Xcode_16-beta_2.xip
XCODE_DEVELOPER_ROOT=/Applications/Xcode_16.0.0-beta2.app/Contents/Developer
XCODE_PRODUCT_BUILD_VERSION:=$(shell /usr/libexec/PlistBuddy -c 'Print :ProductBuildVersion' $(XCODE_DEVELOPER_ROOT)/../version.plist 2>/dev/null || echo " $(shell tput setaf 1 2>/dev/null)The required Xcode ($(XCODE_VERSION)) is not installed in $(basename $(basename $(XCODE_DEVELOPER_ROOT)))$(shell tput sgr0 2>/dev/null)" >&2)

# We define stable Xcode as the Xcode app being named like "Xcode_#.#[.#].app"
Expand Down
12 changes: 10 additions & 2 deletions runtime/trampolines.m
Original file line number Diff line number Diff line change
Expand Up @@ -1153,11 +1153,13 @@
// If called multiple times in succession, the returned pointer can be passed as the second ptr argument, and it need only be freed once done iterating.
void *xamarin_nsvalue_to_nsrange (NSValue *value, void *ptr, MonoClass *managedType, void *context, GCHandle *exception_gchandle) { NSRange *valueptr = (NSRange *) (ptr ? ptr : xamarin_calloc (sizeof (NSRange))); *valueptr = [value rangeValue]; return valueptr; }
#if HAVE_UIKIT // Yep, these CoreGraphics-looking category method is defined in UIKit.
#if !TARGET_OS_WATCH
void *xamarin_nsvalue_to_cgaffinetransform (NSValue *value, void *ptr, MonoClass *managedType, void *context, GCHandle *exception_gchandle) { CGAffineTransform *valueptr = (CGAffineTransform *) (ptr ? ptr : xamarin_calloc (sizeof (CGAffineTransform))); *valueptr = [value CGAffineTransformValue]; return valueptr; }
void *xamarin_nsvalue_to_cgpoint (NSValue *value, void *ptr, MonoClass *managedType, void *context, GCHandle *exception_gchandle) { CGPoint *valueptr = (CGPoint *) (ptr ? ptr : xamarin_calloc (sizeof (CGPoint))); *valueptr = [value CGPointValue]; return valueptr; }
void *xamarin_nsvalue_to_cgrect (NSValue *value, void *ptr, MonoClass *managedType, void *context, GCHandle *exception_gchandle) { CGRect *valueptr = (CGRect *) (ptr ? ptr : xamarin_calloc (sizeof (CGRect))); *valueptr = [value CGRectValue]; return valueptr; }
void *xamarin_nsvalue_to_cgsize (NSValue *value, void *ptr, MonoClass *managedType, void *context, GCHandle *exception_gchandle) { CGSize *valueptr = (CGSize *) (ptr ? ptr : xamarin_calloc (sizeof (CGSize))); *valueptr = [value CGSizeValue]; return valueptr; }
void *xamarin_nsvalue_to_cgvector (NSValue *value, void *ptr, MonoClass *managedType, void *context, GCHandle *exception_gchandle) { CGVector *valueptr = (CGVector *) (ptr ? ptr : xamarin_calloc (sizeof (CGVector))); *valueptr = [value CGVectorValue]; return valueptr; }
#endif
void *xamarin_nsvalue_to_nsdirectionaledgeinsets(NSValue *value, void *ptr, MonoClass *managedType, void *context, GCHandle *exception_gchandle) {NSDirectionalEdgeInsets *valueptr =(NSDirectionalEdgeInsets *) (ptr ? ptr : xamarin_calloc (sizeof (NSDirectionalEdgeInsets)));*valueptr = [value directionalEdgeInsetsValue];return valueptr; }
#endif
#if HAVE_COREANIMATION
Expand Down Expand Up @@ -1217,7 +1219,9 @@
}
void *xamarin_nsvalue_to_scnvector4 (NSValue *value, void *ptr, MonoClass *managedType, void *context, GCHandle *exception_gchandle) { SCNVector4 *valueptr = (SCNVector4 *) (ptr ? ptr : xamarin_calloc (sizeof (SCNVector4))); *valueptr = [value SCNVector4Value]; return valueptr; }
#if HAVE_UIKIT
#if !TARGET_OS_WATCH
void *xamarin_nsvalue_to_uiedgeinsets (NSValue *value, void *ptr, MonoClass *managedType, void *context, GCHandle *exception_gchandle) { UIEdgeInsets *valueptr = (UIEdgeInsets *) (ptr ? ptr : xamarin_calloc (sizeof (UIEdgeInsets))); *valueptr = [value UIEdgeInsetsValue]; return valueptr; }
#endif
void *xamarin_nsvalue_to_uioffset (NSValue *value, void *ptr, MonoClass *managedType, void *context, GCHandle *exception_gchandle) { UIOffset *valueptr = (UIOffset *) (ptr ? ptr : xamarin_calloc (sizeof (UIOffset))); *valueptr = [value UIOffsetValue]; return valueptr; }
#endif

Expand All @@ -1244,11 +1248,13 @@

id xamarin_nsrange_to_nsvalue (MonoObject *value, void *context, GCHandle *exception_gchandle) { return [NSValue valueWithRange: *(NSRange *) mono_object_unbox (value)]; }
#if HAVE_UIKIT // yep, these CoreGraphics-looking category methods are defined in UIKit
#if !TARGET_OS_WATCH
id xamarin_cgaffinetransform_to_nsvalue (MonoObject *value, void *context, GCHandle *exception_gchandle) { return [NSValue valueWithCGAffineTransform: *(CGAffineTransform *) mono_object_unbox (value)]; }
id xamarin_cgpoint_to_nsvalue (MonoObject *value, void *context, GCHandle *exception_gchandle) { return [NSValue valueWithCGPoint: *(CGPoint *) mono_object_unbox (value)]; }
id xamarin_cgrect_to_nsvalue (MonoObject *value, void *context, GCHandle *exception_gchandle) { return [NSValue valueWithCGRect: *(CGRect *) mono_object_unbox (value)]; }
id xamarin_cgsize_to_nsvalue (MonoObject *value, void *context, GCHandle *exception_gchandle) { return [NSValue valueWithCGSize: *(CGSize *) mono_object_unbox (value)]; }
id xamarin_cgvector_to_nsvalue (MonoObject *value, void *context, GCHandle *exception_gchandle) { return [NSValue valueWithCGVector: *(CGVector *) mono_object_unbox (value)]; }
#endif
id xamarin_nsdirectionaledgeinsets_to_nsvalue(MonoObject *value, void *context, GCHandle *exception_gchandle) { return [NSValue valueWithDirectionalEdgeInsets:*(NSDirectionalEdgeInsets *)mono_object_unbox (value)]; }
#endif
#if HAVE_COREANIMATION
Expand All @@ -1269,7 +1275,7 @@
id xamarin_scnmatrix4_to_nsvalue (MonoObject *value, void *context, GCHandle *exception_gchandle) { return [NSValue valueWithSCNMatrix4: *(SCNMatrix4 *) mono_object_unbox (value)]; }
id xamarin_scnvector3_to_nsvalue (MonoObject *value, void *context, GCHandle *exception_gchandle) { return [NSValue valueWithSCNVector3: *(SCNVector3 *) mono_object_unbox (value)]; }
id xamarin_scnvector4_to_nsvalue (MonoObject *value, void *context, GCHandle *exception_gchandle) { return [NSValue valueWithSCNVector4: *(SCNVector4 *) mono_object_unbox (value)]; }
#if HAVE_UIKIT
#if HAVE_UIKIT && !TARGET_OS_WATCH
id xamarin_uiedgeinsets_to_nsvalue (MonoObject *value, void *context, GCHandle *exception_gchandle) { return [NSValue valueWithUIEdgeInsets: *(UIEdgeInsets *) mono_object_unbox (value)]; }
id xamarin_uioffset_to_nsvalue (MonoObject *value, void *context, GCHandle *exception_gchandle) { return [NSValue valueWithUIOffset: *(UIOffset *) mono_object_unbox (value)]; }
#endif
Expand Down Expand Up @@ -1600,6 +1606,7 @@
if (!strcmp (fullname, "Foundation.NSRange")) {
func = to_managed ? (void *) xamarin_nsvalue_to_nsrange : (void *) xamarin_nsrange_to_nsvalue;
#if HAVE_UIKIT // yep, these CoreGraphics-looking category methods are defined in UIKit
#if !TARGET_OS_WATCH
} else if (!strcmp (fullname, "CoreGraphics.CGAffineTransform")) {
func = to_managed ? (void *) xamarin_nsvalue_to_cgaffinetransform : (void *) xamarin_cgaffinetransform_to_nsvalue;
} else if (!strcmp (fullname, "CoreGraphics.CGPoint")) {
Expand All @@ -1610,6 +1617,7 @@
func = to_managed ? (void *) xamarin_nsvalue_to_cgsize : (void *) xamarin_cgsize_to_nsvalue;
} else if (!strcmp (fullname, "CoreGraphics.CGVector")) {
func = to_managed ? (void *) xamarin_nsvalue_to_cgvector : (void *) xamarin_cgvector_to_nsvalue;
#endif
} else if (!strcmp (fullname, "UIKit.NSDirectionalEdgeInsets")) {
func = to_managed ? (void *) xamarin_nsvalue_to_nsdirectionaledgeinsets : (void *) xamarin_nsdirectionaledgeinsets_to_nsvalue;
#endif
Expand Down Expand Up @@ -1641,7 +1649,7 @@
func = to_managed ? (void *) xamarin_nsvalue_to_scnvector3 : (void *) xamarin_scnvector3_to_nsvalue;
} else if (!strcmp (fullname, "SceneKit.SCNVector4")) {
func = to_managed ? (void *) xamarin_nsvalue_to_scnvector4 : (void *) xamarin_scnvector4_to_nsvalue;
#if HAVE_UIKIT
#if HAVE_UIKIT && !TARGET_OS_WATCH
} else if (!strcmp (fullname, "UIKit.UIEdgeInsets")) {
func = to_managed ? (void *) xamarin_nsvalue_to_uiedgeinsets : (void *) xamarin_uiedgeinsets_to_nsvalue;
} else if (!strcmp (fullname, "UIKit.UIOffset")) {
Expand Down
8 changes: 8 additions & 0 deletions runtime/xamarin/trampolines.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,13 @@ void *xamarin_nsnumber_to_nfloat (NSNumber *number, void *ptr, MonoClass *manage

// Returns a pointer to the value type, which must be freed using xamarin_free
void *xamarin_nsvalue_to_nsrange (NSValue *value, void *ptr, MonoClass *managedType, void *context, GCHandle *exception_gchandle);
#if !TARGET_OS_WATCH
void *xamarin_nsvalue_to_cgaffinetransform (NSValue *value, void *ptr, MonoClass *managedType, void *context, GCHandle *exception_gchandle);
void *xamarin_nsvalue_to_cgpoint (NSValue *value, void *ptr, MonoClass *managedType, void *context, GCHandle *exception_gchandle);
void *xamarin_nsvalue_to_cgrect (NSValue *value, void *ptr, MonoClass *managedType, void *context, GCHandle *exception_gchandle);
void *xamarin_nsvalue_to_cgsize (NSValue *value, void *ptr, MonoClass *managedType, void *context, GCHandle *exception_gchandle);
void *xamarin_nsvalue_to_cgvector (NSValue *value, void *ptr, MonoClass *managedType, void *context, GCHandle *exception_gchandle);
#endif
void *xamarin_nsvalue_to_catransform3d (NSValue *value, void *ptr, MonoClass *managedType, void *context, GCHandle *exception_gchandle);
void *xamarin_nsvalue_to_cllocationcoordinate2d (NSValue *value, void *ptr, MonoClass *managedType, void *context, GCHandle *exception_gchandle);
void *xamarin_nsvalue_to_cmtime (NSValue *value, void *ptr, MonoClass *managedType, void *context, GCHandle *exception_gchandle);
Expand All @@ -156,7 +158,9 @@ void *xamarin_nsvalue_to_mkcoordinatespan (NSValue *value, void *ptr, Mono
void *xamarin_nsvalue_to_scnmatrix4 (NSValue *value, void *ptr, MonoClass *managedType, void *context, GCHandle *exception_gchandle);
void *xamarin_nsvalue_to_scnvector3 (NSValue *value, void *ptr, MonoClass *managedType, void *context, GCHandle *exception_gchandle);
void *xamarin_nsvalue_to_scnvector4 (NSValue *value, void *ptr, MonoClass *managedType, void *context, GCHandle *exception_gchandle);
#if !TARGET_OS_WATCH
void *xamarin_nsvalue_to_uiedgeinsets (NSValue *value, void *ptr, MonoClass *managedType, void *context, GCHandle *exception_gchandle);
#endif
void *xamarin_nsvalue_to_uioffset (NSValue *value, void *ptr, MonoClass *managedType, void *context, GCHandle *exception_gchandle);
void *xamarin_nsvalue_to_nsdirectionaledgeinsets(NSValue *value, void *ptr, MonoClass *managedType, void *context, GCHandle *exception_gchandle);

Expand All @@ -177,11 +181,13 @@ id xamarin_nfloat_to_nsnumber (MonoObject *value, void *context, GCHandle *excep
id xamarin_nfloat_to_nsnumber (MonoObject *value, void *context, GCHandle *exception_gchandle);

id xamarin_nsrange_to_nsvalue (MonoObject *value, void *context, GCHandle *exception_gchandle);
#if !TARGET_OS_WATCH
id xamarin_cgaffinetransform_to_nsvalue (MonoObject *value, void *context, GCHandle *exception_gchandle);
id xamarin_cgpoint_to_nsvalue (MonoObject *value, void *context, GCHandle *exception_gchandle);
id xamarin_cgrect_to_nsvalue (MonoObject *value, void *context, GCHandle *exception_gchandle);
id xamarin_cgsize_to_nsvalue (MonoObject *value, void *context, GCHandle *exception_gchandle);
id xamarin_cgvector_to_nsvalue (MonoObject *value, void *context, GCHandle *exception_gchandle);
#endif
id xamarin_catransform3d_to_nsvalue (MonoObject *value, void *context, GCHandle *exception_gchandle);
id xamarin_cllocationcoordinate2d_to_nsvalue (MonoObject *value, void *context, GCHandle *exception_gchandle);
id xamarin_cmtime_to_nsvalue (MonoObject *value, void *context, GCHandle *exception_gchandle);
Expand All @@ -192,8 +198,10 @@ id xamarin_mkcoordinatespan_to_nsvalue (MonoObject *value, void *context,
id xamarin_scnmatrix4_to_nsvalue (MonoObject *value, void *context, GCHandle *exception_gchandle);
id xamarin_scnvector3_to_nsvalue (MonoObject *value, void *context, GCHandle *exception_gchandle);
id xamarin_scnvector4_to_nsvalue (MonoObject *value, void *context, GCHandle *exception_gchandle);
#if !TARGET_OS_WATCH
id xamarin_uiedgeinsets_to_nsvalue (MonoObject *value, void *context, GCHandle *exception_gchandle);
id xamarin_uioffset_to_nsvalue (MonoObject *value, void *context, GCHandle *exception_gchandle);
#endif
id xamarin_nsdirectionaledgeinsets_to_nsvalue(MonoObject *value, void *context, GCHandle *exception_gchandle);

// These functions can be passed as xamarin_id_to_managed_func/xamarin_managed_to_id_func parameters
Expand Down