Skip to content

Commit ca99b17

Browse files
committed
Remove Runtime._UCS dependency from CustomMarshaler
1 parent 52caf17 commit ca99b17

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Python.Runtime/CustomMarshaler.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,11 @@ public static int GetUnicodeByteLength(IntPtr p)
9191
var len = 0;
9292
while (true)
9393
{
94-
int c = Runtime._UCS == 2
95-
? Marshal.ReadInt16(p, len * 2)
96-
: Marshal.ReadInt32(p, len * 4);
94+
#if UCS2
95+
int c = Marshal.ReadInt16(p, len * 2);
96+
#else
97+
int c = Marshal.ReadInt32(p, len * 4);
98+
#endif
9799

98100
if (c == 0)
99101
{

0 commit comments

Comments
 (0)