freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ft-devel] endian issue in ftmac.c


From: Sean McBride
Subject: Re: [ft-devel] endian issue in ftmac.c
Date: Tue, 20 Jun 2006 10:36:58 -0400

On 2006-06-20 17:54, address@hidden said:

>2 weeks ago, I received a report from Mr. David Sachitano:
>ftmac.c is dependent with system endian and does not
>work on Intel Mac. Afterwards, he sent me a patch written
>by Mr. Apple Lawrence Coopet (from Apple). His patch uses
>CoreFoundation functions to fix endian issue, e.g.
>CFSwapInt16BigToHost(). Of course, they are unavailable in
>MPW environment, so I replaced them by macro functions.
>Attached patch is my modified version.

You must be the last person on Earth still using MPW. :)

True, CFSwapInt16BigToHost is Mac OS X only.  But I think you can use
the functions in Endian.h on both Mac OS 9 and X.  For example:
EndianU16_BtoN().

>I've tested patched ftmac.c on Intel Mac, and checked
>that the outputs by ft2demos' ftoldmac are exactly same
>between PowerPC binary (executed via Rosetta emulation)
>and Intel native binary. So, I think, the patch is not
>perfect solution (some internal data is still stored in
>reverse byte-order), but it can work quick fix of endian
>issue, for public API. Without the patch, almost functions
>of ftmac.c causes SEGV crashes, because its core part
>(FOND parser) has endian issue.

Have you read the "Universal Binary Programming Guidelines"?
Specifically, this page:

<https://developer.apple.com/documentation/MacOSX/Conceptual/
universal_binary/universal_binary_tips/chapter_5_section_14.html#//
apple_ref/doc/uid/TP40002217-CH239-CJBCCBDD>

Thanks for your work on this!

--
____________________________________________________________
Sean McBride, B. Eng                 address@hidden
Rogue Research                        www.rogue-research.com
Mac Software Developer              Montréal, Québec, Canada






reply via email to

[Prev in Thread] Current Thread [Next in Thread]