On Aug 25, 2016, at 8:38 PM, Ken Cunningham <kenneth.f.cunning...@gmail.com> wrote: > > I agree - preprocessor macros are the upstream way to solve this. I've seen > several ports that use this method... > > Ken > > > Begin forwarded message: > >> From: Ken Cunningham <ken.cunningham.web...@gmail.com> >> Date: August 25, 2016 11:14:37 AM PDT >> To: Mojca Miklavec <mo...@macports.org> >> Cc: k...@codebykevin.com >> Subject: Re: Updating tk +quartz failed on Snow Leopard >> >> also, this Apple document would appear to be of potential use: >> >> <https://developer.apple.com/library/ios/documentation/DeveloperTools/Conceptual/cross_development/Using/using.html#//apple_ref/doc/uid/20002000-SW6> >> >> especially down at this part: >> >> Listing 3-3 Using preprocessor directives for conditional compilation >> #ifdef __MAC_OS_X_VERSION_MAX_ALLOWED >> // code only compiled when targeting OS X and not iOS >> // note use of 1050 instead of __MAC_10_5 >> #if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1050 >> if (CGColorCreateGenericCMYK != NULL) { >> CGColorCreateGenericCMYK(0.1,0.5.0.0,1.0,0.1); >> } else { >> #endif >> // code to create a color object with earlier technology >> #if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1050 >> } >> #endif >> #endif >> } >> >> >> Ken >> >> >> On 2016-08-25, at 10:06 AM, Ken Cunningham wrote: >> >>> Perhaps these AvailabilityMacros might be of use here. I've seen them used >>> for conditional code in other ports. This example was for 10.9, but you'd >>> presumably use a slightly different version of the code for 10.6, or 10.7+. >>> >>> /usr/include/AvailabilityMacros.h >>> >>> eg: >>> <http://stackoverflow.com/questions/20485797/what-macro-to-use-to-identify-mavericks-osx-10-9-in-c-c-code> >>> >>> #if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_9 >>> <Put your Mavericks specific code here..> >>> #else >>> <Put all other code here..> >>> #endif >>> >>> >>> Ken
I just haven't researched whether one is supposed to use MAC_OS_X_VERSION_MIN_REQUIRED or MAC_OS_X_VERSION_MAX_ALLOWED or __MAC_OS_X_VERSION_MAX_ALLOWED or something else. _______________________________________________ macports-dev mailing list macports-dev@lists.macosforge.org https://lists.macosforge.org/mailman/listinfo/macports-dev