dmd 1.052 for Mac OSX 10.6

Jacob Carlborg doob at me.com
Fri Nov 13 06:30:23 PST 2009


On 11/13/09 11:20, Walter Bright wrote:
> Denis Koroskin wrote:
>> On Fri, 13 Nov 2009 07:07:21 +0300, Walter Bright
>> <newshound1 at digitalmars.com> wrote:
>>
>>> An update just to support Mac OSX 10.6. That also means the end of
>>> the line for official support of 10.5 and earlier.
>>>
>>> http://ftp.digitalmars.com/dmd.1.051.zip
>>
>> Isn't there any way to support both platforms?
>
> No way to test on 10.5 without buying yet another machine. I don't know
> if it works or not on 10.5. The "bus error" for 10.4 is probably back
> because installing the 10.6 dev system from Apple seems to have deleted
> the 10.4 stuff.
>
> If someone wants to test it on 10.5, please do and report back with the
> results. If it does not, and there's some simple change to make it do
> so, I'll be happy to fold it in.

Can't you wrap the changes you made in:

SInt32 MacVersion;
if (Gestalt(gestaltSystemVersion, &MacVersion) == noErr)
	if (MacVersion >= 0x1050 && MacVersion < 0x1060)
		// Mac OS X 10.5.x code goes here

	else if (MacVersion >= 0x1060)
		// Mac OS X 10.6.x code goes here
	

>> Looking at the changes, I think it's even possible to add a new DMD
>> flag (e.g. "-osx=10.5", defaults to 10.6) and keep an older behavior
>> on demand.
>
> The compiler changes should be backwards compatible with 10.5. (The
> reason it didn't work with 10.6 is Apple changed the linker behavior; I
> found a workaround which appears successful.)
>
>
>> Alternatively, you could wrap the changes you made into #ifdef
>> OSX_10_6 ... #else ... #endif so that users could compile DMD with
>> older Macs support from source. DMD would then be distributed with 2
>> binaries, e.g. dmd_10.6 and dmd_10.5 and dmd would be an alias/symlink
>> to either of them (depending on the target platform).
>
> On Windows I can build one binary that works from NT to Win7, a 20 year
> span of operating systems.



More information about the Digitalmars-d-announce mailing list