#undef S_IFREG
#undef S_ISDIR
#undef S_ISREG
-#endif
+#endif /* THINK_C */
#include "macstat.h"
#ifdef USE_GUSI
#undef S_IWRITE
#undef S_IEXEC
+#ifdef USE_GUSI1
#include <GUSI.h>
+#endif /* USE_GUSI1 */
#include <sys/types.h>
-#include <stat.h>
-#else
+#include <sys/stat.h>
+#else /* USE_GUSI */
#define stat macstat
-#endif
+#endif /* USE_GUSI */
-#ifdef __MWERKS__
+#ifdef USE_GUSI2
+#define sync bad_sync
+#include <unistd.h>
+#include <fcntl.h>
+#undef sync
+int sync(void);
+#else
+#ifdef x__MWERKS__
#include <unix.h>
#else
#include <fcntl.h>
#endif
+#endif
/* Optional routines, for some compiler/runtime combinations */
#if defined(USE_GUSI) || !defined(__MWERKS__)
PyObject *self;
PyObject *args;
{
-#ifdef USE_GUSI
+#ifdef USE_GUSI1
PyObject *rv;
/* Change MacOS's idea of wd too */
Py_BEGIN_ALLOW_THREADS
res = close(fd);
Py_END_ALLOW_THREADS
-#ifndef USE_GUSI
+#ifndef USE_GUSI1
/* GUSI gives surious errors here? */
if (res < 0)
return mac_error();
if (!PyArg_ParseTuple(args, "s|i", &path, &mode))
return NULL;
Py_BEGIN_ALLOW_THREADS
-#ifdef USE_GUSI
+#ifdef USE_GUSI1
res = mkdir(path);
#else
res = mkdir(path, mode);