mirror of
https://github.com/dart-lang/sdk
synced 2024-10-04 23:21:42 +00:00
8a78aaf463
TEST=pkg/analyzer/test/src/diagnostics/ffi_native_test.dart TEST=tests/ffi/regress_49684_test.dart Closes: https://github.com/dart-lang/sdk/issues/49684 Change-Id: I756635c0a34aa18f3a3a2cbdcc0657b08cb5050e Cq-Include-Trybots: luci.dart.try:analyzer-linux-release-try,analyzer-mac-release-try,analyzer-win-release-try,analyzer-analysis-server-linux-try,vm-ffi-android-debug-arm64c-try,vm-precomp-ffi-qemu-linux-release-arm-try Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261400 Commit-Queue: Daco Harkes <dacoharkes@google.com> Auto-Submit: Daco Harkes <dacoharkes@google.com> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
29 lines
771 B
Dart
29 lines
771 B
Dart
// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file
|
|
// for details. All rights reserved. Use of this source code is governed by a
|
|
// BSD-style license that can be found in the LICENSE file.
|
|
|
|
import 'dart:ffi';
|
|
|
|
void main() {
|
|
// Does nothing, FfiNative aren't resolved.
|
|
}
|
|
|
|
@FfiNative<Int Function(Pointer<Int>, Int)>('subtract')
|
|
external int subtract(
|
|
Pointer<Int> a,
|
|
int b,
|
|
);
|
|
|
|
@FfiNative<Pointer<Double> Function(Pointer<Float>, Pointer<Float>)>(
|
|
'dividePrecision')
|
|
external Pointer<Double> dividePrecision(
|
|
Pointer<Float> a,
|
|
Pointer<Float> b,
|
|
);
|
|
|
|
@FfiNative<Void Function(Pointer)>('free')
|
|
external void posixFree(Pointer pointer);
|
|
|
|
@FfiNative<Void Function(Pointer)>('CoTaskMemFree')
|
|
external void winCoTaskMemFree(Pointer pv);
|