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

[runtime] Simplify generated signatures by using native types. #2440

Closed

Conversation

rolfbjarne
Copy link
Member

There's no need to generate a 32-bit and 64-bit signature, because the binding
generator will automatically generate those based on any native types.

There's no need to generate a 32-bit and 64-bit signature, because the binding
generator will automatically generate those based on any native types.
@monojenkins
Copy link
Collaborator

Build failure

@spouliot spouliot added the do-not-merge Do not merge this pull request label Aug 8, 2017
@spouliot
Copy link
Contributor

spouliot commented Aug 8, 2017

@rolfbjarne that's the same I tried earlier (and ping'ed you about). I also ran into the same issues as the bots.

@rolfbjarne
Copy link
Member Author

@spouliot yeah, I tried to repro locally, but I didn't try the right test.

@rolfbjarne
Copy link
Member Author

The problem here is the mix of a native enum and native types in the signature.

The generator produces:

if (IntPtr.Size == 8) {
	ret = global::ObjCRuntime.Messaging.xamarin_simd__Matrix4_objc_msgSendSuper_Int64_CGSize_nfloat_nfloat (this.SuperHandle, Selector.GetHandle ("projectionMatrixForOrientation:viewportSize:zNear:zFar:"), (Int64)orientation, viewportSize, zNear, zFar);
} else {
	global::ObjCRuntime.Messaging.xamarin_simd__Matrix4_objc_msgSendSuper_stret_int_CGSize_nfloat_nfloat (out ret, this.SuperHandle, Selector.GetHandle ("projectionMatrixForOrientation:viewportSize:zNear:zFar:"), (int)orientation, viewportSize, zNear, zFar);
}

the binding generator automatically generates signatures for the 32-bit and 64-bit types as well, which means that when declaring a signature containing nint, nfloat, nfloat the binding generator generates:

  • nint_nfloat_nfloat
  • int_float_float
  • long_double_double

but if the first argument is a native enum, bgen generates calls to:

  • int_float_float (Classic)
  • int_nfloat_nfloat
  • long_nfloat_nfloat

which doesn't match the binding generator does, thus the need for the manual int/long signatures instead of nint signatures for native types.

@rolfbjarne rolfbjarne closed this Aug 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do-not-merge Do not merge this pull request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants