On 7 Dec 2009, at 15:49, manolo gouy wrote:
>
> I have uploaded a slightly modified Fl_cocoa.mm file
> that should solve all compilation errors reported by Ian.

Almost... I still don't seem to have MAC_OS_X_VERSION_MAX_ALLOWED  
defined in my command line build, so I had to comment that out...

e.g.


//#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5
typedef long NSInteger;
typedef unsigned long NSUInteger;
//#endif

Thereafter Fl.cxx (which wraps Fl_cocoa.mm for those who are  
following this at home...) built silently.

Note that I also have your Fl_Preferences.cxx patch dropped in there  
too.

>
> It contains this addition:
> #include <AvailabilityMacros.h>
> #if defined(__LP64__) && __LP64__
> typedef double CGFloat;
> #else
> typedef float CGFloat;
> #endif

Yes, that seems to have got it.

>
> plus a default clause in each of the two switch statements that caused
> warnings.

Yes - compiled Fl.cxx free of warnings.

I then get as far as:

Compiling fl_font.cxx...
Fl_Font.H:71: error: 'CTFontRef' does not name a type
fl_font_mac.cxx: In constructor  
'Fl_Font_Descriptor::Fl_Font_Descriptor(const char*, Fl_Fontsize)':


There seems to be a few things in play here...

Firstly, unless AvailabilityMacros.h is included, then I don't have  
visibility of the MAC_OS_X_VERSION_10_x macros at all (naturally) and  
further, the version of AvailabilityMacros.h provided by this SDK  
does not know what value to assign to MAC_OS_X_VERSION_10_5 anyway,  
so that test always fails.
(It's an older Xcode, so that latest thing it knows about is 10.4,  
any reference to 10.5 is just null...)

I think that we can not test for:

#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5

because systems that only have the old SDK's will not know what  
MAC_OS_X_VERSION_10_5 is so it will maybe test *less than*  
MAC_OS_X_VERSION_MAX_ALLOWED...

Instead, I think we need to turn that around and do:

#if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_4

... or equivalent. Maybe. Something like that, anyway...



With this very nasty hack below added to config.h, I can build the  
lib OK, so I guess it is just a matter of getting the options right  
for the older SDK to do the Right Thing.


#define MAC_OS_X_VERSION_MAX_ALLOWED  1040
#define MAC_OS_X_VERSION_MIN_REQUIRED 1030
#include <AvailabilityMacros.h>
#ifndef MAC_OS_X_VERSION_10_5
#  define MAC_OS_X_VERSION_10_5 1050
#endif

#if defined(__LP64__) && __LP64__
typedef double CGFloat;
#else
typedef float CGFloat;
#endif

That actually causes a fair number of warnings (I'm forcibly  
redefining things) but it all seems to build and run OK.

-- 
Ian








_______________________________________________
fltk-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev

Reply via email to