diff --git a/runtime/include/dart_api_dl.h b/runtime/include/dart_api_dl.h index 804b2811cd6..39b97b68282 100644 --- a/runtime/include/dart_api_dl.h +++ b/runtime/include/dart_api_dl.h @@ -97,7 +97,9 @@ typedef void (*Dart_NativeMessageHandler_DL)(Dart_Port_DL dest_port_id, (Dart_Handle port, Dart_Port_DL * port_id)) \ /* Scopes */ \ F(Dart_EnterScope, void, (void)) \ - F(Dart_ExitScope, void, (void)) + F(Dart_ExitScope, void, (void)) \ + /* Objects */ \ + F(Dart_IsNull, bool, (Dart_Handle)) #define DART_API_ALL_DL_SYMBOLS(F) \ DART_NATIVE_API_DL_SYMBOLS(F) \ diff --git a/runtime/include/dart_version.h b/runtime/include/dart_version.h index b3b4924392e..a9b902e3b3e 100644 --- a/runtime/include/dart_version.h +++ b/runtime/include/dart_version.h @@ -11,6 +11,6 @@ // On backwards compatible changes the minor version is increased. // The versioning covers the symbols exposed in dart_api_dl.h #define DART_API_DL_MAJOR_VERSION 2 -#define DART_API_DL_MINOR_VERSION 0 +#define DART_API_DL_MINOR_VERSION 1 #endif /* RUNTIME_INCLUDE_DART_VERSION_H_ */ /* NOLINT */ diff --git a/samples/ffi/async/sample_async_callback.dart b/samples/ffi/async/sample_async_callback.dart index 4901c550296..e9d300fc4a1 100644 --- a/samples/ffi/async/sample_async_callback.dart +++ b/samples/ffi/async/sample_async_callback.dart @@ -27,7 +27,7 @@ main() async { print("C = C T1 or C T2."); print("Dart: Setup."); Expect.isTrue(NativeApi.majorVersion == 2); - Expect.isTrue(NativeApi.minorVersion >= 0); + Expect.isTrue(NativeApi.minorVersion >= 1); final initializeApi = dl.lookupFunction), int Function(Pointer)>("InitDartApiDL"); Expect.isTrue(initializeApi(NativeApi.initializeApiDLData) == 0); diff --git a/samples/ffi/async/sample_native_port_call.dart b/samples/ffi/async/sample_native_port_call.dart index 302a50fca3f..fd5fefc72c2 100644 --- a/samples/ffi/async/sample_native_port_call.dart +++ b/samples/ffi/async/sample_native_port_call.dart @@ -36,7 +36,7 @@ main() async { print("C = C T1 or C T2."); print("Dart: Setup."); Expect.isTrue(NativeApi.majorVersion == 2); - Expect.isTrue(NativeApi.minorVersion >= 0); + Expect.isTrue(NativeApi.minorVersion >= 1); final initializeApi = dl.lookupFunction), int Function(Pointer)>("InitDartApiDL"); Expect.isTrue(initializeApi(NativeApi.initializeApiDLData) == 0); diff --git a/samples/ffi/sample_ffi_functions_callbacks_closures.dart b/samples/ffi/sample_ffi_functions_callbacks_closures.dart index 1d08340517f..5fb0b7ac7b0 100644 --- a/samples/ffi/sample_ffi_functions_callbacks_closures.dart +++ b/samples/ffi/sample_ffi_functions_callbacks_closures.dart @@ -54,7 +54,7 @@ final closureCallbackPointer = void doDynamicLinking() { Expect.isTrue(NativeApi.majorVersion == 2); - Expect.isTrue(NativeApi.minorVersion >= 0); + Expect.isTrue(NativeApi.minorVersion >= 1); final initializeApi = testLibrary.lookupFunction< IntPtr Function(Pointer), int Function(Pointer)>("InitDartApiDL"); diff --git a/tests/ffi/vmspecific_handle_dynamically_linked_test.dart b/tests/ffi/vmspecific_handle_dynamically_linked_test.dart index 2b6e834ffdb..54535077cbb 100644 --- a/tests/ffi/vmspecific_handle_dynamically_linked_test.dart +++ b/tests/ffi/vmspecific_handle_dynamically_linked_test.dart @@ -13,11 +13,12 @@ import 'dylib_utils.dart'; void main() { doDynamicLinking(); testHandle(); + testNativeAPIs(); } void doDynamicLinking() { Expect.isTrue(NativeApi.majorVersion == 2); - Expect.isTrue(NativeApi.minorVersion >= 0); + Expect.isTrue(NativeApi.minorVersion >= 1); final initializeApi = testLibrary.lookupFunction< IntPtr Function(Pointer), int Function(Pointer)>("InitDartApiDL"); @@ -32,6 +33,13 @@ void testHandle() { Expect.isTrue(identical(s, result)); } +void testNativeAPIs() { + // No need to expect here, `lookupFunction` throws an argument error if lookup fails. + testLibrary.lookupFunction< + Bool Function(Handle), + bool Function(Object)>("Dart_IsNull_DL"); +} + class SomeClass { // We use this getter in the native api, don't tree shake it. @pragma("vm:entry-point") diff --git a/tests/ffi_2/vmspecific_handle_dynamically_linked_test.dart b/tests/ffi_2/vmspecific_handle_dynamically_linked_test.dart index 318be21f654..1f3c9499fce 100644 --- a/tests/ffi_2/vmspecific_handle_dynamically_linked_test.dart +++ b/tests/ffi_2/vmspecific_handle_dynamically_linked_test.dart @@ -15,11 +15,12 @@ import 'dylib_utils.dart'; void main() { doDynamicLinking(); testHandle(); + testNativeAPIs(); } void doDynamicLinking() { Expect.isTrue(NativeApi.majorVersion == 2); - Expect.isTrue(NativeApi.minorVersion >= 0); + Expect.isTrue(NativeApi.minorVersion >= 1); final initializeApi = testLibrary.lookupFunction< IntPtr Function(Pointer), int Function(Pointer)>("InitDartApiDL"); @@ -34,6 +35,13 @@ void testHandle() { Expect.isTrue(identical(s, result)); } +void testNativeAPIs() { + // No need to expect here, `lookupFunction` throws an argument error if lookup fails. + testLibrary.lookupFunction< + Bool Function(Handle), + bool Function(Object)>("Dart_IsNull_DL"); +} + class SomeClass { // We use this getter in the native api, don't tree shake it. @pragma("vm:entry-point")