From ba5d6e48301132f8f7f695766be43a840ff178b7 Mon Sep 17 00:00:00 2001 From: Naveen M K Date: Sun, 18 Jun 2023 13:17:48 +0530 Subject: [PATCH 116/N] Make `_Py_CheckPython3` extern it's declared in headers but defined as static here, remove it also run `_Py_CheckPython3` only when using MSVC --- Python/dynload_win.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Python/dynload_win.c b/Python/dynload_win.c index 3686feb..122c071 100644 --- a/Python/dynload_win.c +++ b/Python/dynload_win.c @@ -169,8 +169,7 @@ static char *GetPythonImport (HINSTANCE hModule) Return whether the DLL was found. */ extern HMODULE PyWin_DLLhModule; -static int -_Py_CheckPython3(void) +int _Py_CheckPython3(void) { static int python3_checked = 0; static HANDLE hPython3; @@ -223,7 +222,9 @@ dl_funcptr _PyImport_FindSharedFuncptrWindows(const char *prefix, dl_funcptr p; char funcname[258], *import_python; - _Py_CheckPython3(); +#ifdef _MSC_VER + _Py_CheckPython3(); +#endif #if USE_UNICODE_WCHAR_CACHE const wchar_t *wpathname = _PyUnicode_AsUnicode(pathname);