3abc7d34d7
Change-Id: Id69e17563c4d64f6ead5e143077a7364520f65a0 Reviewed-on: https://dart-review.googlesource.com/c/93173 Auto-Submit: Daco Harkes <dacoharkes@google.com> Reviewed-by: Samir Jindel <sjindel@google.com> Commit-Queue: Samir Jindel <sjindel@google.com>
24 lines
684 B
Dart
24 lines
684 B
Dart
// Copyright (c) 2019, 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' as ffi;
|
|
|
|
import 'dylib_utils.dart';
|
|
|
|
typedef NativeDoubleUnOp = ffi.Double Function(ffi.Double);
|
|
|
|
typedef DoubleUnOp = double Function(double);
|
|
|
|
main(List<String> arguments) {
|
|
ffi.DynamicLibrary l = dlopenPlatformSpecific("ffi_test_dynamic_library");
|
|
print(l);
|
|
print(l.runtimeType);
|
|
|
|
var timesFour = l.lookupFunction<NativeDoubleUnOp, DoubleUnOp>("timesFour");
|
|
print(timesFour);
|
|
print(timesFour.runtimeType);
|
|
|
|
print(timesFour(3.0));
|
|
}
|