Skip to content

Commit

Permalink
Make _Py_CheckPython3 extern
Browse files Browse the repository at this point in the history
it's declared in headers but defined as static here, remove it
also run `_Py_CheckPython3` only when using MSVC
  • Loading branch information
naveen521kk authored and lazka committed Dec 23, 2024
1 parent 3a36af7 commit ab49f83
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions Python/dynload_win.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,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;
Expand Down Expand Up @@ -226,9 +225,9 @@ dl_funcptr _PyImport_FindSharedFuncptrWindows(const char *prefix,
dl_funcptr p;
char funcname[258], *import_python;

#ifdef Py_ENABLE_SHARED
_Py_CheckPython3();
#endif /* Py_ENABLE_SHARED */
#ifdef _MSC_VER
_Py_CheckPython3();
#endif /* _MSC_VER */

wchar_t *wpathname = PyUnicode_AsWideCharString(pathname, NULL);
if (wpathname == NULL)
Expand Down

0 comments on commit ab49f83

Please sign in to comment.