回答編集履歴
1
LayoutKind.Explicit に変更
test
CHANGED
@@ -8,18 +8,18 @@
|
|
8
8
|
public byte[] timestamp;
|
9
9
|
}
|
10
10
|
|
11
|
-
[StructLayoutAttribute(LayoutKind.
|
11
|
+
[StructLayoutAttribute(LayoutKind.Explicit)]
|
12
12
|
public struct EthPacket1
|
13
13
|
{
|
14
|
-
public EthPacket eth;
|
14
|
+
[FieldOffset(0)] public EthPacket eth;
|
15
|
-
public RawPoint raw;
|
15
|
+
[FieldOffset(9)] public RawPoint raw;
|
16
16
|
}
|
17
17
|
|
18
|
-
[StructLayoutAttribute(LayoutKind.
|
18
|
+
[StructLayoutAttribute(LayoutKind.Explicit)]
|
19
19
|
public struct EthPacket2
|
20
20
|
{
|
21
|
-
public EthPacket eth;
|
21
|
+
[FieldOffset(0)] public EthPacket eth;
|
22
|
-
public SpherPoint spher;
|
22
|
+
[FieldOffset(9)] public SpherPoint spher;
|
23
23
|
}
|
24
24
|
|
25
25
|
[StructLayoutAttribute(LayoutKind.Sequential)]
|