Skip to content
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
### Fixes

- In MAUI Android apps, generate and inject UUID to APK and upload ProGuard mapping to Sentry with the UUID ([#4532](https://github.com/getsentry/sentry-dotnet/pull/4532))
- Fixed WASM0001 warning when building Blazor WebAssembly projects ([#4519](https://github.com/getsentry/sentry-dotnet/pull/4519))

## 5.15.1

Expand Down
23 changes: 17 additions & 6 deletions src/Sentry/Platforms/Native/CFunctions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -322,14 +322,25 @@ private static Dictionary<long, DebugImage> LoadDebugImagesOnce(IDiagnosticLogge
[DllImport("sentry-native")]
internal static extern void sentry_value_decref(sentry_value_t value);

// native union sentry_value_u/t
[StructLayout(LayoutKind.Explicit)]
// Mirrors the native `sentry_value_t` union (uint64_t or double).
// Implemented with a single ulong backing field and BitConverter
// to reinterpret values, since explicit unions cause issues with
// Blazor WASM interop generators.
internal struct sentry_value_t
{
[FieldOffset(0)]
internal ulong _bits;
[FieldOffset(0)]
internal double _double;
private ulong _bits;

internal ulong Bits
{
readonly get => _bits;
set => _bits = value;
}

internal double Double
{
readonly get => BitConverter.UInt64BitsToDouble(_bits);
set => _bits = BitConverter.DoubleToUInt64Bits(value);
}
}

[DllImport("sentry-native")]
Expand Down
Loading