MINGW-packages/mingw-w64-python/0032-fix-using-dllhandle-and-winver-mingw.patch
2025-10-10 14:31:04 +02:00

37 lines
1.2 KiB
Diff

From dbf3d4a853e6c0b6ebec51d9ac104c30ee718d40 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9?=
<alexey.pawlow@gmail.com>
Date: Thu, 17 Jun 2021 18:52:06 +0530
Subject: [PATCH 032/N] fix using dllhandle and winver mingw
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: Алексей <alexey.pawlow@gmail.com>
---
Python/sysmodule.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index 6ed28ec..0182569 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -45,7 +45,7 @@ Data members:
# include <windows.h>
#endif /* MS_WINDOWS */
-#ifdef MS_COREDLL
+#if defined(MS_WINDOWS) && defined(Py_ENABLE_SHARED)
extern void *PyWin_DLLhModule;
/* A string loaded from the DLL at startup: */
extern const char *PyWin_DLLVersionString;
@@ -3429,7 +3429,7 @@ _PySys_InitCore(PyThreadState *tstate, PyObject *sysdict)
SET_SYS_FROM_STRING("byteorder", "little");
#endif
-#ifdef MS_COREDLL
+#if defined(MS_WINDOWS) && defined(Py_ENABLE_SHARED)
SET_SYS("dllhandle", PyLong_FromVoidPtr(PyWin_DLLhModule));
SET_SYS_FROM_STRING("winver", PyWin_DLLVersionString);
#endif