Skip to content
This repository has been archived by the owner on Jan 17, 2024. It is now read-only.

ABI-specific integers #128

Merged
merged 10 commits into from
Jan 20, 2022
Merged

ABI-specific integers #128

merged 10 commits into from
Jan 20, 2022

Conversation

dcharkes
Copy link
Contributor

@dcharkes dcharkes commented Jan 4, 2022

A copy of c_type.dart from https://dart-review.googlesource.com/c/sdk/+/228541 which will only arrive in dart:ffi in 2.17 so that we can use this in Dart 2.16.

Adds support for the common C types:

  • char
  • unsigned char
  • signed char
  • short
  • unsigned short
  • int
  • unsigned int
  • long
  • unsigned long
  • long long
  • unsigned long long
  • uintptr_t
  • size_t
  • wchar_t

Requires Dart 2.16.

Unblocks:

@dcharkes dcharkes requested a review from mit-mit January 4, 2022 10:02
@dcharkes
Copy link
Contributor Author

dcharkes commented Jan 4, 2022

@mannprerak2 any types you think we should add to this PR?

@mannprerak2
Copy link

I think this would suffice.

Copy link

@mkustermann mkustermann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm with comments. Though our offline discussion decided we'll put them into dart:ffi. I suppose you're intending to do both?

lib/src/abi_specific_ints.dart Outdated Show resolved Hide resolved
lib/src/abi_specific_ints.dart Outdated Show resolved Hide resolved
lib/src/allocation.dart Outdated Show resolved Hide resolved
test/abi_specific_ints_test.dart Outdated Show resolved Hide resolved
@dcharkes
Copy link
Contributor Author

lgtm with comments. Though our offline discussion decided we'll put them into dart:ffi. I suppose you're intending to do both?

Yes both, so that we can use package:ffi with 2.16 stable and then dart:ffi from 2.17 stable (and then we reexport those in this package).

Let's land the SDK one first, we can do easier C++ tests there. And then copy the definitions over to this PR.

SDK CL: https://dart-review.googlesource.com/c/sdk/+/228541

@dcharkes dcharkes merged commit 5e801e8 into master Jan 20, 2022
dcharkes added a commit that referenced this pull request May 12, 2022
dcharkes added a commit that referenced this pull request May 13, 2022
@devoncarew devoncarew deleted the abi-specific branch May 9, 2023 02:15
dcharkes added a commit to dart-lang/native that referenced this pull request Jan 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants