summaryrefslogtreecommitdiffstats
path: root/Mac/Modules
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>2001-05-12 21:31:34 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>2001-05-12 21:31:34 (GMT)
commit6e68a7e74f63f2aeda22e80e3fd9abdf3ada0f73 (patch)
tree896c33f8cae8a2ea91bd1a191cbcf85ca5ce1cef /Mac/Modules
parent1bd0a712ad4339df67415228d8a954ed5a40fc9d (diff)
downloadcpython-6e68a7e74f63f2aeda22e80e3fd9abdf3ada0f73.zip
cpython-6e68a7e74f63f2aeda22e80e3fd9abdf3ada0f73.tar.gz
cpython-6e68a7e74f63f2aeda22e80e3fd9abdf3ada0f73.tar.bz2
Be more sensible about when to use TARGET_API_MAC_OS8 in stead of !TARGET_API_MAC_CARBON. This should greatly facilitate porting stuff to OSX in its MachO/BSD incarnation.
Diffstat (limited to 'Mac/Modules')
-rw-r--r--Mac/Modules/macmodule.c12
-rw-r--r--Mac/Modules/macosmodule.c11
2 files changed, 13 insertions, 10 deletions
diff --git a/Mac/Modules/macmodule.c b/Mac/Modules/macmodule.c
index b9a56ef..d5f283b 100644
--- a/Mac/Modules/macmodule.c
+++ b/Mac/Modules/macmodule.c
@@ -31,7 +31,7 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <string.h>
#include <errno.h>
-#if !TARGET_API_MAC_CARBON
+#if TARGET_API_MAC_OS8
/* Skip for Carbon */
#include "macstat.h"
#endif
@@ -51,7 +51,7 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <sys/types.h>
#include <sys/stat.h>
#else /* USE_GUSI */
-#if !TARGET_API_MAC_CARBON
+#if TARGET_API_MAC_OS8
#define stat macstat
#endif
#endif /* USE_GUSI */
@@ -259,7 +259,7 @@ mac_fdopen(self, args)
}
#endif
-#if !TARGET_API_MAC_CARBON
+#if TARGET_API_MAC_OS8
static PyObject *
mac_getbootvol(self, args)
PyObject *self;
@@ -499,7 +499,7 @@ mac_fstat(self, args)
}
#endif /* WEHAVE_FSTAT */
-#if !TARGET_API_MAC_CARBON
+#if TARGET_API_MAC_OS8
static PyObject *
mac_xstat(self, args)
PyObject *self;
@@ -611,7 +611,7 @@ static struct PyMethodDef mac_methods[] = {
#ifdef WEHAVE_FSTAT
{"fstat", mac_fstat},
#endif
-#if !TARGET_API_MAC_CARBON
+#if TARGET_API_MAC_OS8
{"getbootvol", mac_getbootvol}, /* non-standard */
#endif
{"getcwd", mac_getcwd},
@@ -623,7 +623,7 @@ static struct PyMethodDef mac_methods[] = {
{"rename", mac_rename},
{"rmdir", mac_rmdir},
{"stat", mac_stat},
-#if !TARGET_API_MAC_CARBON
+#if TARGET_API_MAC_OS8
{"xstat", mac_xstat},
#endif
{"sync", mac_sync},
diff --git a/Mac/Modules/macosmodule.c b/Mac/Modules/macosmodule.c
index 6fe0bd0..dd6c837 100644
--- a/Mac/Modules/macosmodule.c
+++ b/Mac/Modules/macosmodule.c
@@ -360,7 +360,7 @@ MacOS_SetCreatorAndType(PyObject *self, PyObject *args)
#include <EPPC.h>
#include <Events.h>
-#if !TARGET_API_MAC_CARBON
+#if TARGET_API_MAC_OS8
static char accepthle_doc[] = "Get arguments of pending high-level event";
static PyObject *
@@ -704,7 +704,7 @@ MacOS_OutputSeen(PyObject *self, PyObject *args)
}
static PyMethodDef MacOS_Methods[] = {
-#if !TARGET_API_MAC_CARBON
+#if TARGET_API_MAC_OS8
{"AcceptHighLevelEvent", MacOS_AcceptHighLevelEvent, 1, accepthle_doc},
#endif
{"GetCreatorAndType", MacOS_GetCreatorAndType, 1, getcrtp_doc},
@@ -760,10 +760,13 @@ initMacOS()
Py_BuildValue("i", PyMac_AppearanceCompliant)) != 0)
return;
#if TARGET_API_MAC_CARBON
-/* Will need a different name for MachO-carbon later (macho?) */
#define PY_RUNTIMEMODEL "carbon"
-#else
+#elif TARGET_API_MAC_OS8
#define PY_RUNTIMEMODEL "ppc"
+#elif TARGET_API_MAC_OSX
+#define PY_RUNTIMEMODEL "macho"
+#else
+#error "None of the TARGET_API_MAC_XXX I know about is set"
#endif
if (PyDict_SetItemString(d, "runtimemodel",
Py_BuildValue("s", PY_RUNTIMEMODEL)) != 0)