<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[152947] trunk/dports/lang/python27</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="https://trac.macports.org/changeset/152947">152947</a></dd>
<dt>Author</dt> <dd>larryv@macports.org</dd>
<dt>Date</dt> <dd>2016-09-20 22:00:31 -0700 (Tue, 20 Sep 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>python27: Improve check for QuickTime/QuickTime.h

This fixes 32-bit builds on Sierra, which removed that header.

Closes: https://trac.macports.org/ticket/52043</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkdportslangpython27Portfile">trunk/dports/lang/python27/Portfile</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkdportslangpython27filesimproveQuickTimehcheckpatch">trunk/dports/lang/python27/files/improve-QuickTime.h-check.patch</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkdportslangpython27Portfile"></a>
<div class="modfile"><h4>Modified: trunk/dports/lang/python27/Portfile (152946 => 152947)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/lang/python27/Portfile        2016-09-21 05:00:25 UTC (rev 152946)
+++ trunk/dports/lang/python27/Portfile        2016-09-21 05:00:31 UTC (rev 152947)
</span><span class="lines">@@ -39,7 +39,8 @@
</span><span class="cx">                     patch-configure.diff \
</span><span class="cx">                     patch-libedit.diff \
</span><span class="cx">                     patch-Include-pyport.h.diff \
</span><del>-                    omit-local-site-packages.patch
</del><ins>+                    omit-local-site-packages.patch \
+                    improve-QuickTime.h-check.patch
</ins><span class="cx"> 
</span><span class="cx"> depends_lib         port:gettext \
</span><span class="cx">                     port:zlib \
</span></span></pre></div>
<a id="trunkdportslangpython27filesimproveQuickTimehcheckpatch"></a>
<div class="addfile"><h4>Added: trunk/dports/lang/python27/files/improve-QuickTime.h-check.patch (0 => 152947)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/lang/python27/files/improve-QuickTime.h-check.patch                                (rev 0)
+++ trunk/dports/lang/python27/files/improve-QuickTime.h-check.patch        2016-09-21 05:00:31 UTC (rev 152947)
</span><span class="lines">@@ -0,0 +1,1179 @@
</span><ins>+https://hg.python.org/cpython/rev/4030300fcb18
+
+# HG changeset patch
+# User sashk &lt;b@compuix.com&gt;
+# Date 1474031325 14400
+# Node ID 4030300fcb1885f3f827bd55f22e05720cfa6edb
+# Parent  c38e10ad7c898aac1bc276b04abcecb03c97d71a
+Issue #27806: Fix 32-bit builds on macOS Sierra 10.12 broken by removal of
+deprecated QuickTime/QuickTime.h header file.  Patch by sashk.
+
+Index: Include/pymactoolbox.h
+===================================================================
+--- Include/pymactoolbox.h.orig
++++ Include/pymactoolbox.h
+@@ -9,9 +9,24 @@

+ #include &lt;Carbon/Carbon.h&gt;

+-#ifndef __LP64__
++/*
++** Issue #27806: Workaround for gcc 4.x which does not have _has_include.
++*/
++#ifndef __has_include
++#define __has_include(x) 0
++#endif
++/* Workaround */
++
++#if __has_include(&lt;Availability.h&gt;)
++#include &lt;Availability.h&gt;
++#define APPLE_SUPPORTS_QUICKTIME (__MAC_OS_X_VERSION_MAX_ALLOWED &lt; 101200) &amp;&amp; !__LP64__
++#else
++#define APPLE_SUPPORTS_QUICKTIME !__LP64__
++#endif
++
++#if APPLE_SUPPORTS_QUICKTIME
+ #include &lt;QuickTime/QuickTime.h&gt;
+-#endif /* !__LP64__ */
++#endif /* APPLE_SUPPORTS_QUICKTIME */

+ /*
+ ** Helper routines for error codes and such.
+@@ -21,10 +36,10 @@ extern PyObject *PyMac_OSErrException;                
+ PyObject *PyMac_GetOSErrException(void);        /* Initialize &amp; return it */
+ PyObject *PyErr_Mac(PyObject *, int);                /* Exception with a mac error */
+ PyObject *PyMac_Error(OSErr);                        /* Uses PyMac_GetOSErrException */
+-#ifndef __LP64__ 
++#if APPLE_SUPPORTS_QUICKTIME
+ extern OSErr PyMac_GetFullPathname(FSSpec *, char *, int); /* convert
+                                                               fsspec-&gt;path */
+-#endif /* __LP64__ */
++#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 *);

+ /* Ctl exports */
+-#ifndef __LP64__
++#if APPLE_SUPPORTS_QUICKTIME
+ extern PyObject *CtlObj_New(ControlHandle);
+ extern int CtlObj_Convert(PyObject *, ControlHandle *);
+-#endif /* !__LP64__ */
++#endif /* APPLE_SUPPORTS_QUICKTIME */

+ /* Dlg exports */
+-#ifndef __LP64__
++#if APPLE_SUPPORTS_QUICKTIME
+ extern PyObject *DlgObj_New(DialogPtr);
+ extern int DlgObj_Convert(PyObject *, DialogPtr *);
+ extern PyObject *DlgObj_WhichDialog(DialogPtr);
+-#endif /* !__LP64__ */
++#endif /* APPLE_SUPPORTS_QUICKTIME */

+ /* Drag exports */
+-#ifndef __LP64__
++#if APPLE_SUPPORTS_QUICKTIME
+ extern PyObject *DragObj_New(DragReference);
+ extern int DragObj_Convert(PyObject *, DragReference *);
+-#endif /* !__LP64__ */
++#endif /* APPLE_SUPPORTS_QUICKTIME */

+ /* List exports */
+-#ifndef __LP64__
++#if APPLE_SUPPORTS_QUICKTIME
+ extern PyObject *ListObj_New(ListHandle);
+ extern int ListObj_Convert(PyObject *, ListHandle *);
+-#endif /* !__LP64__ */
++#endif /* APPLE_SUPPORTS_QUICKTIME */

+ /* Menu exports */
+-#ifndef __LP64__
++#if APPLE_SUPPORTS_QUICKTIME
+ extern PyObject *MenuObj_New(MenuHandle);
+ extern int MenuObj_Convert(PyObject *, MenuHandle *);
+-#endif /* !__LP64__ */
++#endif /* APPLE_SUPPORTS_QUICKTIME */

+ /* Qd exports */
+-#ifndef __LP64__
++#if APPLE_SUPPORTS_QUICKTIME
+ extern PyObject *GrafObj_New(GrafPtr);
+ extern int GrafObj_Convert(PyObject *, GrafPtr *);
+ extern PyObject *BMObj_New(BitMapPtr);
+ extern int BMObj_Convert(PyObject *, BitMapPtr *);
+ extern PyObject *QdRGB_New(RGBColor *);
+ extern int QdRGB_Convert(PyObject *, RGBColor *);
+-#endif /* !__LP64__ */
++#endif /* APPLE_SUPPORTS_QUICKTIME */

+ /* Qdoffs exports */
+-#ifndef __LP64__
++#if APPLE_SUPPORTS_QUICKTIME
+ extern PyObject *GWorldObj_New(GWorldPtr);
+ extern int GWorldObj_Convert(PyObject *, GWorldPtr *);
+-#endif /* !__LP64__ */
++#endif /* APPLE_SUPPORTS_QUICKTIME */

+ /* Qt exports */
+-#ifndef __LP64__
++#if APPLE_SUPPORTS_QUICKTIME
+ extern PyObject *TrackObj_New(Track);
+ extern int TrackObj_Convert(PyObject *, Track *);
+ extern PyObject *MovieObj_New(Movie);
+@@ -169,7 +184,7 @@ extern PyObject *UserDataObj_New(UserDat
+ extern int UserDataObj_Convert(PyObject *, UserData *);
+ extern PyObject *MediaObj_New(Media);
+ extern int MediaObj_Convert(PyObject *, Media *);
+-#endif /* !__LP64__ */
++#endif /* APPLE_SUPPORTS_QUICKTIME */

+ /* Res exports */
+ extern PyObject *ResObj_New(Handle);
+@@ -178,17 +193,17 @@ extern PyObject *OptResObj_New(Handle);
+ extern int OptResObj_Convert(PyObject *, Handle *);

+ /* TE exports */
+-#ifndef __LP64__
++#if APPLE_SUPPORTS_QUICKTIME
+ extern PyObject *TEObj_New(TEHandle);
+ extern int TEObj_Convert(PyObject *, TEHandle *);
+-#endif /* !__LP64__ */
++#endif /* APPLE_SUPPORTS_QUICKTIME */

+ /* Win exports */
+-#ifndef __LP64__
++#if APPLE_SUPPORTS_QUICKTIME
+ extern PyObject *WinObj_New(WindowPtr);
+ extern int WinObj_Convert(PyObject *, WindowPtr *);
+ extern PyObject *WinObj_WhichWindow(WindowPtr);
+-#endif /* !__LP64__ */
++#endif /* APPLE_SUPPORTS_QUICKTIME */

+ /* CF exports */
+ extern PyObject *CFObj_New(CFTypeRef);
+Index: Mac/Modules/ColorPickermodule.c
+===================================================================
+--- Mac/Modules/ColorPickermodule.c.orig
++++ Mac/Modules/ColorPickermodule.c
+@@ -28,7 +28,7 @@ PERFORMANCE OF THIS SOFTWARE.
+ /* ----------------------------------------------------- */


+-#ifndef __LP64__
++#if APPLE_SUPPORTS_QUICKTIME

+ static char cp_GetColor__doc__[] =
+ &quot;GetColor(prompt, (r, g, b)) -&gt; (r, g, b), ok&quot;
+@@ -49,14 +49,14 @@ cp_GetColor(PyObject *self, PyObject *ar

+     return Py_BuildValue(&quot;O&amp;h&quot;, QdRGB_New, &amp;outColor, ok);
+ }
+-#endif /* __LP64__ */
++#endif /* APPLE_SUPPORTS_QUICKTIME */

+ /* List of methods defined in the module */

+ static struct PyMethodDef cp_methods[] = {
+-#ifndef __LP64__
++#if APPLE_SUPPORTS_QUICKTIME
+     {&quot;GetColor&quot;,        (PyCFunction)cp_GetColor,       METH_VARARGS,   cp_GetColor__doc__},
+-#endif /* __LP64__ */
++#endif /* APPLE_SUPPORTS_QUICKTIME */
+     {NULL,                      (PyCFunction)NULL,                      0,                              NULL}           /* sentinel */
+ };

+@@ -87,4 +87,3 @@ void initColorPicker(void)
+     if (PyErr_Occurred())
+         Py_FatalError(&quot;can't initialize module ColorPicker&quot;);
+ }
+-
+Index: Mac/Modules/MacOS.c
+===================================================================
+--- Mac/Modules/MacOS.c.orig
++++ Mac/Modules/MacOS.c
+@@ -299,7 +299,7 @@ MacOS_GetCreatorAndType(PyObject *self, 
+     FileInfo* finfo;

+     if (!PyArg_ParseTuple(args, &quot;O&amp;&quot;, PyMac_GetFSRef, &amp;ref)) {
+-#ifndef __LP64__
++#if APPLE_SUPPORTS_QUICKTIME
+         /* This function is documented to take an FSSpec as well,
+          * which only works in 32-bit mode.
+          */
+@@ -324,9 +324,9 @@ MacOS_GetCreatorAndType(PyObject *self, 
+         Py_DECREF(creator);
+         Py_DECREF(type);
+         return res;
+-#else   /* __LP64__ */
++#else   /* APPLE_SUPPORTS_QUICKTIME */
+         return NULL;
+-#endif  /* __LP64__ */
++#endif  /* APPLE_SUPPORTS_QUICKTIME */
+     }

+     err = FSGetCatalogInfo(&amp;ref,
+@@ -372,7 +372,7 @@ MacOS_SetCreatorAndType(PyObject *self, 

+     if (!PyArg_ParseTuple(args, &quot;O&amp;O&amp;O&amp;&quot;,
+                     PyMac_GetFSRef, &amp;ref, PyMac_GetOSType, &amp;creator, PyMac_GetOSType, &amp;type)) {
+-#ifndef __LP64__
++#if APPLE_SUPPORTS_QUICKTIME
+         /* Try to handle FSSpec arguments, for backward compatibility */
+         FSSpec fss;
+         FInfo info;
+@@ -391,9 +391,9 @@ MacOS_SetCreatorAndType(PyObject *self, 
+             return PyErr_Mac(MacOS_Error, err);
+         Py_INCREF(Py_None);
+         return Py_None;
+-#else /* __LP64__ */
++#else /* APPLE_SUPPORTS_QUICKTIME */
+         return NULL;
+-#endif /* __LP64__ */
++#endif /* APPLE_SUPPORTS_QUICKTIME */
+     }

+     err = FSGetCatalogInfo(&amp;ref,
+Index: Mac/Modules/OSATerminology.c
+===================================================================
+--- Mac/Modules/OSATerminology.c.orig
++++ Mac/Modules/OSATerminology.c
+@@ -14,7 +14,7 @@

+ #include &lt;Carbon/Carbon.h&gt;

+-#ifndef __LP64__
++#if APPLE_SUPPORTS_QUICKTIME
+ static PyObject *
+ PyOSA_GetAppTerminology(PyObject* self, PyObject* args)
+ {
+@@ -73,14 +73,14 @@ PyOSA_GetSysTerminology(PyObject* self, 
+     if (err) return PyMac_Error(err);
+     return Py_BuildValue(&quot;O&amp;&quot;, AEDesc_New, &amp;theDesc);
+ }
+-#endif /* !__LP64__ */
++#endif /* APPLE_SUPPORTS_QUICKTIME */

+ /*
+  * List of methods defined in the module
+  */
+ static struct PyMethodDef OSATerminology_methods[] =
+ {
+-#ifndef __LP64__
++#if APPLE_SUPPORTS_QUICKTIME
+     {&quot;GetAppTerminology&quot;,
+         (PyCFunction) PyOSA_GetAppTerminology,
+         METH_VARARGS,
+@@ -89,7 +89,7 @@ static struct PyMethodDef OSATerminology
+         (PyCFunction) PyOSA_GetSysTerminology,
+         METH_VARARGS,
+         &quot;Get the AppleScript language's terminology. GetSysTerminology() --&gt; AEDesc&quot;},
+-#endif /* !__LP64__ */
++#endif /* APPLE_SUPPORTS_QUICKTIME */
+     {NULL, (PyCFunction) NULL, 0, NULL}
+ };

+Index: Mac/Modules/app/_Appmodule.c
+===================================================================
+--- Mac/Modules/app/_Appmodule.c.orig
++++ Mac/Modules/app/_Appmodule.c
+@@ -2,13 +2,11 @@
+ /* ========================== Module _App =========================== */

+ #include &quot;Python.h&quot;
++#include &quot;pymactoolbox.h&quot;

+-#ifndef __LP64__
++#if APPLE_SUPPORTS_QUICKTIME
+     /* Carbon GUI stuff, not available in 64-bit mode */

+-
+-#include &quot;pymactoolbox.h&quot;
+-
+ /* Macro to test whether a weak-loaded CFM function exists */
+ #define PyMac_PRECHECK(rtn) do { if ( &amp;rtn == NULL )  {\
+     PyErr_SetString(PyExc_NotImplementedError, \
+@@ -1806,13 +1804,13 @@ static PyMethodDef App_methods[] = {
+ void init_App(void)
+ {
+     PyObject *m;
+-#ifndef __LP64__
++#if APPLE_SUPPORTS_QUICKTIME
+     PyObject *d;
+-#endif /* !__LP64__ */
++#endif /* APPLE_SUPPORTS_QUICKTIME */


+     m = Py_InitModule(&quot;_App&quot;, App_methods);
+-#ifndef __LP64__
++#if APPLE_SUPPORTS_QUICKTIME
+     d = PyModule_GetDict(m);
+     App_Error = PyMac_GetOSErrException();
+     if (App_Error == NULL ||
+@@ -1825,7 +1823,7 @@ void init_App(void)
+     /* Backward-compatible name */
+     Py_INCREF(&amp;ThemeDrawingState_Type);
+     PyModule_AddObject(m, &quot;ThemeDrawingStateType&quot;, (PyObject *)&amp;ThemeDrawingState_Type);
+-#endif /* __LP64__ */
++#endif /* APPLE_SUPPORTS_QUICKTIME */
+ }

+ /* ======================== End module _App ========================= */
+Index: Mac/Modules/carbonevt/_CarbonEvtmodule.c
+===================================================================
+--- Mac/Modules/carbonevt/_CarbonEvtmodule.c.orig
++++ Mac/Modules/carbonevt/_CarbonEvtmodule.c
+@@ -2,10 +2,10 @@
+ /* ======================= Module _CarbonEvt ======================== */

+ #include &quot;Python.h&quot;
++#include &quot;pymactoolbox.h&quot;

+-#ifndef __LP64__
++#if APPLE_SUPPORTS_QUICKTIME

+-#include &quot;pymactoolbox.h&quot;

+ /* Macro to test whether a weak-loaded CFM function exists */
+ #define PyMac_PRECHECK(rtn) do { if ( &amp;rtn == NULL )  {\
+@@ -2128,27 +2128,27 @@ static PyMethodDef CarbonEvents_methods[
+     {NULL, NULL, 0}
+ };

+-#else /* __LP64__ */
++#else /* APPLE_SUPPORTS_QUICKTIME */

+ static PyMethodDef CarbonEvents_methods[] = {
+     {NULL, NULL, 0}
+ };

+-#endif /* __LP64__ */
++#endif /* APPLE_SUPPORTS_QUICKTIME */



+ void init_CarbonEvt(void)
+ {
+     PyObject *m;
+-#ifndef __LP64__
++#if APPLE_SUPPORTS_QUICKTIME
+     PyObject *d;
+-#endif /* !__LP64__ */
++#endif /* !APPLE_SUPPORTS_QUICKTIME */


+     m = Py_InitModule(&quot;_CarbonEvt&quot;, CarbonEvents_methods);

+-#ifndef __LP64__
++#if APPLE_SUPPORTS_QUICKTIME
+     myEventHandlerUPP = NewEventHandlerUPP(myEventHandler);
+     d = PyModule_GetDict(m);
+     CarbonEvents_Error = PyMac_GetOSErrException();
+@@ -2211,7 +2211,7 @@ void init_CarbonEvt(void)
+     /* Backward-compatible name */
+     Py_INCREF(&amp;EventHotKeyRef_Type);
+     PyModule_AddObject(m, &quot;EventHotKeyRefType&quot;, (PyObject *)&amp;EventHotKeyRef_Type);
+-#endif /* !__LP64__ */
++#endif /* APPLE_SUPPORTS_QUICKTIME */
+ }

+ /* ===================== End module _CarbonEvt ====================== */
+Index: Mac/Modules/ctl/_Ctlmodule.c
+===================================================================
+--- Mac/Modules/ctl/_Ctlmodule.c.orig
++++ Mac/Modules/ctl/_Ctlmodule.c
+@@ -2,11 +2,11 @@
+ /* ========================== Module _Ctl =========================== */

+ #include &quot;Python.h&quot;
++#include &quot;pymactoolbox.h&quot;

+-#ifndef __LP64__
++#if APPLE_SUPPORTS_QUICKTIME


+-#include &quot;pymactoolbox.h&quot;

+ /* Macro to test whether a weak-loaded CFM function exists */
+ #define PyMac_PRECHECK(rtn) do { if ( &amp;rtn == NULL )  {\
+@@ -5766,19 +5766,19 @@ mytrackingproc(ControlHandle control, Po
+     return (ControlPartCode)c_rv;
+ }

+-#else /* __LP64__ */
++#else /* APPLE_SUPPORTS_QUICKTIME */

+ static PyMethodDef Ctl_methods[] = {
+     {NULL, NULL, 0}
+ };

+-#endif /* __LP64__ */
++#endif /* APPLE_SUPPORTS_QUICKTIME */

+ void init_Ctl(void)
+ {
+     PyObject *m;

+-#ifndef __LP64__
++#if APPLE_SUPPORTS_QUICKTIME
+     PyObject *d;

+     mytracker_upp = NewControlActionUPP(mytracker);
+@@ -5791,11 +5791,11 @@ void init_Ctl(void)
+     mytrackingproc_upp = NewControlUserPaneTrackingUPP(mytrackingproc);
+     PyMac_INIT_TOOLBOX_OBJECT_NEW(ControlHandle, CtlObj_New);
+     PyMac_INIT_TOOLBOX_OBJECT_CONVERT(ControlHandle, CtlObj_Convert);
+-#endif /* !__LP64__ */
++#endif /* APPLE_SUPPORTS_QUICKTIME */

+     m = Py_InitModule(&quot;_Ctl&quot;, Ctl_methods);

+-#ifndef __LP64__
++#if APPLE_SUPPORTS_QUICKTIME
+     d = PyModule_GetDict(m);
+     Ctl_Error = PyMac_GetOSErrException();
+     if (Ctl_Error == NULL ||
+@@ -5808,8 +5808,7 @@ void init_Ctl(void)
+     /* Backward-compatible name */
+     Py_INCREF(&amp;Control_Type);
+     PyModule_AddObject(m, &quot;ControlType&quot;, (PyObject *)&amp;Control_Type);
+-#endif /* !__LP64__ */
++#endif /* APPLE_SUPPORTS_QUICKTIME */
+ }

+ /* ======================== End module _Ctl ========================= */
+-
+Index: Mac/Modules/dlg/_Dlgmodule.c
+===================================================================
+--- Mac/Modules/dlg/_Dlgmodule.c.orig
++++ Mac/Modules/dlg/_Dlgmodule.c
+@@ -2,12 +2,10 @@
+ /* ========================== Module _Dlg =========================== */

+ #include &quot;Python.h&quot;
+-
+-#ifndef __LP64__
+-
+-
+ #include &quot;pymactoolbox.h&quot;

++#if APPLE_SUPPORTS_QUICKTIME
++
+ /* Macro to test whether a weak-loaded CFM function exists */
+ #define PyMac_PRECHECK(rtn) do { if ( &amp;rtn == NULL )  {\
+     PyErr_SetString(PyExc_NotImplementedError, \
+@@ -1577,7 +1575,7 @@ static PyMethodDef Dlg_methods[] = {
+ void init_Dlg(void)
+ {
+     PyObject *m;
+-#ifndef __LP64__
++#if APPLE_SUPPORTS_QUICKTIME
+     PyObject *d;


+@@ -1585,11 +1583,11 @@ void init_Dlg(void)
+         PyMac_INIT_TOOLBOX_OBJECT_NEW(DialogPtr, DlgObj_New);
+         PyMac_INIT_TOOLBOX_OBJECT_NEW(DialogPtr, DlgObj_WhichDialog);
+         PyMac_INIT_TOOLBOX_OBJECT_CONVERT(DialogPtr, DlgObj_Convert);
+-#endif /* !__LP64__ */
++#endif /* APPLE_SUPPORTS_QUICKTIME */

+     m = Py_InitModule(&quot;_Dlg&quot;, Dlg_methods);

+-#ifndef __LP64__
++#if APPLE_SUPPORTS_QUICKTIME
+     d = PyModule_GetDict(m);
+     Dlg_Error = PyMac_GetOSErrException();
+     if (Dlg_Error == NULL ||
+@@ -1602,7 +1600,7 @@ void init_Dlg(void)
+     /* Backward-compatible name */
+     Py_INCREF(&amp;Dialog_Type);
+     PyModule_AddObject(m, &quot;DialogType&quot;, (PyObject *)&amp;Dialog_Type);
+-#endif /* !__LP64__ */
++#endif /* APPLE_SUPPORTS_QUICKTIME */
+ }

+ /* ======================== End module _Dlg ========================= */
+Index: Mac/Modules/drag/_Dragmodule.c
+===================================================================
+--- Mac/Modules/drag/_Dragmodule.c.orig
++++ Mac/Modules/drag/_Dragmodule.c
+@@ -2,12 +2,10 @@
+ /* ========================== Module _Drag ========================== */

+ #include &quot;Python.h&quot;
+-
+-#ifndef __LP64__
+-
+-
+ #include &quot;pymactoolbox.h&quot;

++#if APPLE_SUPPORTS_QUICKTIME
++
+ /* Macro to test whether a weak-loaded CFM function exists */
+ #define PyMac_PRECHECK(rtn) do { if ( &amp;rtn == NULL )  {\
+     PyErr_SetString(PyExc_NotImplementedError, \
+@@ -1117,18 +1115,18 @@ static PyMethodDef Drag_methods[] = {
+ void init_Drag(void)
+ {
+     PyObject *m;
+-#ifndef __LP64__
++#if APPLE_SUPPORTS_QUICKTIME
+     PyObject *d;



+         PyMac_INIT_TOOLBOX_OBJECT_NEW(DragRef, DragObj_New);
+         PyMac_INIT_TOOLBOX_OBJECT_CONVERT(DragRef, DragObj_Convert);
+-#endif /* !__LP64__ */
++#endif /* APPLE_SUPPORTS_QUICKTIME */


+     m = Py_InitModule(&quot;_Drag&quot;, Drag_methods);
+-#ifndef __LP64__
++#if APPLE_SUPPORTS_QUICKTIME
+     d = PyModule_GetDict(m);
+     Drag_Error = PyMac_GetOSErrException();
+     if (Drag_Error == NULL ||
+@@ -1150,7 +1148,7 @@ void init_Drag(void)
+     dragglue_DrawingUPP = NewDragDrawingUPP(dragglue_Drawing);
+ #endif

+-#endif /* !__LP64__ */
++#endif /* APPLE_SUPPORTS_QUICKTIME */

+ }

+Index: Mac/Modules/help/_Helpmodule.c
+===================================================================
+--- Mac/Modules/help/_Helpmodule.c.orig
++++ Mac/Modules/help/_Helpmodule.c
+@@ -2,12 +2,10 @@
+ /* ========================== Module _Help ========================== */

+ #include &quot;Python.h&quot;
+-
+-#ifndef __LP64__
+-
+-
+ #include &quot;pymactoolbox.h&quot;

++#if APPLE_SUPPORTS_QUICKTIME
++
+ /* Macro to test whether a weak-loaded CFM function exists */
+ #define PyMac_PRECHECK(rtn) do { if ( &amp;rtn == NULL )  {\
+     PyErr_SetString(PyExc_NotImplementedError, \
+@@ -145,10 +143,10 @@ static PyObject *Help_HMHideTag(PyObject
+     return _res;
+ }

+-#endif /* __LP64__ */
++#endif /* APPLE_SUPPORTS_QUICKTIME */

+ static PyMethodDef Help_methods[] = {
+-#ifndef __LP64__
++#if APPLE_SUPPORTS_QUICKTIME
+     {&quot;HMGetHelpMenu&quot;, (PyCFunction)Help_HMGetHelpMenu, 1,
+      PyDoc_STR(&quot;() -&gt; (MenuRef outHelpMenu, MenuItemIndex outFirstCustomItemIndex)&quot;)},
+     {&quot;HMAreHelpTagsDisplayed&quot;, (PyCFunction)Help_HMAreHelpTagsDisplayed, 1,
+@@ -165,31 +163,30 @@ static PyMethodDef Help_methods[] = {
+      PyDoc_STR(&quot;(DialogPtr inDialog, SInt16 inHdlgRsrcID, SInt16 inItemStart) -&gt; None&quot;)},
+     {&quot;HMHideTag&quot;, (PyCFunction)Help_HMHideTag, 1,
+      PyDoc_STR(&quot;() -&gt; None&quot;)},
+-#endif /* __LP64__ */
++#endif /* APPLE_SUPPORTS_QUICKTIME */
+     {NULL, NULL, 0}
+ };



+-
+ void init_Help(void)
+ {
+     PyObject *m;
+-#ifndef __LP64__
++#if APPLE_SUPPORTS_QUICKTIME
+     PyObject *d;
+-#endif /* __LP64__ */
++#endif /* APPLE_SUPPORTS_QUICKTIME */




+     m = Py_InitModule(&quot;_Help&quot;, Help_methods);
+-#ifndef __LP64__
++#if APPLE_SUPPORTS_QUICKTIME
+     d = PyModule_GetDict(m);
+     Help_Error = PyMac_GetOSErrException();
+     if (Help_Error == NULL ||
+         PyDict_SetItemString(d, &quot;Error&quot;, Help_Error) != 0)
+         return;
+-#endif /* __LP64__ */
++#endif /* APPLE_SUPPORTS_QUICKTIME */
+ }

+ /* ======================== End module _Help ======================== */
+Index: Mac/Modules/ibcarbon/_IBCarbon.c
+===================================================================
+--- Mac/Modules/ibcarbon/_IBCarbon.c.orig
++++ Mac/Modules/ibcarbon/_IBCarbon.c
+@@ -2,12 +2,12 @@
+ /* ======================== Module _IBCarbon ======================== */

+ #include &quot;Python.h&quot;
++#include &quot;pymactoolbox.h&quot;


+-#ifndef __LP64__
++#if APPLE_SUPPORTS_QUICKTIME

+ #include &lt;Carbon/Carbon.h&gt;
+-#include &quot;pymactoolbox.h&quot;

+ #ifdef USE_TOOLBOX_OBJECT_GLUE
+ extern int _CFStringRefObj_Convert(PyObject *, CFStringRef *);
+@@ -225,13 +225,13 @@ static PyObject *IBCarbon_CreateNibRefer
+                          IBNibRefObj_New, outNibRef);
+     return _res;
+ }
+-#endif /* __LP64__ */
++#endif /* APPLE_SUPPORTS_QUICKTIME */

+ static PyMethodDef IBCarbon_methods[] = {
+-#ifndef __LP64__
++#if APPLE_SUPPORTS_QUICKTIME
+     {&quot;CreateNibReference&quot;, (PyCFunction)IBCarbon_CreateNibReference, 1,
+      PyDoc_STR(&quot;(CFStringRef inNibName) -&gt; (IBNibRef outNibRef)&quot;)},
+-#endif /* __LP64__ */
++#endif /* APPLE_SUPPORTS_QUICKTIME */
+     {NULL, NULL, 0}
+ };

+@@ -241,16 +241,16 @@ static PyMethodDef IBCarbon_methods[] = 
+ void init_IBCarbon(void)
+ {
+     PyObject *m;
+-#ifndef __LP64__
++#if APPLE_SUPPORTS_QUICKTIME
+     PyObject *d;
+-#endif /* __LP64__ */
++#endif /* APPLE_SUPPORTS_QUICKTIME */





+     m = Py_InitModule(&quot;_IBCarbon&quot;, IBCarbon_methods);
+-#ifndef __LP64__
++#if APPLE_SUPPORTS_QUICKTIME
+     d = PyModule_GetDict(m);
+     IBCarbon_Error = PyMac_GetOSErrException();
+     if (IBCarbon_Error == NULL ||
+@@ -263,7 +263,7 @@ void init_IBCarbon(void)
+     /* Backward-compatible name */
+     Py_INCREF(&amp;IBNibRef_Type);
+     PyModule_AddObject(m, &quot;IBNibRefType&quot;, (PyObject *)&amp;IBNibRef_Type);
+-#endif /* __LP64__ */
++#endif /* APPLE_SUPPORTS_QUICKTIME */
+ }

+ /* ====================== End module _IBCarbon ====================== */
+Index: Mac/Modules/icn/_Icnmodule.c
+===================================================================
+--- Mac/Modules/icn/_Icnmodule.c.orig
++++ Mac/Modules/icn/_Icnmodule.c
+@@ -2,11 +2,11 @@
+ /* ========================== Module _Icn =========================== */

+ #include &quot;Python.h&quot;
++#include &quot;pymactoolbox.h&quot;


+-#ifndef __LP64__
++#if APPLE_SUPPORTS_QUICKTIME

+-#include &quot;pymactoolbox.h&quot;

+ /* Macro to test whether a weak-loaded CFM function exists */
+ #define PyMac_PRECHECK(rtn) do { if ( &amp;rtn == NULL )  {\
+@@ -1448,10 +1448,10 @@ static PyObject *Icn_WriteIconFile(PyObj
+     _res = Py_None;
+     return _res;
+ }
+-#endif /* __LP64__ */
++#endif /* APPLE_SUPPORTS_QUICKTIME */

+ static PyMethodDef Icn_methods[] = {
+-#ifndef __LP64__
++#if APPLE_SUPPORTS_QUICKTIME
+     {&quot;GetCIcon&quot;, (PyCFunction)Icn_GetCIcon, 1,
+      PyDoc_STR(&quot;(SInt16 iconID) -&gt; (CIconHandle _rv)&quot;)},
+     {&quot;PlotCIcon&quot;, (PyCFunction)Icn_PlotCIcon, 1,
+@@ -1576,7 +1576,7 @@ static PyMethodDef Icn_methods[] = {
+      PyDoc_STR(&quot;(FSRef ref) -&gt; (IconFamilyHandle iconFamily)&quot;)},
+     {&quot;WriteIconFile&quot;, (PyCFunction)Icn_WriteIconFile, 1,
+      PyDoc_STR(&quot;(IconFamilyHandle iconFamily, FSSpec iconFile) -&gt; None&quot;)},
+-#endif /* __LP64__ */
++#endif /* APPLE_SUPPORTS_QUICKTIME */
+     {NULL, NULL, 0}
+ };

+@@ -1586,21 +1586,21 @@ static PyMethodDef Icn_methods[] = {
+ void init_Icn(void)
+ {
+     PyObject *m;
+-#ifndef __LP64__
++#if APPLE_SUPPORTS_QUICKTIME
+     PyObject *d;
+-#endif /* __LP64__ */
++#endif /* APPLE_SUPPORTS_QUICKTIME */




+     m = Py_InitModule(&quot;_Icn&quot;, Icn_methods);
+-#ifndef __LP64__
++#if APPLE_SUPPORTS_QUICKTIME
+     d = PyModule_GetDict(m);
+     Icn_Error = PyMac_GetOSErrException();
+     if (Icn_Error == NULL ||
+         PyDict_SetItemString(d, &quot;Error&quot;, Icn_Error) != 0)
+         return;
+-#endif /* __LP64__ */
++#endif /* APPLE_SUPPORTS_QUICKTIME */
+ }

+ /* ======================== End module _Icn ========================= */
+Index: Mac/Modules/list/_Listmodule.c
+===================================================================
+--- Mac/Modules/list/_Listmodule.c.orig
++++ Mac/Modules/list/_Listmodule.c
+@@ -2,11 +2,10 @@
+ /* ========================== Module _List ========================== */

+ #include &quot;Python.h&quot;
++#include &quot;pymactoolbox.h&quot;

+-#ifndef __LP64__
+-
++#if APPLE_SUPPORTS_QUICKTIME

+-#include &quot;pymactoolbox.h&quot;

+ /* Macro to test whether a weak-loaded CFM function exists */
+ #define PyMac_PRECHECK(rtn) do { if ( &amp;rtn == NULL )  {\
+@@ -1032,10 +1031,10 @@ static PyObject *List_as_List(PyObject *
+     return _res;

+ }
+-#endif /* __LP64__ */
++#endif /* APPLE_SUPPORTS_QUICKTIME */

+ static PyMethodDef List_methods[] = {
+-#ifndef __LP64__
++#if APPLE_SUPPORTS_QUICKTIME
+     {&quot;CreateCustomList&quot;, (PyCFunction)List_CreateCustomList, 1,
+      PyDoc_STR(&quot;(Rect rView, Rect dataBounds, Point cellSize, ListDefSpec theSpec, WindowPtr theWindow, Boolean drawIt, Boolean hasGrow, Boolean scrollHoriz, Boolean scrollVert) -&gt; (ListHandle outList)&quot;)},
+     {&quot;LNew&quot;, (PyCFunction)List_LNew, 1,
+@@ -1058,11 +1057,11 @@ static PyMethodDef List_methods[] = {
+      PyDoc_STR(&quot;(ListHandle list, OptionBits selectionFlags) -&gt; None&quot;)},
+     {&quot;as_List&quot;, (PyCFunction)List_as_List, 1,
+      PyDoc_STR(&quot;(Resource)-&gt;List.\nReturns List object (which is not auto-freed!)&quot;)},
+-#endif /* __LP64__ */
++#endif /* APPLE_SUPPORTS_QUICKTIME */
+     {NULL, NULL, 0}
+ };

+-#ifndef __LP64__
++#if APPLE_SUPPORTS_QUICKTIME


+ static void myListDefFunction(SInt16 message,
+@@ -1100,13 +1099,13 @@ static void myListDefFunction(SInt16 mes
+         Py_DECREF(rv);
+     }
+ }
+-#endif /* __LP64__ */
++#endif /* APPLE_SUPPORTS_QUICKTIME */


+ void init_List(void)
+ {
+     PyObject *m;
+-#ifndef __LP64__
++#if APPLE_SUPPORTS_QUICKTIME
+     PyObject *d;


+@@ -1115,11 +1114,11 @@ void init_List(void)

+     PyMac_INIT_TOOLBOX_OBJECT_NEW(ListHandle, ListObj_New);
+     PyMac_INIT_TOOLBOX_OBJECT_CONVERT(ListHandle, ListObj_Convert);
+-#endif /* __LP64__ */
++#endif /* APPLE_SUPPORTS_QUICKTIME */


+     m = Py_InitModule(&quot;_List&quot;, List_methods);
+-#ifndef __LP64__
++#if APPLE_SUPPORTS_QUICKTIME
+     d = PyModule_GetDict(m);
+     List_Error = PyMac_GetOSErrException();
+     if (List_Error == NULL ||
+@@ -1132,7 +1131,7 @@ void init_List(void)
+     /* Backward-compatible name */
+     Py_INCREF(&amp;List_Type);
+     PyModule_AddObject(m, &quot;ListType&quot;, (PyObject *)&amp;List_Type);
+-#endif /* __LP64__ */
++#endif /* APPLE_SUPPORTS_QUICKTIME */
+ }

+ /* ======================== End module _List ======================== */
+Index: Mac/Modules/mlte/_Mltemodule.c
+===================================================================
+--- Mac/Modules/mlte/_Mltemodule.c.orig
++++ Mac/Modules/mlte/_Mltemodule.c
+@@ -2,11 +2,10 @@
+ /* ========================== Module _Mlte ========================== */

+ #include &quot;Python.h&quot;
++#include &quot;pymactoolbox.h&quot;

+-#ifndef __LP64__
+-
++#if APPLE_SUPPORTS_QUICKTIME

+-#include &quot;pymactoolbox.h&quot;

+ /* Macro to test whether a weak-loaded CFM function exists */
+ #define PyMac_PRECHECK(rtn) do { if ( &amp;rtn == NULL )  {\
+@@ -1623,10 +1622,10 @@ static PyObject *Mlte_TXNInitTextension(

+ }

+-#endif /* __LP64__ */
++#endif /* APPLE_SUPPORTS_QUICKTIME */

+ static PyMethodDef Mlte_methods[] = {
+-#ifndef __LP64__
++#if APPLE_SUPPORTS_QUICKTIME
+     {&quot;TXNNewObject&quot;, (PyCFunction)Mlte_TXNNewObject, 1,
+      PyDoc_STR(&quot;(FSSpec * iFileSpec, WindowPtr iWindow, Rect iFrame, TXNFrameOptions iFrameOptions, TXNFrameType iFrameType, TXNFileType iFileType, TXNPermanentTextEncodingType iPermanentEncoding) -&gt; (TXNObject oTXNObject, TXNFrameID oTXNFrameID)&quot;)},
+     {&quot;TXNTerminateTextension&quot;, (PyCFunction)Mlte_TXNTerminateTextension, 1,
+@@ -1643,7 +1642,7 @@ static PyMethodDef Mlte_methods[] = {
+      PyDoc_STR(&quot;() -&gt; (TXNVersionValue _rv, TXNFeatureBits oFeatureFlags)&quot;)},
+     {&quot;TXNInitTextension&quot;, (PyCFunction)Mlte_TXNInitTextension, 1,
+      PyDoc_STR(&quot;(TXNInitOptions) -&gt; None&quot;)},
+-#endif /* __LP64__ */
++#endif /* APPLE_SUPPORTS_QUICKTIME */
+     {NULL, NULL, 0}
+ };

+@@ -1653,17 +1652,17 @@ static PyMethodDef Mlte_methods[] = {
+ void init_Mlte(void)
+ {
+     PyObject *m;
+-#ifndef __LP64__
++#if APPLE_SUPPORTS_QUICKTIME
+     PyObject *d;



+     //      PyMac_INIT_TOOLBOX_OBJECT_NEW(xxxx);

+-#endif /* __LP64__ */
++#endif /* APPLE_SUPPORTS_QUICKTIME */

+     m = Py_InitModule(&quot;_Mlte&quot;, Mlte_methods);
+-#ifndef __LP64__
++#if APPLE_SUPPORTS_QUICKTIME
+     d = PyModule_GetDict(m);
+     Mlte_Error = PyMac_GetOSErrException();
+     if (Mlte_Error == NULL ||
+@@ -1683,7 +1682,7 @@ void init_Mlte(void)
+     /* Backward-compatible name */
+     Py_INCREF(&amp;TXNFontMenuObject_Type);
+     PyModule_AddObject(m, &quot;TXNFontMenuObjectType&quot;, (PyObject *)&amp;TXNFontMenuObject_Type);
+-#endif /* __LP64__ */
++#endif /* APPLE_SUPPORTS_QUICKTIME */
+ }

+ /* ======================== End module _Mlte ======================== */
+Index: Mac/Modules/qt/_Qtmodule.c
+===================================================================
+--- Mac/Modules/qt/_Qtmodule.c.orig
++++ Mac/Modules/qt/_Qtmodule.c
+@@ -2,11 +2,11 @@
+ /* =========================== Module _Qt =========================== */

+ #include &quot;Python.h&quot;
++#include &quot;pymactoolbox.h&quot;


+-#ifndef __LP64__
++#if APPLE_SUPPORTS_QUICKTIME

+-#include &quot;pymactoolbox.h&quot;

+ /* Macro to test whether a weak-loaded CFM function exists */
+ #define PyMac_PRECHECK(rtn) do { if ( &amp;rtn == NULL )  {\
+@@ -26295,10 +26295,10 @@ static PyObject *Qt_MoviesTask(PyObject 
+     _res = Py_None;
+     return _res;
+ }
+-#endif /* __LP64__ */
++#endif /* APPLE_SUPPORTS_QUICKTIME */

+ static PyMethodDef Qt_methods[] = {
+-#ifndef __LP64__
++#if APPLE_SUPPORTS_QUICKTIME
+     {&quot;EnterMovies&quot;, (PyCFunction)Qt_EnterMovies, 1,
+      PyDoc_STR(&quot;() -&gt; None&quot;)},
+     {&quot;ExitMovies&quot;, (PyCFunction)Qt_ExitMovies, 1,
+@@ -27991,7 +27991,7 @@ static PyMethodDef Qt_methods[] = {
+      PyDoc_STR(&quot;(WindowPtr wp, Point startPt, Rect boundsRect) -&gt; None&quot;)},
+     {&quot;MoviesTask&quot;, (PyCFunction)Qt_MoviesTask, 1,
+      PyDoc_STR(&quot;(long maxMilliSecToUse) -&gt; None&quot;)},
+-#endif /* __LP64__ */
++#endif /* APPLE_SUPPORTS_QUICKTIME */
+     {NULL, NULL, 0}
+ };

+@@ -28001,7 +28001,7 @@ static PyMethodDef Qt_methods[] = {
+ void init_Qt(void)
+ {
+     PyObject *m;
+-#ifndef __LP64__
++#if APPLE_SUPPORTS_QUICKTIME
+     PyObject *d;


+@@ -28018,11 +28018,11 @@ void init_Qt(void)
+         PyMac_INIT_TOOLBOX_OBJECT_CONVERT(UserData, UserDataObj_Convert);
+         PyMac_INIT_TOOLBOX_OBJECT_NEW(Media, MediaObj_New);
+         PyMac_INIT_TOOLBOX_OBJECT_CONVERT(Media, MediaObj_Convert);
+-#endif /* __LP64__ */
++#endif /* APPLE_SUPPORTS_QUICKTIME */


+     m = Py_InitModule(&quot;_Qt&quot;, Qt_methods);
+-#ifndef __LP64__
++#if APPLE_SUPPORTS_QUICKTIME
+     d = PyModule_GetDict(m);
+     Qt_Error = PyMac_GetOSErrException();
+     if (Qt_Error == NULL ||
+@@ -28084,7 +28084,7 @@ void init_Qt(void)
+     /* Backward-compatible name */
+     Py_INCREF(&amp;SGOutput_Type);
+     PyModule_AddObject(m, &quot;SGOutputType&quot;, (PyObject *)&amp;SGOutput_Type);
+-#endif /* __LP64__ */
++#endif /* APPLE_SUPPORTS_QUICKTIME */
+ }

+ /* ========================= End module _Qt ========================= */
+Index: Mac/Modules/te/_TEmodule.c
+===================================================================
+--- Mac/Modules/te/_TEmodule.c.orig
++++ Mac/Modules/te/_TEmodule.c
+@@ -2,11 +2,11 @@
+ /* =========================== Module _TE =========================== */

+ #include &quot;Python.h&quot;
++#include &quot;pymactoolbox.h&quot;

+-#ifndef __LP64__
++#if APPLE_SUPPORTS_QUICKTIME


+-#include &quot;pymactoolbox.h&quot;

+ /* Macro to test whether a weak-loaded CFM function exists */
+ #define PyMac_PRECHECK(rtn) do { if ( &amp;rtn == NULL )  {\
+@@ -1268,10 +1268,10 @@ static PyObject *TE_as_TE(PyObject *_sel
+                          TEObj_New, _rv);
+     return _res;
+ }
+-#endif /* __LP64__ */
++#endif /* APPLE_SUPPORTS_QUICKTIME */

+ static PyMethodDef TE_methods[] = {
+-#ifndef __LP64__
++#if APPLE_SUPPORTS_QUICKTIME
+     {&quot;TEScrapHandle&quot;, (PyCFunction)TE_TEScrapHandle, 1,
+      PyDoc_STR(&quot;() -&gt; (Handle _rv)&quot;)},
+     {&quot;TEGetScrapLength&quot;, (PyCFunction)TE_TEGetScrapLength, 1,
+@@ -1298,7 +1298,7 @@ static PyMethodDef TE_methods[] = {
+      PyDoc_STR(&quot;(UInt8 value) -&gt; None&quot;)},
+     {&quot;as_TE&quot;, (PyCFunction)TE_as_TE, 1,
+      PyDoc_STR(&quot;(Handle h) -&gt; (TEHandle _rv)&quot;)},
+-#endif /* __LP64__ */
++#endif /* APPLE_SUPPORTS_QUICKTIME */
+     {NULL, NULL, 0}
+ };

+@@ -1308,7 +1308,7 @@ static PyMethodDef TE_methods[] = {
+ void init_TE(void)
+ {
+     PyObject *m;
+-#ifndef __LP64__
++#if APPLE_SUPPORTS_QUICKTIME
+     PyObject *d;


+@@ -1316,10 +1316,10 @@ void init_TE(void)
+         PyMac_INIT_TOOLBOX_OBJECT_NEW(TEHandle, TEObj_New);
+         PyMac_INIT_TOOLBOX_OBJECT_CONVERT(TEHandle, TEObj_Convert);

+-#endif /* __LP64__ */
++#endif /* APPLE_SUPPORTS_QUICKTIME */

+     m = Py_InitModule(&quot;_TE&quot;, TE_methods);
+-#ifndef __LP64__
++#if APPLE_SUPPORTS_QUICKTIME
+     d = PyModule_GetDict(m);
+     TE_Error = PyMac_GetOSErrException();
+     if (TE_Error == NULL ||
+@@ -1332,7 +1332,7 @@ void init_TE(void)
+     /* Backward-compatible name */
+     Py_INCREF(&amp;TE_Type);
+     PyModule_AddObject(m, &quot;TEType&quot;, (PyObject *)&amp;TE_Type);
+-#endif /* __LP64__ */
++#endif /* APPLE_SUPPORTS_QUICKTIME */
+ }

+ /* ========================= End module _TE ========================= */
+Index: Mac/Modules/win/_Winmodule.c
+===================================================================
+--- Mac/Modules/win/_Winmodule.c.orig
++++ Mac/Modules/win/_Winmodule.c
+@@ -2,10 +2,10 @@
+ /* ========================== Module _Win =========================== */

+ #include &quot;Python.h&quot;
++#include &quot;pymactoolbox.h&quot;

+-#ifndef __LP64__
++#if APPLE_SUPPORTS_QUICKTIME

+-#include &quot;pymactoolbox.h&quot;

+ /* Macro to test whether a weak-loaded CFM function exists */
+ #define PyMac_PRECHECK(rtn) do { if ( &amp;rtn == NULL )  {\
+@@ -3147,10 +3147,10 @@ static PyObject *Win_FindWindow(PyObject
+                          WinObj_WhichWindow, theWindow);
+     return _res;
+ }
+-#endif /* __LP64__ */
++#endif /* APPLE_SUPPORTS_QUICKTIME */

+ static PyMethodDef Win_methods[] = {
+-#ifndef __LP64__
++#if APPLE_SUPPORTS_QUICKTIME
+     {&quot;GetNewCWindow&quot;, (PyCFunction)Win_GetNewCWindow, 1,
+      PyDoc_STR(&quot;(short windowID, WindowPtr behind) -&gt; (WindowPtr _rv)&quot;)},
+     {&quot;NewWindow&quot;, (PyCFunction)Win_NewWindow, 1,
+@@ -3202,12 +3202,12 @@ static PyMethodDef Win_methods[] = {
+     {&quot;FindWindow&quot;, (PyCFunction)Win_FindWindow, 1,
+      PyDoc_STR(&quot;(Point thePoint) -&gt; (short _rv, WindowPtr theWindow)&quot;)},
+     {NULL, NULL, 0}
+-#endif /* __LP64__ */
++#endif /* APPLE_SUPPORTS_QUICKTIME */
+ };



+-#ifndef __LP64__
++#if APPLE_SUPPORTS_QUICKTIME
+ /* Return the object corresponding to the window, or NULL */

+ PyObject *
+@@ -3230,22 +3230,22 @@ WinObj_WhichWindow(WindowPtr w)
+     return it;
+ }

+-#endif /* __LP64__ */
++#endif /* APPLE_SUPPORTS_QUICKTIME */

+ void init_Win(void)
+ {
+     PyObject *m;
+-#ifndef __LP64__
++#if APPLE_SUPPORTS_QUICKTIME
+     PyObject *d;

+     PyMac_INIT_TOOLBOX_OBJECT_NEW(WindowPtr, WinObj_New);
+     PyMac_INIT_TOOLBOX_OBJECT_NEW(WindowPtr, WinObj_WhichWindow);
+     PyMac_INIT_TOOLBOX_OBJECT_CONVERT(WindowPtr, WinObj_Convert);

+-#endif /* __LP64__ */
++#endif /* APPLE_SUPPORTS_QUICKTIME */

+     m = Py_InitModule(&quot;_Win&quot;, Win_methods);
+-#ifndef __LP64__
++#if APPLE_SUPPORTS_QUICKTIME
+     d = PyModule_GetDict(m);
+     Win_Error = PyMac_GetOSErrException();
+     if (Win_Error == NULL ||
+@@ -3258,7 +3258,7 @@ void init_Win(void)
+     /* Backward-compatible name */
+     Py_INCREF(&amp;Window_Type);
+     PyModule_AddObject(m, &quot;WindowType&quot;, (PyObject *)&amp;Window_Type);
+-#endif /* __LP64__ */
++#endif /* APPLE_SUPPORTS_QUICKTIME */
+ }

+ /* ======================== End module _Win ========================= */
+Index: Misc/NEWS
+===================================================================
+--- Misc/NEWS.orig
++++ Misc/NEWS
+@@ -391,6 +391,9 @@ Build

+ - Issue #25136: Support Apple Xcode 7's new textual SDK stub libraries.

++- Issue #27806: Fix 32-bit builds on macOS Sierra 10.12 broken by removal of
++  deprecated QuickTime/QuickTime.h header file.  Patch by sashk.
++
+ Tools/Demos
+ -----------

+Index: Python/mactoolboxglue.c
+===================================================================
+--- Python/mactoolboxglue.c.orig
++++ Python/mactoolboxglue.c
+@@ -106,7 +106,7 @@ PyMac_Error(OSErr err)
+ }


+-#ifndef __LP64__
++#if APPLE_SUPPORTS_QUICKTIME
+ OSErr
+ PyMac_GetFullPathname(FSSpec *fss, char *path, int len)
+ {
+@@ -154,7 +154,7 @@ PyMac_GetFullPathname(FSSpec *fss, char 
+     Py_XDECREF(fs);
+     return err;
+ }
+-#endif /* !__LP64__ */
++#endif /* APPLE_SUPPORTS_QUICKTIME */

+ /* Convert a 4-char string object argument to an OSType value */
+ int
+@@ -419,7 +419,7 @@ GLUE_CONVERT(RGBColor, QdRGB_Convert, &quot;C
+ GLUE_NEW(GWorldPtr, GWorldObj_New, &quot;Carbon.Qdoffs&quot;)
+ GLUE_CONVERT(GWorldPtr, GWorldObj_Convert, &quot;Carbon.Qdoffs&quot;)

+-#ifndef __LP64__
++#if APPLE_SUPPORTS_QUICKTIME
+ GLUE_NEW(Track, TrackObj_New, &quot;Carbon.Qt&quot;)
+ GLUE_CONVERT(Track, TrackObj_Convert, &quot;Carbon.Qt&quot;)
+ GLUE_NEW(Movie, MovieObj_New, &quot;Carbon.Qt&quot;)
+@@ -432,7 +432,7 @@ GLUE_NEW(UserData, UserDataObj_New, &quot;Car
+ GLUE_CONVERT(UserData, UserDataObj_Convert, &quot;Carbon.Qt&quot;)
+ GLUE_NEW(Media, MediaObj_New, &quot;Carbon.Qt&quot;)
+ GLUE_CONVERT(Media, MediaObj_Convert, &quot;Carbon.Qt&quot;)
+-#endif /* !__LP64__ */
++#endif /* APPLE_SUPPORTS_QUICKTIME */

+ GLUE_NEW(Handle, ResObj_New, &quot;Carbon.Res&quot;)
+ GLUE_CONVERT(Handle, ResObj_Convert, &quot;Carbon.Res&quot;)
</ins></span></pre>
</div>
</div>

</body>
</html>