PyDoc_STR("(FSSpec * iFileSpec, WindowPtr iWindow, Rect iFrame, TXNFrameOptions iFrameOptions, TXNFrameType iFrameType, TXNFileType iFileType, TXNPermanentTextEncodingType iPermanentEncoding) -> (TXNObject oTXNObject, TXNFrameID oTXNFrameID)")},
Fix 32-bit builds on macOS Sierra 10.12 broken by removal of deprecated
QuickTime/QuickTime.h header file
[Python Issue #27806] -- http://bugs.python.org/issue27806
Originally fixed in 2.7 by "sashk" <b@compuix.com>:
- https://hg.python.org/cpython/rev/4030300fcb18
Signed-off-by: Lawrence Velázquez <larryv@macports.org>
Index: Include/pymactoolbox.h
===================================================================
--- Include/pymactoolbox.h.orig
+++ Include/pymactoolbox.h
#include <Carbon/Carbon.h>
+** Issue #27806: Workaround for gcc 4.x which does not have _has_include.
+#define __has_include(x) 0
+#if __has_include(<Availability.h>)
+#include <Availability.h>
+#define APPLE_SUPPORTS_QUICKTIME (__MAC_OS_X_VERSION_MAX_ALLOWED < 101200) && !__LP64__
+#define APPLE_SUPPORTS_QUICKTIME !__LP64__
+#if APPLE_SUPPORTS_QUICKTIME
#include <QuickTime/QuickTime.h>
+#endif /* APPLE_SUPPORTS_QUICKTIME */
** Helper routines for error codes and such.
@@ -21,10 +36,10 @@ extern PyObject *PyMac_OSErrException;
PyObject *PyMac_GetOSErrException(void); /* Initialize & return it */
PyObject *PyErr_Mac(PyObject *, int); /* Exception with a mac error */
PyObject *PyMac_Error(OSErr); /* Uses PyMac_GetOSErrException */
+#if APPLE_SUPPORTS_QUICKTIME
extern OSErr PyMac_GetFullPathname(FSSpec *, char *, int); /* convert
+#endif /* APPLE_SUPPORTS_QUICKTIME */
** These conversion routines are defined in mactoolboxglue.c itself.
@@ -109,54 +124,54 @@ extern PyObject *CmpInstObj_New(Componen
extern int CmpInstObj_Convert(PyObject *, ComponentInstance *);
+#if APPLE_SUPPORTS_QUICKTIME
extern PyObject *CtlObj_New(ControlHandle);
extern int CtlObj_Convert(PyObject *, ControlHandle *);