# HG changeset patch # User Ryan C. Gordon # Date 1126161268 0 # Node ID cf6133247d34cd2dfe9f551dbfe22050643e2c5b # Parent 55a86cfe6277f0e7e09648891f1915f64707d3bf Mac Classic and CodeWarrior patches. --ryan. From: =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= Subject: Re: [SDL] Updated Mac patch Date: Tue, 6 Sep 2005 15:21:27 +0200 To: A list for developers using the SDL library Earlier, I wrote: > Updated the previous Mac patch to disable Carbon by default. > Also "fixed" the SDL.spec again, so that it builds on Darwin. > > http://www.algonet.se/~afb/SDL-1.2.9-mac.patch > Also applied fine to SDL12 CVS, when I tried it. > > Haven't completed any new packaging or projects for Xcode/PB, > but it seems to build and install fine here (in development). Tested the new patch to build with old CodeWarrior and MPW, and it seems it needed some hacks with those old headers... Just in case you want to support the archeological versions - here is a small add-on to the above patch, to fix those... http://www.algonet.se/~afb/SDL-1.2.9-classic.patch I couldn't get the old CW5 projects to build without a few modifications - such as deleting the stray old header in: "CWprojects/Support/Carbon/Include/ConditionalMacros.h" ? But I updated both projects to CW6 too and built for Carbon, and it ran all of the Mac test projects without any problems. The MPW file seems to have compiled, with a small order change. As long as you're still shipping the CWProjects and MPWmake with the download, they should probably be updated/fixed ? (another "solution" would of course be to just delete them) I'll post my new projects along with the new Xcode projects later on, along with XML exports of the various .mcp files. (CW5 builds for Classic / "PPC", and CW6 builds for Carbon) It'll be packaged as a part of the next SpriteWorld X release... http://spriteworldx.sourceforge.net/ [Classic/Carbon/Win/X11] --anders diff -r 55a86cfe6277 -r cf6133247d34 src/SDL_loadso.c --- a/src/SDL_loadso.c Thu Sep 08 06:17:23 2005 +0000 +++ b/src/SDL_loadso.c Thu Sep 08 06:34:28 2005 +0000 @@ -37,6 +37,7 @@ # include #elif defined(macintosh) # include +#define OLDP2C 1 # include # include # include diff -r 55a86cfe6277 -r cf6133247d34 src/audio/macrom/SDL_romaudio.c --- a/src/audio/macrom/SDL_romaudio.c Thu Sep 08 06:17:23 2005 +0000 +++ b/src/audio/macrom/SDL_romaudio.c Thu Sep 08 06:34:28 2005 +0000 @@ -42,6 +42,9 @@ #if !defined(NewSndCallBackProc) /* avoid circular redefinition... */ #define NewSndCallBackUPP NewSndCallBackProc #endif +#if !defined(NewSndCallBackUPP) +#define NewSndCallBackUPP NewSndCallBackProc +#endif #endif #include "SDL_endian.h" diff -r 55a86cfe6277 -r cf6133247d34 src/joystick/win32/SDL_mmjoystick.c --- a/src/joystick/win32/SDL_mmjoystick.c Thu Sep 08 06:17:23 2005 +0000 +++ b/src/joystick/win32/SDL_mmjoystick.c Thu Sep 08 06:34:28 2005 +0000 @@ -87,7 +87,7 @@ unsigned char regvalue[256]; unsigned char regname[256]; - sprintf(regkey, "%s\\%s\\%s", + sprintf((char *) regkey, "%s\\%s\\%s", REGSTR_PATH_JOYCONFIG, szRegKey, REGSTR_KEY_JOYCURR); @@ -100,20 +100,20 @@ joystick's properties */ regsize = sizeof(regname); - sprintf(regvalue, + sprintf((char *) regvalue, "Joystick%d%s", index+1, REGSTR_VAL_JOYOEMNAME); regresult = RegQueryValueExA(hKey, - regvalue, 0, 0, (LPBYTE) ®name, + (char *) regvalue, 0, 0, (LPBYTE) ®name, (LPDWORD) ®size); RegCloseKey(hKey); if (regresult == ERROR_SUCCESS) { /* open that registry key */ - sprintf(regkey, "%s\\%s", + sprintf((char *) regkey, "%s\\%s", REGSTR_PATH_JOYOEM, regname); regresult = RegOpenKeyExA(HKEY_LOCAL_MACHINE, - regkey, 0, KEY_READ, &hKey); + (char *) regkey, 0, KEY_READ, &hKey); if (regresult == ERROR_SUCCESS) { /* find the size for the OEM name text */ diff -r 55a86cfe6277 -r cf6133247d34 src/video/macdsp/SDL_dspvideo.c --- a/src/video/macdsp/SDL_dspvideo.c Thu Sep 08 06:17:23 2005 +0000 +++ b/src/video/macdsp/SDL_dspvideo.c Thu Sep 08 06:34:28 2005 +0000 @@ -520,9 +520,11 @@ static int DSp_VideoInit(_THIS, SDL_PixelFormat *vformat) { - NumVersion dsp_version; + NumVersion dsp_version = { 0x01, 0x00, 0x00, 0x00 }; +#if UNIVERSAL_INTERFACES_VERSION > 0x0320 dsp_version = DSpGetVersion (); +#endif if ( (dsp_version.majorRev == 1 && dsp_version.minorAndBugRev < 0x73) || (dsp_version.majorRev < 1) ) { @@ -801,7 +803,7 @@ attrib.colorNeeds = kDSpColorNeeds_Require; attrib.colorTable = 0; attrib.pageCount = page_count; - #if TARGET_API_MAC_OSX + #if TARGET_API_MAC_OSX || UNIVERSAL_INTERFACES_VERSION == 0x0320 if ( DSpFindBestContext (&attrib, &dsp_context) != noErr ) { SDL_SetError ("DrawSprocket couldn't find a context");