Skip to content

Commit f32fcc6

Browse files
authored
deps(ffigen): pin ffigen to 19.0.0 (#3163)
* Update * Update * Update * Update * Update * Update test * Update test * Update CHANGELOG * Update CHANGELOG * Update native bindings * Test not verbose * fix test
1 parent dad9228 commit f32fcc6

File tree

8 files changed

+1106
-72084
lines changed

8 files changed

+1106
-72084
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
- Add `DioException` response data to error breadcrumb ([#3164](https://github.com/getsentry/sentry-dart/pull/3164))
1414
- Bumped `dio` min verion to `5.2.0`
1515

16+
### Dependencies
17+
18+
- Pin `ffigen` to `19.0.0` and add `objective_c` version `8.0.0` package used in `ffigen` on iOS and macOS ([#3163](https://github.com/getsentry/sentry-dart/pull/3163))
19+
1620
## 9.7.0-beta.1
1721

1822
### Features

packages/flutter/analysis_options.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ analyzer:
44
exclude:
55
- test/*.mocks.dart
66
- microbenchmarks/**
7+
- lib/src/native/cocoa/binding.dart
78
language:
89
strict-casts: true
910
strict-inference: true

packages/flutter/lib/src/native/c/binding.dart

Lines changed: 33 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// ignore_for_file: unused_field
1+
// ignore_for_file: unused_field
22

33
// AUTO GENERATED FILE, DO NOT EDIT.
44
//
@@ -131,16 +131,16 @@ class SentryNative {
131131
_value_new_objectPtr.asFunction<sentry_value_u Function()>();
132132

133133
/// Returns the type of the value passed.
134-
int value_get_type(
134+
sentry_value_type_t value_get_type(
135135
sentry_value_u value,
136136
) {
137-
return _value_get_type(
137+
return sentry_value_type_t.fromValue(_value_get_type(
138138
value,
139-
);
139+
));
140140
}
141141

142142
late final _value_get_typePtr =
143-
_lookup<ffi.NativeFunction<ffi.Int32 Function(sentry_value_u)>>(
143+
_lookup<ffi.NativeFunction<ffi.UnsignedInt Function(sentry_value_u)>>(
144144
'sentry_value_get_type');
145145
late final _value_get_type =
146146
_value_get_typePtr.asFunction<int Function(sentry_value_u)>();
@@ -499,7 +499,8 @@ class SentryNative {
499499
late final _options_get_dist = _options_get_distPtr.asFunction<
500500
ffi.Pointer<ffi.Char> Function(ffi.Pointer<sentry_options_s>)>();
501501

502-
/// Enables or disables debug printing mode.
502+
/// Enables or disables debug printing mode. To change the log level from the
503+
/// default DEBUG level, use `sentry_options_set_logger_level`.
503504
void options_set_debug(
504505
ffi.Pointer<sentry_options_s> opts,
505506
int debug,
@@ -855,6 +856,32 @@ class SentryNative {
855856
_sdk_namePtr.asFunction<ffi.Pointer<ffi.Char> Function()>();
856857
}
857858

859+
/// Type of a sentry value.
860+
enum sentry_value_type_t {
861+
SENTRY_VALUE_TYPE_NULL(0),
862+
SENTRY_VALUE_TYPE_BOOL(1),
863+
SENTRY_VALUE_TYPE_INT32(2),
864+
SENTRY_VALUE_TYPE_DOUBLE(3),
865+
SENTRY_VALUE_TYPE_STRING(4),
866+
SENTRY_VALUE_TYPE_LIST(5),
867+
SENTRY_VALUE_TYPE_OBJECT(6);
868+
869+
final int value;
870+
const sentry_value_type_t(this.value);
871+
872+
static sentry_value_type_t fromValue(int value) => switch (value) {
873+
0 => SENTRY_VALUE_TYPE_NULL,
874+
1 => SENTRY_VALUE_TYPE_BOOL,
875+
2 => SENTRY_VALUE_TYPE_INT32,
876+
3 => SENTRY_VALUE_TYPE_DOUBLE,
877+
4 => SENTRY_VALUE_TYPE_STRING,
878+
5 => SENTRY_VALUE_TYPE_LIST,
879+
6 => SENTRY_VALUE_TYPE_OBJECT,
880+
_ =>
881+
throw ArgumentError('Unknown value for sentry_value_type_t: $value'),
882+
};
883+
}
884+
858885
/// Represents a sentry protocol value.
859886
///
860887
/// The members of this type should never be accessed. They are only here
@@ -877,17 +904,6 @@ final class sentry_value_u extends ffi.Union {
877904
external double _double;
878905
}
879906

880-
/// Type of a sentry value.
881-
abstract class sentry_value_type_t {
882-
static const int SENTRY_VALUE_TYPE_NULL = 0;
883-
static const int SENTRY_VALUE_TYPE_BOOL = 1;
884-
static const int SENTRY_VALUE_TYPE_INT32 = 2;
885-
static const int SENTRY_VALUE_TYPE_DOUBLE = 3;
886-
static const int SENTRY_VALUE_TYPE_STRING = 4;
887-
static const int SENTRY_VALUE_TYPE_LIST = 5;
888-
static const int SENTRY_VALUE_TYPE_OBJECT = 6;
889-
}
890-
891907
/// The Sentry Client Options.
892908
///
893909
/// See https://docs.sentry.io/platforms/native/configuration/

0 commit comments

Comments
 (0)