-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
in PiperLib.cs:
public struct OptionalLong
{
[MarshalAs(UnmanagedType.I1)] // ensures 1-byte boolean
public bool hasValue;
public long value;
}
[StructLayout(LayoutKind.Sequential)]
public struct OptionalPhonemeSilenceSecondsMap
{
[MarshalAs(UnmanagedType.I1)] // ensures 1-byte boolean
public bool hasValue;
public PhonemeSilenceSecondsMap* value;
}
Note the extra [MarshalAs(UnmanagedType.I1)]
! without them this produces random crashes (segmentation fault or illegal instructions)
bools in C are 1 byte, but in C# they are 4 bytes !!!
Metadata
Metadata
Assignees
Labels
No labels