Fixup fromcvs/togit conversion
[minix-pkgsrc.git] / lang / python26 / patches / patch-Mac_Modules_qd___Qdmodule.c
blob6c1897ce07b9926934d59755c7ea9446913a67e8
1 $NetBSD$
3 Fix build errors on Mac OS XLion.
5 --- Mac/Modules/qd/_Qdmodule.c.orig 2010-05-09 15:15:40.000000000 +0000
6 +++ Mac/Modules/qd/_Qdmodule.c
7 @@ -3,8 +3,14 @@
9 #include "Python.h"
11 +#include <AvailabilityMacros.h>
12 +#if (__MAC_OS_X_VERSION_MAX_ALLOWED >= 1070) || defined(__LP64__)
13 +#undef HAVE_CARBON
14 +#else
15 +#define HAVE_CARBON
16 +#endif
18 -#ifndef __LP64__
19 +#ifdef HAVE_CARBON
21 #include "pymactoolbox.h"
23 @@ -6545,10 +6551,10 @@ static PyObject *Qd_RawBitMap(PyObject *
24 return _res;
27 -#endif /* __LP64__ */
28 +#endif /* HAVE_CARBON */
30 static PyMethodDef Qd_methods[] = {
31 -#ifndef __LP64__
32 +#ifdef HAVE_CARBON
33 {"GetPort", (PyCFunction)Qd_GetPort, 1,
34 PyDoc_STR("() -> (GrafPtr port)")},
35 {"GrafDevice", (PyCFunction)Qd_GrafDevice, 1,
36 @@ -7083,12 +7089,12 @@ static PyMethodDef Qd_methods[] = {
37 PyDoc_STR("Take (string, int, Rect) argument and create BitMap")},
38 {"RawBitMap", (PyCFunction)Qd_RawBitMap, 1,
39 PyDoc_STR("Take string BitMap and turn into BitMap object")},
40 -#endif /* __LP64__ */
41 +#endif /* HAVE_CARBON */
42 {NULL, NULL, 0}
46 -#ifndef __LP64__
47 +#ifdef HAVE_CARBON
49 /* Like BMObj_New, but the original bitmap data structure is copied (and
50 ** released when the object is released)
51 @@ -7106,13 +7112,13 @@ PyObject *BMObj_NewCopied(BitMapPtr itse
52 return (PyObject *)it;
55 -#endif /* __LP64__ */
56 +#endif /* HAVE_CARBON */
59 void init_Qd(void)
61 PyObject *m;
62 -#ifndef __LP64__
63 +#ifdef HAVE_CARBON
64 PyObject *d;
67 @@ -7124,10 +7130,10 @@ void init_Qd(void)
68 PyMac_INIT_TOOLBOX_OBJECT_NEW(RGBColorPtr, QdRGB_New);
69 PyMac_INIT_TOOLBOX_OBJECT_CONVERT(RGBColor, QdRGB_Convert);
71 -#endif /* __LP64__ */
72 +#endif /* HAVE_CARBON */
74 m = Py_InitModule("_Qd", Qd_methods);
75 -#ifndef __LP64__
76 +#ifdef HAVE_CARBON
77 d = PyModule_GetDict(m);
78 Qd_Error = PyMac_GetOSErrException();
79 if (Qd_Error == NULL ||
80 @@ -7147,7 +7153,7 @@ void init_Qd(void)
81 /* Backward-compatible name */
82 Py_INCREF(&BitMap_Type);
83 PyModule_AddObject(m, "BitMapType", (PyObject *)&BitMap_Type);
84 -#endif /* __LP64__ */
85 +#endif /* HAVE_CARBON */
88 /* ========================= End module _Qd ========================= */