Kaydet (Commit) 6143d533 authored tarafından Jack Jansen's avatar Jack Jansen

Include Carbon/Carbon.h in stead of universal headers, if appropriate.

Test for TARGET_API_MAC_OS8 in stead of !TARGET_API_MAC_CARBON where
appropriate.
üst 9f66b4af
...@@ -34,16 +34,29 @@ PERFORMANCE OF THIS SOFTWARE. ...@@ -34,16 +34,29 @@ PERFORMANCE OF THIS SOFTWARE.
extern int ResObj_Convert(PyObject *, Handle *); /* From Resmodule.c */ extern int ResObj_Convert(PyObject *, Handle *); /* From Resmodule.c */
#if TARGET_API_MAC_CARBON #ifdef WITHOUT_FRAMEWORKS
#if !TARGET_API_MAC_OS8
/* The Carbon headers define PRAGMA_ALIGN_SUPPORT to something illegal, /* The Carbon headers define PRAGMA_ALIGN_SUPPORT to something illegal,
** because you shouldn't use it for Carbon. All good and well, but portable ** because you shouldn't use it for Carbon. All good and well, but portable
** code still needs it. So, we undefine it here. ** code still needs it. So, we undefine it here.
*/ */
#undef PRAGMA_ALIGN_SUPPORTED #undef PRAGMA_ALIGN_SUPPORTED
#define PRAGMA_ALIGN_SUPPORTED 0 #define PRAGMA_ALIGN_SUPPORTED 0
#endif /* TARGET_API_MAC_CARBON */ #endif /* !TARGET_API_MAC_OS8 */
#include "ICAPI.h" #include "ICAPI.h"
#else
#include <Carbon/Carbon.h>
typedef OSStatus ICError;
/* Some fields in ICMapEntry have changed names. */
#define file_type fileType
#define file_creator fileCreator
#define post_creator postCreator
#define creator_app_name creatorAppName
#define post_app_name postAppName
#define MIME_type MIMEType
#define entry_name entryName
#endif
static PyObject *ErrorObject; static PyObject *ErrorObject;
...@@ -69,7 +82,7 @@ staticforward PyTypeObject Icitype; ...@@ -69,7 +82,7 @@ staticforward PyTypeObject Icitype;
/* ---------------------------------------------------------------- */ /* ---------------------------------------------------------------- */
#if !TARGET_API_MAC_CARBON #if TARGET_API_MAC_OS8
static char ici_ICFindConfigFile__doc__[] = static char ici_ICFindConfigFile__doc__[] =
"()->None; Find config file in standard places" "()->None; Find config file in standard places"
; ;
...@@ -129,8 +142,6 @@ ici_ICChooseConfig(self, args) ...@@ -129,8 +142,6 @@ ici_ICChooseConfig(self, args)
Py_INCREF(Py_None); Py_INCREF(Py_None);
return Py_None; return Py_None;
} }
#endif /* !TARGET_API_MAC_CARBON */
static char ici_ICChooseNewConfig__doc__[] = static char ici_ICChooseNewConfig__doc__[] =
"()->None; Let the user choose a new config file" "()->None; Let the user choose a new config file"
...@@ -150,6 +161,7 @@ ici_ICChooseNewConfig(self, args) ...@@ -150,6 +161,7 @@ ici_ICChooseNewConfig(self, args)
Py_INCREF(Py_None); Py_INCREF(Py_None);
return Py_None; return Py_None;
} }
#endif /* TARGET_API_MAC_OS8 */
static char ici_ICGetSeed__doc__[] = static char ici_ICGetSeed__doc__[] =
...@@ -460,12 +472,12 @@ ici_ICMapTypeCreator(self, args) ...@@ -460,12 +472,12 @@ ici_ICMapTypeCreator(self, args)
static struct PyMethodDef ici_methods[] = { static struct PyMethodDef ici_methods[] = {
#if !TARGET_API_MAC_CARBON #if TARGET_API_MAC_OS8
{"ICFindConfigFile", (PyCFunction)ici_ICFindConfigFile, METH_VARARGS, ici_ICFindConfigFile__doc__}, {"ICFindConfigFile", (PyCFunction)ici_ICFindConfigFile, METH_VARARGS, ici_ICFindConfigFile__doc__},
{"ICFindUserConfigFile", (PyCFunction)ici_ICFindUserConfigFile, METH_VARARGS, ici_ICFindUserConfigFile__doc__}, {"ICFindUserConfigFile", (PyCFunction)ici_ICFindUserConfigFile, METH_VARARGS, ici_ICFindUserConfigFile__doc__},
{"ICChooseConfig", (PyCFunction)ici_ICChooseConfig, METH_VARARGS, ici_ICChooseConfig__doc__}, {"ICChooseConfig", (PyCFunction)ici_ICChooseConfig, METH_VARARGS, ici_ICChooseConfig__doc__},
{"ICChooseNewConfig", (PyCFunction)ici_ICChooseNewConfig, METH_VARARGS, ici_ICChooseNewConfig__doc__}, {"ICChooseNewConfig", (PyCFunction)ici_ICChooseNewConfig, METH_VARARGS, ici_ICChooseNewConfig__doc__},
#endif /* !TARGET_API_MAC_CARBON */ #endif /* TARGET_API_MAC_OS8 */
{"ICGetSeed", (PyCFunction)ici_ICGetSeed, METH_VARARGS, ici_ICGetSeed__doc__}, {"ICGetSeed", (PyCFunction)ici_ICGetSeed, METH_VARARGS, ici_ICGetSeed__doc__},
{"ICBegin", (PyCFunction)ici_ICBegin, METH_VARARGS, ici_ICBegin__doc__}, {"ICBegin", (PyCFunction)ici_ICBegin, METH_VARARGS, ici_ICBegin__doc__},
{"ICFindPrefHandle", (PyCFunction)ici_ICFindPrefHandle, METH_VARARGS, ici_ICFindPrefHandle__doc__}, {"ICFindPrefHandle", (PyCFunction)ici_ICFindPrefHandle, METH_VARARGS, ici_ICFindPrefHandle__doc__},
......
...@@ -25,12 +25,16 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ...@@ -25,12 +25,16 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include "Python.h" #include "Python.h"
#include "macglue.h" #include "macglue.h"
#ifdef WITHOUT_FRAMEWORKS
#include <Memory.h> #include <Memory.h>
#include <Files.h> #include <Files.h>
#include <Folders.h> #include <Folders.h>
#include <StandardFile.h> #include <StandardFile.h>
#include <Aliases.h> #include <Aliases.h>
#include <LowMem.h> #include <LowMem.h>
#else
#include <Carbon/Carbon.h>
#endif
#include "getapplbycreator.h" #include "getapplbycreator.h"
......
...@@ -28,11 +28,15 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ...@@ -28,11 +28,15 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include "macglue.h" #include "macglue.h"
#include "pythonresources.h" #include "pythonresources.h"
#ifdef WITHOUT_FRAMEWORKS
#include <Windows.h> #include <Windows.h>
#include <Files.h> #include <Files.h>
#include <LowMem.h> #include <LowMem.h>
#include <Sound.h> #include <Sound.h>
#include <Events.h> #include <Events.h>
#else
#include <Carbon/Carbon.h>
#endif
static PyObject *MacOS_Error; /* Exception MacOS.Error */ static PyObject *MacOS_Error; /* Exception MacOS.Error */
...@@ -354,13 +358,13 @@ MacOS_SetCreatorAndType(PyObject *self, PyObject *args) ...@@ -354,13 +358,13 @@ MacOS_SetCreatorAndType(PyObject *self, PyObject *args)
return Py_None; return Py_None;
} }
#if TARGET_API_MAC_OS8
/*----------------------------------------------------------------------*/ /*----------------------------------------------------------------------*/
/* STDWIN High Level Event interface */ /* STDWIN High Level Event interface */
#include <EPPC.h> #include <EPPC.h>
#include <Events.h> #include <Events.h>
#if TARGET_API_MAC_OS8
static char accepthle_doc[] = "Get arguments of pending high-level event"; static char accepthle_doc[] = "Get arguments of pending high-level event";
static PyObject * static PyObject *
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment