Skip to content

Commit 439db9c

Browse files
authored
[ffi] Remove type argument from structs (dart-archive/ffi#12)
* Remove type argument from structs * update version and changelog
1 parent e04e828 commit 439db9c

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

pkgs/ffi/CHANGELOG.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# Changelog
22

3-
## 0.1.2
3+
## 0.1.3-dev.2
4+
5+
Incorporate struct API changes (drop type argument of structs).
6+
7+
## 0.1.3-dev.1
48

59
* Adds top-level `allocate<T>()` and `free()` methods which can be used as a
610
replacement for the deprecated `Pointer.allocate<T>()` and `Pointer.free()`

pkgs/ffi/lib/src/utf16.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import 'package:ffi/ffi.dart';
1313
///
1414
/// [Utf16] is respresented as a struct so that `Pointer<Utf16>` can be used in
1515
/// native function signatures.
16-
class Utf16 extends Struct<Utf16> {
16+
class Utf16 extends Struct {
1717
/// Convert a [String] to a Utf16-encoded null-terminated C string.
1818
///
1919
/// If 'string' contains NULL bytes, the converted string will be truncated

pkgs/ffi/lib/src/utf8.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ final int _maxSize = sizeOf<IntPtr>() == 8 ? _kMaxSmi64 : _kMaxSmi32;
2020
//
2121
// TODO(https://github.com/dart-lang/ffi/issues/4): No need to use
2222
// 'asExternalTypedData' when Pointer operations are performant.
23-
class Utf8 extends Struct<Utf8> {
23+
class Utf8 extends Struct {
2424
/// Returns the length of a null-terminated string -- the number of (one-byte)
2525
/// characters before the first null byte.
2626
static int strlen(Pointer<Utf8> string) {

pkgs/ffi/pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: ffi
2-
version: 0.1.3-dev.1
2+
version: 0.1.3-dev.2
33
author: Dart Team <[email protected]>
44
homepage: https://github.com/dart-lang/ffi
55
description: Utilities for working with Foreign Function Interface (FFI) code.

0 commit comments

Comments
 (0)