Date: prev next · Thread: first prev next last
2011 Archives by date, by thread · List index


On Fri, Jul 22, 2011 at 9:51 AM, Tor Lillqvist <tlillqvist@novell.com> wrote:
I just find that "drop it because it is old" is not enough reason to
drop 10.4 support.

Yeah, I see your point.

I guess a good enough reason to drop it would be this hypothetical (but, I guess, quite possible) 
situation, or something similar: Some volunteer wants to contribute code that makes LibreOffice 
integrate nicely with Lion's document versioning etc. Using those features requires compiling 
with the compiler from Xcode 4(.1) (even if one would look up and use the API in question 
dynamically), thanks to the use of blocks 
(http://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/Blocks/Articles/00_Introduction.html
 ) or whatever, and that compiler is not capable of compiling against the 10.4 SDK. And mixing 
compilers wouldn't work either.

How likely is it that something like that would happen? I guess we won't know for sure until 
somebody actually starts hacking on the MacOSX code to make it use (optionally at run-time) 
up-to-date features of the OS...

One feature that will help here is described in
http://developer.apple.com/library/mac/#technotes/tn2064/_index.html

namely
extern int SayHello() __attribute__((weak_import));

that is you tell the linker that the said external reference is 'weak'
that is if it is resolved, fine, otherwise, keep going.

The trick of course is that the code must make sure not to use a
feature if it is not there..
 the tech note give an example:

#include <stdlib.h>
#include <stdio.h>

extern int SayHello() __attribute__((weak_import));

int main()
{
    int result;

    if (SayHello!=NULL)
    {
        printf("SayHello is present!\n");
        result=SayHello();
    }
    else
        printf("SayHello is not present!\n");
}

Norbert (who is learning more about Mac OS SDKs than he really wanted to :-) )

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.