diff --git a/runtime/include/dart_native_api.h b/runtime/include/dart_native_api.h index 4e3cd4d9495..79194e03ba8 100644 --- a/runtime/include/dart_native_api.h +++ b/runtime/include/dart_native_api.h @@ -50,13 +50,15 @@ typedef enum { Dart_CObject_kArray, Dart_CObject_kTypedData, Dart_CObject_kExternalTypedData, - Dart_CObject_kUnmodifiableExternalTypedData, Dart_CObject_kSendPort, Dart_CObject_kCapability, Dart_CObject_kNativePointer, Dart_CObject_kUnsupported, + Dart_CObject_kUnmodifiableExternalTypedData, Dart_CObject_kNumberOfTypes } Dart_CObject_Type; +// This enum is versioned by DART_API_DL_MAJOR_VERSION, only add at the end +// and bump the DART_API_DL_MINOR_VERSION. typedef struct _Dart_CObject { Dart_CObject_Type type; diff --git a/runtime/include/dart_version.h b/runtime/include/dart_version.h index a9b902e3b3e..680fb539bbe 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 1 +#define DART_API_DL_MINOR_VERSION 2 #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 e9d300fc4a1..12bdf66b0a0 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 >= 1); + Expect.isTrue(NativeApi.minorVersion >= 2); 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 fd5fefc72c2..11cf3c98262 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 >= 1); + Expect.isTrue(NativeApi.minorVersion >= 2); 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 5cccf917216..6f96071a226 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 >= 1); + Expect.isTrue(NativeApi.minorVersion >= 2); 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 54535077cbb..77bc40537e2 100644 --- a/tests/ffi/vmspecific_handle_dynamically_linked_test.dart +++ b/tests/ffi/vmspecific_handle_dynamically_linked_test.dart @@ -18,7 +18,7 @@ void main() { void doDynamicLinking() { Expect.isTrue(NativeApi.majorVersion == 2); - Expect.isTrue(NativeApi.minorVersion >= 1); + Expect.isTrue(NativeApi.minorVersion >= 2); final initializeApi = testLibrary.lookupFunction< IntPtr Function(Pointer), int Function(Pointer)>("InitDartApiDL"); @@ -35,9 +35,8 @@ void testHandle() { 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"); + testLibrary.lookupFunction( + "Dart_IsNull_DL"); } class SomeClass { diff --git a/tests/ffi_2/vmspecific_handle_dynamically_linked_test.dart b/tests/ffi_2/vmspecific_handle_dynamically_linked_test.dart index 1f3c9499fce..950a0234ac0 100644 --- a/tests/ffi_2/vmspecific_handle_dynamically_linked_test.dart +++ b/tests/ffi_2/vmspecific_handle_dynamically_linked_test.dart @@ -20,7 +20,7 @@ void main() { void doDynamicLinking() { Expect.isTrue(NativeApi.majorVersion == 2); - Expect.isTrue(NativeApi.minorVersion >= 1); + Expect.isTrue(NativeApi.minorVersion >= 2); final initializeApi = testLibrary.lookupFunction< IntPtr Function(Pointer), int Function(Pointer)>("InitDartApiDL"); @@ -37,9 +37,8 @@ void testHandle() { 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"); + testLibrary.lookupFunction( + "Dart_IsNull_DL"); } class SomeClass {