Skip to content

Commit f1c2d47

Browse files
naveen521kklazka
authored andcommitted
Make _Py_CheckPython3 extern
it's declared in headers but defined as static here, remove it also run `_Py_CheckPython3` only when using MSVC
1 parent aeb90ec commit f1c2d47

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Python/dynload_win.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,7 @@ static char *GetPythonImport (HINSTANCE hModule)
170170
Return whether the DLL was found.
171171
*/
172172
extern HMODULE PyWin_DLLhModule;
173-
static int
174-
_Py_CheckPython3(void)
173+
int _Py_CheckPython3(void)
175174
{
176175
static int python3_checked = 0;
177176
static HANDLE hPython3;
@@ -224,7 +223,9 @@ dl_funcptr _PyImport_FindSharedFuncptrWindows(const char *prefix,
224223
dl_funcptr p;
225224
char funcname[258], *import_python;
226225

227-
_Py_CheckPython3();
226+
#ifdef _MSC_VER
227+
_Py_CheckPython3();
228+
#endif
228229

229230
#if USE_UNICODE_WCHAR_CACHE
230231
const wchar_t *wpathname = _PyUnicode_AsUnicode(pathname);

0 commit comments

Comments
 (0)