Skip to content

Commit

Permalink
(Compliments of Eric Wing...)
Browse files Browse the repository at this point in the history
Hi Ryan,
     It was really nice meeting you at WWDC.

     Attached is the file containing the fix for the SDL_mixer issue
we stumbled upon. I realized that I took this file out of stable
instead of CVS so I wasn't sure if a diff would be very useful.

     I tried to document the problem. Just do a search for "Apple" in
the file. Basically, the Quicktime people screwed up and they use two
entirely different C types depending on your platform's endian-ness.
So you have to case the silly thing. (So technically, I think this is
actually a porting issue and not a gcc 4.0 issue, but it's not our
fault.)

Thanks,
Eric
  • Loading branch information
icculus committed Jun 13, 2005
1 parent 9da35fb commit 405fc7a
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions native_midi/native_midi_mac.c
Expand Up @@ -591,8 +591,22 @@ Uint32 *BuildTuneHeader(int part_poly_max[32], int part_to_inst[32], int numPart
qtma_StuffGeneralEvent(*myPos1, *myPos2, part, kGeneralEventNoteRequest, kNoteRequestEventLength);
myNoteRequest = (NoteRequest *)(myPos1 + 1);
myNoteRequest->info.flags = 0;
/* I'm told by the Apple people that the Quicktime types were poorly designed and it was
* too late to change them. On little endian, the BigEndian(Short|Fixed) types are structs
* while on big endian they are primitive types. Furthermore, Quicktime failed to
* provide setter and getter functions. To get this to work, we need to case the
* code for the two possible situations.
* My assumption is that the right-side value was always expected to be BigEndian
* as it was written way before the Universal Binary transition. So in the little endian
* case, OSSwap is used.
*/
#if __LITTLE_ENDIAN__
myNoteRequest->info.polyphony.bigEndianValue = OSSwapHostToBigInt16(part_poly_max[part]);
myNoteRequest->info.typicalPolyphony.bigEndianValue = OSSwapHostToBigInt32(0x00010000);
#else
myNoteRequest->info.polyphony = part_poly_max[part];
myNoteRequest->info.typicalPolyphony = 0x00010000;
#endif
myErr = NAStuffToneDescription(myNoteAllocator,part_to_inst[part],&myNoteRequest->tone);
if (myErr != noErr)
goto bail;
Expand Down

0 comments on commit 405fc7a

Please sign in to comment.