On Fri, Jul 22, 2011 at 9:51 AM, Tor Lillqvist <tlillqv...@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 :-) )
_______________________________________________
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice

Reply via email to