From 33ad2086c16bf75d0b2b35d0e17f3b0fd1549afc Mon Sep 17 00:00:00 2001 From: John McCutchan Date: Mon, 11 Dec 2023 21:06:37 +0000 Subject: [PATCH] Expose Dart_Null_DL from dart_api_dl.h R=dacoharkes@google.com https://github.com/dart-lang/sdk/issues/54296 TEST=tests/ffi/vmspecific_handle_dynamically_linked_test.dart Change-Id: Ibcf6a387a4b6385b17c13ed4b3ce6422291a5f78 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/341061 Auto-Submit: John McCutchan Reviewed-by: Daco Harkes Commit-Queue: John McCutchan --- runtime/include/dart_api_dl.h | 3 ++- runtime/include/dart_version.h | 2 +- tests/ffi/vmspecific_handle_dynamically_linked_test.dart | 6 ++++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/runtime/include/dart_api_dl.h b/runtime/include/dart_api_dl.h index e090f5ee731..5088b4337c3 100644 --- a/runtime/include/dart_api_dl.h +++ b/runtime/include/dart_api_dl.h @@ -100,7 +100,8 @@ typedef void (*Dart_NativeMessageHandler_DL)(Dart_Port_DL dest_port_id, F(Dart_EnterScope, void, (void)) \ F(Dart_ExitScope, void, (void)) \ /* Objects */ \ - F(Dart_IsNull, bool, (Dart_Handle)) + F(Dart_IsNull, bool, (Dart_Handle)) \ + F(Dart_Null, Dart_Handle, (void)) // dart_api.h symbols that have been deprecated but are retained here // until we can make a breaking change bumping the major version number diff --git a/runtime/include/dart_version.h b/runtime/include/dart_version.h index e2d3651fbd3..cb343c0d3f1 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 3 +#define DART_API_DL_MINOR_VERSION 4 #endif /* RUNTIME_INCLUDE_DART_VERSION_H_ */ /* NOLINT */ diff --git a/tests/ffi/vmspecific_handle_dynamically_linked_test.dart b/tests/ffi/vmspecific_handle_dynamically_linked_test.dart index 77bc40537e2..a09074138f4 100644 --- a/tests/ffi/vmspecific_handle_dynamically_linked_test.dart +++ b/tests/ffi/vmspecific_handle_dynamically_linked_test.dart @@ -35,8 +35,14 @@ void testHandle() { void testNativeAPIs() { // No need to expect here, `lookupFunction` throws an argument error if lookup fails. + Expect.isTrue(testLibrary.providesSymbol("Dart_IsNull_DL")); testLibrary.lookupFunction( "Dart_IsNull_DL"); + Expect.isTrue(NativeApi.majorVersion == 2); + Expect.isTrue(NativeApi.minorVersion >= 4); + Expect.isTrue(testLibrary.providesSymbol("Dart_Null_DL")); + testLibrary + .lookupFunction("Dart_Null_DL"); } class SomeClass {