Restore Darling Specific Changes

This commit is contained in:
Thomas A 2023-02-18 17:48:45 -08:00
parent 9fe8ec4d50
commit 35bb1a1bfe
3 changed files with 15 additions and 1 deletions

View File

@ -17,16 +17,21 @@
#endif
/* Workaround */
#if __has_include(<Availability.h>)
// this path is disabled in Darling because Apple's SDK does the same
// (well, they actually replace the macro directly with `!__LP64__`)
#if __has_include(<Availability.h>) && !defined(DARLING)
#include <Availability.h>
#define APPLE_SUPPORTS_QUICKTIME (__MAC_OS_X_VERSION_MAX_ALLOWED < 101200) && !__LP64__
#else
#define APPLE_SUPPORTS_QUICKTIME !__LP64__
#endif
// this is also disabled in Darling for the same reason (not enabled in Apple's SDK)
#ifndef DARLING
#if APPLE_SUPPORTS_QUICKTIME
#include <QuickTime/QuickTime.h>
#endif /* APPLE_SUPPORTS_QUICKTIME */
#endif
/*
** Helper routines for error codes and such.
@ -171,6 +176,8 @@ extern int GWorldObj_Convert(PyObject *, GWorldPtr *);
#endif /* APPLE_SUPPORTS_QUICKTIME */
/* Qt exports */
// disabled for Darling because Apple's SDK disables it too
#ifndef DARLING
#if APPLE_SUPPORTS_QUICKTIME
extern PyObject *TrackObj_New(Track);
extern int TrackObj_Convert(PyObject *, Track *);
@ -185,6 +192,7 @@ extern int UserDataObj_Convert(PyObject *, UserData *);
extern PyObject *MediaObj_New(Media);
extern int MediaObj_Convert(PyObject *, Media *);
#endif /* APPLE_SUPPORTS_QUICKTIME */
#endif
/* Res exports */
extern PyObject *ResObj_New(Handle);

View File

@ -26,9 +26,11 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include "Python.h"
#include "pymactoolbox.h"
#include <arpa/inet.h> /* for ntohl, htonl */
#ifndef DARLING
#ifndef __LP64__
#include <QuickTime/QuickTime.h>
#endif
#endif
/* Like strerror() but for Mac OS error numbers */
@ -422,6 +424,8 @@ GLUE_CONVERT(RGBColor, QdRGB_Convert, "Carbon.Qd")
GLUE_NEW(GWorldPtr, GWorldObj_New, "Carbon.Qdoffs")
GLUE_CONVERT(GWorldPtr, GWorldObj_Convert, "Carbon.Qdoffs")
// again, see the header
#ifndef DARLING
#if APPLE_SUPPORTS_QUICKTIME
GLUE_NEW(Track, TrackObj_New, "Carbon.Qt")
GLUE_CONVERT(Track, TrackObj_Convert, "Carbon.Qt")
@ -436,6 +440,7 @@ GLUE_CONVERT(UserData, UserDataObj_Convert, "Carbon.Qt")
GLUE_NEW(Media, MediaObj_New, "Carbon.Qt")
GLUE_CONVERT(Media, MediaObj_Convert, "Carbon.Qt")
#endif /* APPLE_SUPPORTS_QUICKTIME */
#endif
GLUE_NEW(Handle, ResObj_New, "Carbon.Res")
GLUE_CONVERT(Handle, ResObj_Convert, "Carbon.Res")

View File

@ -0,0 +1 @@
// this file is a dummy source to avoid having only object library sources for a target