Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8579393
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T20:36:02+00:00 2026-06-11T20:36:02+00:00

I want some code tobe compiled under 10.6 and below but not 10.7 and

  • 0

I want some code tobe compiled under 10.6 and below but not 10.7 and above.

For example:

#ifdef current version is MAC_OS_X_VERSION_10_6 or below

// do this

elif current version is MAC_OS_X_VERSION_10_7 or above 

//do that

#endif

Can someone help me ge proper macros for it? I looked into AvailabilityMacros.h but was not able to figure out proper ifdef.

I have a dynamic library, and it cannot be loaded under 10.7 and above but loads properly under 10.6. This is due to private symbol _CGContextAppendPath. I want to keep it using under 10.6 and below but avoid its use in 10.7 and below. This is because _CGContextAppendPath symbol is not present on 10.7 and above.

I used,

SInt32 version = 0;
Gestalt( gestaltSystemVersion, &version );

bool lionabove = ( version >= 0x1070 );

did not work.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T20:36:03+00:00Added an answer on June 11, 2026 at 8:36 pm

    For Objective C, the go-to route would be to check the availability of specific APIs via e.g. [object respondsToSelector:].

    For the C library you are using, weak-link to CoreGraphics.framework (so the loading doesn’t fail when some functions aren’t present) and check for availability of the function in question via &_CGContextAppendPath != NULL.

    Details in http://developer.apple.com/library/mac/#documentation/DeveloperTools/Conceptual/cross_development/Configuring/configuring.html#//apple_ref/doc/uid/10000163i-CH1-107837 and http://developer.apple.com/library/mac/#documentation/DeveloperTools/Conceptual/cross_development/Using/using.html#//apple_ref/doc/uid/20002000-1114537-BABHHJBC.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want some code to be triggered every second. Usually, I'd create a Timer
For the most part, when I want to display some HTML code to be
I have some code using libxml2's SAX2 interface. I want to be able to
I want to implement some code in excel macro to group some data for
I want to reuse some code I wrote to add some functionality to a
I want to modify some code in the Eclipse JDT itself (In the Debug
I often run into the situation where I want to disable some code while
I'm using Sublime Text 2 and SublimeCodeIntel plugin. I want to have some code
I have some code which I want to document with in-body comments like so:
I want to execute some Python code, typed at runtime, so I get the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.