Skip to content

Commit

Permalink
feat: update
Browse files Browse the repository at this point in the history
  • Loading branch information
caijw committed Apr 15, 2020
1 parent abd39e9 commit 4b193f3
Show file tree
Hide file tree
Showing 11 changed files with 4,598 additions and 4 deletions.
2 changes: 1 addition & 1 deletion ffi_demo/async/async_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ import 'sample_async_callback.dart' as sample0;
import 'sample_native_port_call.dart' as sample1;

main() {
sample0.main();
// sample0.main();
sample1.main();
}
2 changes: 1 addition & 1 deletion ffi_demo/async/sample_async_callback.dart
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ final callback1FP = Pointer.fromFunction<IntPtr Function(IntPtr)>(callback1, 0);

final callback2FP = Pointer.fromFunction<Void Function(IntPtr)>(callback2);

final dl = dlopenPlatformSpecific("ffi_test_functions");
final dl = dlopenPlatformSpecific("ffi_test_functions_vmspecific");

final registerCallback1 = dl.lookupFunction<
Void Function(Int64 sendPort,
Expand Down
2 changes: 1 addition & 1 deletion ffi_demo/async/sample_native_port_call.dart
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ void handleCppRequests(dynamic message) {
}
}

final dl = dlopenPlatformSpecific("ffi_test_functions");
final dl = dlopenPlatformSpecific("ffi_test_functions_vmspecific");

final registerSendPort = dl.lookupFunction<Void Function(Int64 sendPort),
void Function(int sendPort)>('RegisterSendPort');
Expand Down
5 changes: 5 additions & 0 deletions ffi_demo/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,8 @@ g++ -shared -m64 -Wl,-soname,libffi_test_dynamic_library.so -o libffi_test_dynam
g++ -fPIC -m64 -I/usr/lib/dart -DDART_SHARED_LIB -c ffi_test_functions.cc

g++ -shared -m64 -Wl,-soname,libffi_test_functions.so -o libffi_test_functions.so ffi_test_functions.o


g++ -fPIC -m64 -I/usr/lib/dart -DDART_SHARED_LIB -c ffi_test_functions_vmspecific.cc

g++ -shared -m64 -Wl,-soname,libffi_test_functions_vmspecific.so -o libffi_test_functions_vmspecific.so ffi_test_functions_vmspecific.o
Binary file added ffi_demo/ffi_test_functions_vmspecific.o
Binary file not shown.
Loading

0 comments on commit 4b193f3

Please sign in to comment.