@@ -34,16 +34,29 @@ PERFORMANCE OF THIS SOFTWARE.
3434
3535extern int ResObj_Convert (PyObject * , Handle * ); /* From Resmodule.c */
3636
37- #if TARGET_API_MAC_CARBON
37+ #ifdef WITHOUT_FRAMEWORKS
38+ #if !TARGET_API_MAC_OS8
3839/* The Carbon headers define PRAGMA_ALIGN_SUPPORT to something illegal,
3940** because you shouldn't use it for Carbon. All good and well, but portable
4041** code still needs it. So, we undefine it here.
4142*/
4243#undef PRAGMA_ALIGN_SUPPORTED
4344#define PRAGMA_ALIGN_SUPPORTED 0
44- #endif /* TARGET_API_MAC_CARBON */
45+ #endif /* !TARGET_API_MAC_OS8 */
4546
4647#include "ICAPI.h"
48+ #else
49+ #include <Carbon/Carbon.h>
50+ typedef OSStatus ICError ;
51+ /* Some fields in ICMapEntry have changed names. */
52+ #define file_type fileType
53+ #define file_creator fileCreator
54+ #define post_creator postCreator
55+ #define creator_app_name creatorAppName
56+ #define post_app_name postAppName
57+ #define MIME_type MIMEType
58+ #define entry_name entryName
59+ #endif
4760
4861static PyObject * ErrorObject ;
4962
@@ -69,7 +82,7 @@ staticforward PyTypeObject Icitype;
6982
7083/* ---------------------------------------------------------------- */
7184
72- #if ! TARGET_API_MAC_CARBON
85+ #if TARGET_API_MAC_OS8
7386static char ici_ICFindConfigFile__doc__ [] =
7487"()->None; Find config file in standard places"
7588;
@@ -129,8 +142,6 @@ ici_ICChooseConfig(self, args)
129142 Py_INCREF (Py_None );
130143 return Py_None ;
131144}
132- #endif /* !TARGET_API_MAC_CARBON */
133-
134145
135146static char ici_ICChooseNewConfig__doc__ [] =
136147"()->None; Let the user choose a new config file"
@@ -150,6 +161,7 @@ ici_ICChooseNewConfig(self, args)
150161 Py_INCREF (Py_None );
151162 return Py_None ;
152163}
164+ #endif /* TARGET_API_MAC_OS8 */
153165
154166
155167static char ici_ICGetSeed__doc__ [] =
@@ -460,12 +472,12 @@ ici_ICMapTypeCreator(self, args)
460472
461473
462474static struct PyMethodDef ici_methods [] = {
463- #if ! TARGET_API_MAC_CARBON
475+ #if TARGET_API_MAC_OS8
464476 {"ICFindConfigFile" , (PyCFunction )ici_ICFindConfigFile , METH_VARARGS , ici_ICFindConfigFile__doc__ },
465477 {"ICFindUserConfigFile" , (PyCFunction )ici_ICFindUserConfigFile , METH_VARARGS , ici_ICFindUserConfigFile__doc__ },
466478 {"ICChooseConfig" , (PyCFunction )ici_ICChooseConfig , METH_VARARGS , ici_ICChooseConfig__doc__ },
467479 {"ICChooseNewConfig" , (PyCFunction )ici_ICChooseNewConfig , METH_VARARGS , ici_ICChooseNewConfig__doc__ },
468- #endif /* !TARGET_API_MAC_CARBON */
480+ #endif /* TARGET_API_MAC_OS8 */
469481 {"ICGetSeed" , (PyCFunction )ici_ICGetSeed , METH_VARARGS , ici_ICGetSeed__doc__ },
470482 {"ICBegin" , (PyCFunction )ici_ICBegin , METH_VARARGS , ici_ICBegin__doc__ },
471483 {"ICFindPrefHandle" , (PyCFunction )ici_ICFindPrefHandle , METH_VARARGS , ici_ICFindPrefHandle__doc__ },
0 commit comments