Fixup fromcvs/togit conversion
[minix-pkgsrc.git] / lang / python26 / patches / patch-Mac_Modules_fm___Fmmodule.c
blob7d2d0aed7c29eb8a5b30a96db947571e15764a29
1 $NetBSD$
3 Fix build errors on Mac OS XLion.
5 --- Mac/Modules/fm/_Fmmodule.c.orig 2010-05-09 15:15:40.000000000 +0000
6 +++ Mac/Modules/fm/_Fmmodule.c
7 @@ -3,8 +3,14 @@
9 #include "Python.h"
11 -#ifndef __LP64__
12 +#include <AvailabilityMacros.h>
13 +#if (__MAC_OS_X_VERSION_MAX_ALLOWED >= 1070) || defined(__LP64__)
14 +#undef HAVE_CARBON
15 +#else
16 +#define HAVE_CARBON
17 +#endif
19 +#ifdef HAVE_CARBON
21 #include "pymactoolbox.h"
23 @@ -336,32 +342,32 @@ static PyMethodDef Fm_methods[] = {
24 {NULL, NULL, 0}
27 -#else /* __LP64__ */
28 +#else /* HAVE_CARBON */
30 static PyMethodDef Fm_methods[] = {
31 {NULL, NULL, 0}
34 -#endif /* __LP64__ */
35 +#endif /* HAVE_CARBON */
37 void init_Fm(void)
39 PyObject *m;
40 -#ifndef __LP64__
41 +#ifdef HAVE_CARBON
42 PyObject *d;
43 -#endif /* __LP64__ */
44 +#endif /* HAVE_CARBON */
49 m = Py_InitModule("_Fm", Fm_methods);
50 -#ifndef __LP64__
51 +#ifdef HAVE_CARBON
52 d = PyModule_GetDict(m);
53 Fm_Error = PyMac_GetOSErrException();
54 if (Fm_Error == NULL ||
55 PyDict_SetItemString(d, "Error", Fm_Error) != 0)
56 return;
57 -#endif /* __LP64__ */
58 +#endif /* HAVE_CARBON */
61 /* ========================= End module _Fm ========================= */