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 Aug 25, 2023
1 parent aeb90ec commit f1c2d47
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Python/dynload_win.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,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 @@ -224,7 +223,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);
Expand Down

0 comments on commit f1c2d47

Please sign in to comment.