@@ -523,13 +523,13 @@ posix_error_with_filename(char* name)
523523 return PyErr_SetFromErrnoWithFilename (PyExc_OSError , name );
524524}
525525
526- #ifdef Py_WIN_WIDE_FILENAMES
526+ #ifdef MS_WINDOWS
527527static PyObject *
528528posix_error_with_unicode_filename (Py_UNICODE * name )
529529{
530530 return PyErr_SetFromErrnoWithUnicodeFilename (PyExc_OSError , name );
531531}
532- #endif /* Py_WIN_WIDE_FILENAMES */
532+ #endif /* MS_WINDOWS */
533533
534534
535535static PyObject *
@@ -556,7 +556,6 @@ win32_error(char* function, char* filename)
556556 return PyErr_SetFromWindowsErr (errno );
557557}
558558
559- #ifdef Py_WIN_WIDE_FILENAMES
560559static PyObject *
561560win32_error_unicode (char * function , Py_UNICODE * filename )
562561{
@@ -585,9 +584,7 @@ convert_to_unicode(PyObject **param)
585584 return (* param ) != NULL ;
586585}
587586
588- #endif /* Py_WIN_WIDE_FILENAMES */
589-
590- #endif
587+ #endif /* MS_WINDOWS */
591588
592589#if defined(PYOS_OS2 )
593590/**********************************************************************
@@ -686,7 +683,7 @@ posix_fildes(PyObject *fdobj, int (*func)(int))
686683 return Py_None ;
687684}
688685
689- #ifdef Py_WIN_WIDE_FILENAMES
686+ #ifdef MS_WINDOWS
690687static int
691688unicode_file_names (void )
692689{
@@ -741,7 +738,7 @@ posix_2str(PyObject *args,
741738 return Py_None ;
742739}
743740
744- #ifdef Py_WIN_WIDE_FILENAMES
741+ #ifdef MS_WINDOWS
745742static PyObject *
746743win32_1str (PyObject * args , char * func ,
747744 char * format , BOOL (__stdcall * funcA )(LPCSTR ),
@@ -1497,7 +1494,6 @@ IsUNCRootA(char *path, int pathlen)
14971494 #undef ISSLASH
14981495}
14991496
1500- #ifdef Py_WIN_WIDE_FILENAMES
15011497static BOOL
15021498IsUNCRootW (Py_UNICODE * path , int pathlen )
15031499{
@@ -1520,7 +1516,6 @@ IsUNCRootW(Py_UNICODE *path, int pathlen)
15201516
15211517 #undef ISSLASH
15221518}
1523- #endif /* Py_WIN_WIDE_FILENAMES */
15241519#endif /* MS_WINDOWS */
15251520
15261521static PyObject *
@@ -1540,7 +1535,7 @@ posix_do_stat(PyObject *self, PyObject *args,
15401535 int res ;
15411536 PyObject * result ;
15421537
1543- #ifdef Py_WIN_WIDE_FILENAMES
1538+ #ifdef MS_WINDOWS
15441539 /* If on wide-character-capable OS see if argument
15451540 is Unicode and if so use wide API. */
15461541 if (unicode_file_names ()) {
@@ -1603,7 +1598,7 @@ posix_access(PyObject *self, PyObject *args)
16031598 char * path ;
16041599 int mode ;
16051600
1606- #ifdef Py_WIN_WIDE_FILENAMES
1601+ #ifdef MS_WINDOWS
16071602 DWORD attr ;
16081603 if (unicode_file_names ()) {
16091604 PyUnicodeObject * po ;
@@ -1636,7 +1631,7 @@ posix_access(PyObject *self, PyObject *args)
16361631 return PyBool_FromLong (!(mode & 2 )
16371632 || !(attr & FILE_ATTRIBUTE_READONLY )
16381633 || (attr & FILE_ATTRIBUTE_DIRECTORY ));
1639- #else
1634+ #else /* MS_WINDOWS */
16401635 int res ;
16411636 if (!PyArg_ParseTuple (args , "eti:access" ,
16421637 Py_FileSystemDefaultEncoding , & path , & mode ))
@@ -1646,7 +1641,7 @@ posix_access(PyObject *self, PyObject *args)
16461641 Py_END_ALLOW_THREADS
16471642 PyMem_Free (path );
16481643 return PyBool_FromLong (res == 0 );
1649- #endif
1644+ #endif /* MS_WINDOWS */
16501645}
16511646
16521647#ifndef F_OK
@@ -1757,7 +1752,7 @@ posix_chmod(PyObject *self, PyObject *args)
17571752 char * path = NULL ;
17581753 int i ;
17591754 int res ;
1760- #ifdef Py_WIN_WIDE_FILENAMES
1755+ #ifdef MS_WINDOWS
17611756 DWORD attr ;
17621757 if (unicode_file_names ()) {
17631758 PyUnicodeObject * po ;
@@ -1807,7 +1802,7 @@ posix_chmod(PyObject *self, PyObject *args)
18071802 PyMem_Free (path );
18081803 Py_INCREF (Py_None );
18091804 return Py_None ;
1810- #else /* Py_WIN_WIDE_FILENAMES */
1805+ #else /* MS_WINDOWS */
18111806 if (!PyArg_ParseTuple (args , "eti:chmod" , Py_FileSystemDefaultEncoding ,
18121807 & path , & i ))
18131808 return NULL ;
@@ -2092,7 +2087,7 @@ posix_getcwdu(PyObject *self, PyObject *noargs)
20922087 char buf [1026 ];
20932088 char * res ;
20942089
2095- #ifdef Py_WIN_WIDE_FILENAMES
2090+ #ifdef MS_WINDOWS
20962091 DWORD len ;
20972092 if (unicode_file_names ()) {
20982093 wchar_t wbuf [1026 ];
@@ -2121,7 +2116,7 @@ posix_getcwdu(PyObject *self, PyObject *noargs)
21212116 if (wbuf2 != wbuf ) free (wbuf2 );
21222117 return resobj ;
21232118 }
2124- #endif
2119+ #endif /* MS_WINDOWS */
21252120
21262121 Py_BEGIN_ALLOW_THREADS
21272122#if defined(PYOS_OS2 ) && defined(PYCC_GCC )
@@ -2134,8 +2129,8 @@ posix_getcwdu(PyObject *self, PyObject *noargs)
21342129 return posix_error ();
21352130 return PyUnicode_Decode (buf , strlen (buf ), Py_FileSystemDefaultEncoding ,"strict ");
21362131}
2137- #endif
2138- #endif
2132+ #endif /* Py_USING_UNICODE */
2133+ #endif /* HAVE_GETCWD */
21392134
21402135
21412136#ifdef HAVE_LINK
@@ -2175,7 +2170,6 @@ posix_listdir(PyObject *self, PyObject *args)
21752170 char * bufptr = namebuf ;
21762171 Py_ssize_t len = sizeof (namebuf )- 5 ; /* only claim to have space for MAX_PATH */
21772172
2178- #ifdef Py_WIN_WIDE_FILENAMES
21792173 /* If on wide-character-capable OS see if argument
21802174 is Unicode and if so use wide API. */
21812175 if (unicode_file_names ()) {
@@ -2258,7 +2252,6 @@ posix_listdir(PyObject *self, PyObject *args)
22582252 are also valid. */
22592253 PyErr_Clear ();
22602254 }
2261- #endif
22622255
22632256 if (!PyArg_ParseTuple (args , "et#:listdir" ,
22642257 Py_FileSystemDefaultEncoding , & bufptr , & len ))
@@ -2482,7 +2475,7 @@ posix__getfullpathname(PyObject *self, PyObject *args)
24822475 Py_ssize_t insize = sizeof (inbuf );
24832476 char outbuf [MAX_PATH * 2 ];
24842477 char * temp ;
2485- #ifdef Py_WIN_WIDE_FILENAMES
2478+
24862479 if (unicode_file_names ()) {
24872480 PyUnicodeObject * po ;
24882481 if (PyArg_ParseTuple (args , "U|:_getfullpathname" , & po )) {
@@ -2512,7 +2505,7 @@ posix__getfullpathname(PyObject *self, PyObject *args)
25122505 are also valid. */
25132506 PyErr_Clear ();
25142507 }
2515- #endif
2508+
25162509 if (!PyArg_ParseTuple (args , "et#:_getfullpathname" ,
25172510 Py_FileSystemDefaultEncoding , & inbufp ,
25182511 & insize ))
@@ -2539,7 +2532,7 @@ posix_mkdir(PyObject *self, PyObject *args)
25392532 char * path = NULL ;
25402533 int mode = 0777 ;
25412534
2542- #ifdef Py_WIN_WIDE_FILENAMES
2535+ #ifdef MS_WINDOWS
25432536 if (unicode_file_names ()) {
25442537 PyUnicodeObject * po ;
25452538 if (PyArg_ParseTuple (args , "U|i:mkdir" , & po , & mode )) {
@@ -2573,7 +2566,7 @@ posix_mkdir(PyObject *self, PyObject *args)
25732566 PyMem_Free (path );
25742567 Py_INCREF (Py_None );
25752568 return Py_None ;
2576- #else
2569+ #else /* MS_WINDOWS */
25772570
25782571 if (!PyArg_ParseTuple (args , "et|i:mkdir" ,
25792572 Py_FileSystemDefaultEncoding , & path , & mode ))
@@ -2590,7 +2583,7 @@ posix_mkdir(PyObject *self, PyObject *args)
25902583 PyMem_Free (path );
25912584 Py_INCREF (Py_None );
25922585 return Py_None ;
2593- #endif
2586+ #endif /* MS_WINDOWS */
25942587}
25952588
25962589
@@ -2833,7 +2826,7 @@ second form is used, set the access and modified times to the current time.");
28332826static PyObject *
28342827posix_utime (PyObject * self , PyObject * args )
28352828{
2836- #ifdef Py_WIN_WIDE_FILENAMES
2829+ #ifdef MS_WINDOWS
28372830 PyObject * arg ;
28382831 PyUnicodeObject * obwpath ;
28392832 wchar_t * wpath = NULL ;
@@ -2911,7 +2904,7 @@ posix_utime(PyObject *self, PyObject *args)
29112904done :
29122905 CloseHandle (hFile );
29132906 return result ;
2914- #else /* Py_WIN_WIDE_FILENAMES */
2907+ #else /* MS_WINDOWS */
29152908
29162909 char * path = NULL ;
29172910 long atime , mtime , ausec , musec ;
@@ -2985,7 +2978,7 @@ posix_utime(PyObject *self, PyObject *args)
29852978#undef UTIME_ARG
29862979#undef ATIME
29872980#undef MTIME
2988- #endif /* Py_WIN_WIDE_FILENAMES */
2981+ #endif /* MS_WINDOWS */
29892982}
29902983
29912984
@@ -8273,7 +8266,7 @@ win32_startfile(PyObject *self, PyObject *args)
82738266 char * filepath ;
82748267 char * operation = NULL ;
82758268 HINSTANCE rc ;
8276- #ifdef Py_WIN_WIDE_FILENAMES
8269+
82778270 if (unicode_file_names ()) {
82788271 PyObject * unipath , * woperation = NULL ;
82798272 if (!PyArg_ParseTuple (args , "U|s:startfile" ,
@@ -8308,7 +8301,6 @@ win32_startfile(PyObject *self, PyObject *args)
83088301 Py_INCREF (Py_None );
83098302 return Py_None ;
83108303 }
8311- #endif
83128304
83138305normal :
83148306 if (!PyArg_ParseTuple (args , "et|s:startfile" ,
@@ -8328,7 +8320,7 @@ win32_startfile(PyObject *self, PyObject *args)
83288320 Py_INCREF (Py_None );
83298321 return Py_None ;
83308322}
8331- #endif
8323+ #endif /* MS_WINDOWS */
83328324
83338325#ifdef HAVE_GETLOADAVG
83348326PyDoc_STRVAR (posix_getloadavg__doc__ ,
0 commit comments