diff --git a/Misc/NEWS.d/next/Build/2020-05-17-03-33-00.bpo-40653.WI8UGn.rst b/Misc/NEWS.d/next/Build/2020-05-17-03-33-00.bpo-40653.WI8UGn.rst new file mode 100644 index 00000000000000..1e6c5cb32b722a --- /dev/null +++ b/Misc/NEWS.d/next/Build/2020-05-17-03-33-00.bpo-40653.WI8UGn.rst @@ -0,0 +1 @@ +Move _dirnameW out of HAVE_SYMLINK to fix a potential compiling issue. \ No newline at end of file diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 977e49f432a344..43d4302b92de75 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -7301,8 +7301,6 @@ win_readlink(PyObject *self, PyObject *args, PyObject *kwargs) -#ifdef HAVE_SYMLINK - #if defined(MS_WINDOWS) /* Grab CreateSymbolicLinkW dynamically from kernel32 */ @@ -7341,6 +7339,12 @@ _dirnameW(WCHAR *path) return 0; } +#endif + +#ifdef HAVE_SYMLINK + +#if defined(MS_WINDOWS) + /* Is this path absolute? */ static int _is_absW(const WCHAR *path)