From f0dbb50eca72dce16bd85b5dccaa2c0c9243bd21 Mon Sep 17 00:00:00 2001 From: Benedikt Reinartz Date: Thu, 23 Dec 2021 23:42:04 +0100 Subject: [PATCH] Fix the PyGILState_STATE type CPython uses a bare `enum` here, both of .NET and C default to `int` enums, so this should be closer to the truth if no special compile options are used. --- src/runtime/native/PyGILState.cs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/runtime/native/PyGILState.cs b/src/runtime/native/PyGILState.cs index 35fe6c983..2e7f61029 100644 --- a/src/runtime/native/PyGILState.cs +++ b/src/runtime/native/PyGILState.cs @@ -1,11 +1,8 @@ -using System; -using System.Runtime.InteropServices; - namespace Python.Runtime.Native; /// PyGILState_STATE -[StructLayout(LayoutKind.Sequential)] -struct PyGILState +enum PyGILState { - IntPtr handle; + PyGILState_LOCKED, + PyGILState_UNLOCKED }