mirror of
https://github.com/python/cpython.git
synced 2025-08-03 00:23:06 +00:00
Fix Issue #9752: MSVC compiler warning due to undefined function
(Patch by Jon Anglin)
This commit is contained in:
parent
460ff3dd1c
commit
c7937791a1
1 changed files with 7 additions and 4 deletions
|
@ -25,6 +25,8 @@ extern "C" {
|
||||||
#ifdef MS_WINDOWS
|
#ifdef MS_WINDOWS
|
||||||
/* for stat.st_mode */
|
/* for stat.st_mode */
|
||||||
typedef unsigned short mode_t;
|
typedef unsigned short mode_t;
|
||||||
|
/* for _mkdir */
|
||||||
|
#include <direct.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
@ -1134,9 +1136,6 @@ write_compiled_module(PyCodeObject *co, char *cpathname, struct stat *srcstat)
|
||||||
time_t mtime = srcstat->st_mtime;
|
time_t mtime = srcstat->st_mtime;
|
||||||
#ifdef MS_WINDOWS /* since Windows uses different permissions */
|
#ifdef MS_WINDOWS /* since Windows uses different permissions */
|
||||||
mode_t mode = srcstat->st_mode & ~S_IEXEC;
|
mode_t mode = srcstat->st_mode & ~S_IEXEC;
|
||||||
mode_t dirmode = srcstat->st_mode | S_IEXEC; /* XXX Is this correct
|
|
||||||
for Windows?
|
|
||||||
2010-04-07 BAW */
|
|
||||||
#else
|
#else
|
||||||
mode_t mode = srcstat->st_mode & ~S_IXUSR & ~S_IXGRP & ~S_IXOTH;
|
mode_t mode = srcstat->st_mode & ~S_IXUSR & ~S_IXGRP & ~S_IXOTH;
|
||||||
mode_t dirmode = (srcstat->st_mode |
|
mode_t dirmode = (srcstat->st_mode |
|
||||||
|
@ -1156,8 +1155,12 @@ write_compiled_module(PyCodeObject *co, char *cpathname, struct stat *srcstat)
|
||||||
}
|
}
|
||||||
saved = *dirpath;
|
saved = *dirpath;
|
||||||
*dirpath = '\0';
|
*dirpath = '\0';
|
||||||
/* XXX call os.mkdir() or maybe CreateDirectoryA() on Windows? */
|
|
||||||
|
#ifdef MS_WINDOWS
|
||||||
|
if (_mkdir(cpathname) < 0 && errno != EEXIST) {
|
||||||
|
#else
|
||||||
if (mkdir(cpathname, dirmode) < 0 && errno != EEXIST) {
|
if (mkdir(cpathname, dirmode) < 0 && errno != EEXIST) {
|
||||||
|
#endif
|
||||||
*dirpath = saved;
|
*dirpath = saved;
|
||||||
if (Py_VerboseFlag)
|
if (Py_VerboseFlag)
|
||||||
PySys_WriteStderr(
|
PySys_WriteStderr(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue