MusicSequenceLoadSMFData() can be enabled for ppc builds for 10.4 and lower
authorSam Lantinga <slouken@libsdl.org>
Sat, 11 Aug 2012 23:22:31 -0700
changeset 590180ef9af767b
parent 589 a9a8e029a84b
child 591 b183a96c627f
MusicSequenceLoadSMFData() can be enabled for ppc builds for 10.4 and lower

Ozkan Sezer 2012-08-10 13:01:15 PDT

On a somewhat related note, MusicSequenceLoadSMFData() can be enabled for ppc
builds for 10.4 and lower in order to enable functionality back to 10.2. A
patch is attached (MusicSequenceLoadSMFData.diff).
native_midi/native_midi_macosx.c
     1.1 --- a/native_midi/native_midi_macosx.c	Sat Aug 11 23:21:14 2012 -0700
     1.2 +++ b/native_midi/native_midi_macosx.c	Sat Aug 11 23:22:31 2012 -0700
     1.3 @@ -194,10 +194,20 @@
     1.4      free(buf);
     1.5      buf = NULL;
     1.6  
     1.7 -    #if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4 /* this is deprecated, but works back to 10.3 */
     1.8 +    #if MAC_OS_X_VERSION_MIN_REQUIRED < 1050
     1.9 +    /* MusicSequenceLoadSMFData() (avail. in 10.2, no 64 bit) is
    1.10 +     * equivalent to calling MusicSequenceLoadSMFDataWithFlags()
    1.11 +     * with a flags value of 0 (avail. in 10.3, avail. 64 bit).
    1.12 +     * So, we use MusicSequenceLoadSMFData() for powerpc versions
    1.13 +     * but the *WithFlags() on intel which require 10.4 anyway. */
    1.14 +    # if defined(__ppc__) || defined(__POWERPC__)
    1.15 +    if (MusicSequenceLoadSMFData(song->sequence, data) != noErr)
    1.16 +        goto fail;
    1.17 +    # else
    1.18      if (MusicSequenceLoadSMFDataWithFlags(retval->sequence, data, 0) != noErr)
    1.19          goto fail;
    1.20 -    #else  /* not deprecated, but requires 10.5 or later */
    1.21 +    # endif
    1.22 +    #else  /* MusicSequenceFileLoadData() requires 10.5 or later.  */
    1.23      if (MusicSequenceFileLoadData(retval->sequence, data, 0, 0) != noErr)
    1.24          goto fail;
    1.25      #endif