PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithFilenameObject(
PyObject *, PyObject *);
PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithFilename(PyObject *, const char *);
-#ifdef Py_WIN_WIDE_FILENAMES
+#ifdef MS_WINDOWS
PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithUnicodeFilename(
PyObject *, const Py_UNICODE *);
-#endif /* Py_WIN_WIDE_FILENAMES */
+#endif /* MS_WINDOWS */
PyAPI_FUNC(PyObject *) PyErr_Format(PyObject *, const char *, ...);
int, const char *);
PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErrWithFilename(
int, const char *);
-#ifdef Py_WIN_WIDE_FILENAMES
PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErrWithUnicodeFilename(
int, const Py_UNICODE *);
-#endif /* Py_WIN_WIDE_FILENAMES */
PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErr(int);
PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErrWithFilenameObject(
PyObject *,int, PyObject *);
PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErrWithFilename(
PyObject *,int, const char *);
-#ifdef Py_WIN_WIDE_FILENAMES
PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErrWithUnicodeFilename(
PyObject *,int, const Py_UNICODE *);
-#endif /* Py_WIN_WIDE_FILENAMES */
PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErr(PyObject *, int);
#endif /* MS_WINDOWS */
return PyErr_SetFromErrnoWithFilename(PyExc_OSError, name);
}
-#ifdef Py_WIN_WIDE_FILENAMES
+#ifdef MS_WINDOWS
static PyObject *
posix_error_with_unicode_filename(Py_UNICODE* name)
{
return PyErr_SetFromErrnoWithUnicodeFilename(PyExc_OSError, name);
}
-#endif /* Py_WIN_WIDE_FILENAMES */
+#endif /* MS_WINDOWS */
static PyObject *
return PyErr_SetFromWindowsErr(errno);
}
-#ifdef Py_WIN_WIDE_FILENAMES
static PyObject *
win32_error_unicode(char* function, Py_UNICODE* filename)
{
return (*param) != NULL;
}
-#endif /* Py_WIN_WIDE_FILENAMES */
-
-#endif
+#endif /* MS_WINDOWS */
#if defined(PYOS_OS2)
/**********************************************************************
return Py_None;
}
-#ifdef Py_WIN_WIDE_FILENAMES
+#ifdef MS_WINDOWS
static int
unicode_file_names(void)
{
return Py_None;
}
-#ifdef Py_WIN_WIDE_FILENAMES
+#ifdef MS_WINDOWS
static PyObject*
win32_1str(PyObject* args, char* func,
char* format, BOOL (__stdcall *funcA)(LPCSTR),
#undef ISSLASH
}
-#ifdef Py_WIN_WIDE_FILENAMES
static BOOL
IsUNCRootW(Py_UNICODE *path, int pathlen)
{
#undef ISSLASH
}
-#endif /* Py_WIN_WIDE_FILENAMES */
#endif /* MS_WINDOWS */
static PyObject *
int res;
PyObject *result;
-#ifdef Py_WIN_WIDE_FILENAMES
+#ifdef MS_WINDOWS
/* If on wide-character-capable OS see if argument
is Unicode and if so use wide API. */
if (unicode_file_names()) {
char *path;
int mode;
-#ifdef Py_WIN_WIDE_FILENAMES
+#ifdef MS_WINDOWS
DWORD attr;
if (unicode_file_names()) {
PyUnicodeObject *po;
char *path = NULL;
int i;
int res;
-#ifdef Py_WIN_WIDE_FILENAMES
+#ifdef MS_WINDOWS
DWORD attr;
if (unicode_file_names()) {
PyUnicodeObject *po;
release_bytes(opath);
Py_INCREF(Py_None);
return Py_None;
-#else /* Py_WIN_WIDE_FILENAMES */
+#else /* MS_WINDOWS */
if (!PyArg_ParseTuple(args, "O&i:chmod", PyUnicode_FSConverter,
&opath, &i))
return NULL;
char buf[1026];
char *res;
-#ifdef Py_WIN_WIDE_FILENAMES
+#ifdef MS_WINDOWS
if (!use_bytes && unicode_file_names()) {
wchar_t wbuf[1026];
wchar_t *wbuf2 = wbuf;
char *bufptr = namebuf;
Py_ssize_t len = sizeof(namebuf)-5; /* only claim to have space for MAX_PATH */
-#ifdef Py_WIN_WIDE_FILENAMES
/* If on wide-character-capable OS see if argument
is Unicode and if so use wide API. */
if (unicode_file_names()) {
are also valid. */
PyErr_Clear();
}
-#endif
if (!PyArg_ParseTuple(args, "O&:listdir",
PyUnicode_FSConverter, &opath))
char *path;
char outbuf[MAX_PATH*2];
char *temp;
-#ifdef Py_WIN_WIDE_FILENAMES
+#ifdef MS_WINDOWS
if (unicode_file_names()) {
PyUnicodeObject *po;
if (PyArg_ParseTuple(args, "U|:_getfullpathname", &po)) {
char *path;
int mode = 0777;
-#ifdef Py_WIN_WIDE_FILENAMES
+#ifdef MS_WINDOWS
if (unicode_file_names()) {
PyUnicodeObject *po;
if (PyArg_ParseTuple(args, "U|i:mkdir", &po, &mode)) {
static PyObject *
posix_utime(PyObject *self, PyObject *args)
{
-#ifdef Py_WIN_WIDE_FILENAMES
+#ifdef MS_WINDOWS
PyObject *arg;
PyUnicodeObject *obwpath;
wchar_t *wpath = NULL;
done:
CloseHandle(hFile);
return result;
-#else /* Py_WIN_WIDE_FILENAMES */
+#else /* MS_WINDOWS */
PyObject *opath;
char *path;
#undef UTIME_ARG
#undef ATIME
#undef MTIME
-#endif /* Py_WIN_WIDE_FILENAMES */
+#endif /* MS_WINDOWS */
}
char *filepath;
char *operation = NULL;
HINSTANCE rc;
-#ifdef Py_WIN_WIDE_FILENAMES
+
if (unicode_file_names()) {
PyObject *unipath, *woperation = NULL;
if (!PyArg_ParseTuple(args, "U|s:startfile",
Py_INCREF(Py_None);
return Py_None;
}
-#endif
normal:
if (!PyArg_ParseTuple(args, "O&|s:startfile",
return result;
}
-#ifdef Py_WIN_WIDE_FILENAMES
+#ifdef MS_WINDOWS
PyObject *
PyErr_SetFromErrnoWithUnicodeFilename(PyObject *exc, const Py_UNICODE *filename)
{
Py_XDECREF(name);
return result;
}
-#endif /* Py_WIN_WIDE_FILENAMES */
+#endif /* MS_WINDOWS */
PyObject *
PyErr_SetFromErrno(PyObject *exc)
return ret;
}
-#ifdef Py_WIN_WIDE_FILENAMES
PyObject *PyErr_SetExcFromWindowsErrWithUnicodeFilename(
PyObject *exc,
int ierr,
Py_XDECREF(name);
return ret;
}
-#endif /* Py_WIN_WIDE_FILENAMES */
PyObject *PyErr_SetExcFromWindowsErr(PyObject *exc, int ierr)
{
return result;
}
-#ifdef Py_WIN_WIDE_FILENAMES
PyObject *PyErr_SetFromWindowsErrWithUnicodeFilename(
int ierr,
const Py_UNICODE *filename)
Py_XDECREF(name);
return result;
}
-#endif /* Py_WIN_WIDE_FILENAMES */
#endif /* MS_WINDOWS */
void