• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Building for earlier OS X versions : Check for NULL *address* of constants
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Building for earlier OS X versions : Check for NULL *address* of constants


  • Subject: Re: Building for earlier OS X versions : Check for NULL *address* of constants
  • From: Jean-Daniel Dupas <email@hidden>
  • Date: Mon, 29 Apr 2013 09:15:12 +0200

Le 29 avr. 2013 à 03:59, Jerry Krinock <email@hidden> a écrit :

> In Apple's SDK Compatibility Guide > Using SDK-Based Development, it says…
>
> "Check the availability of an external (extern) constant or a notification name by explicitly comparing its address — and not the symbol’s bare name — to NULL or nil."
>
> It also says, regarding C *functions* that "the linker sets the address of unavailable functions to NULL".  Do they mean during the linking phase of building, or when the program loads (runtime)?

They mean the dynamic linker. It happens at load time, not at compile time.

> More importantly, is the following code correct?  It looks weird.

While it may look weird, this is the way to do it.

>
> NSString* identifier ;
> if (&NSWorkspaceApplicationKey != NULL) {
>    // We are running in Mac OS X 10.6 or later
>    identifier = <expression using the bare name: NSWorkspaceApplicationKey> ;
> }
> else {
>    // We are running in Mac OS X 10.5
>    identifier = <some other expression> ;
> }


-- Jean-Daniel





 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Follow-Ups:
    • Re: Building for earlier OS X versions : Check for NULL *address* of constants
      • From: Jerry Krinock <email@hidden>
References: 
 >Building for earlier OS X versions : Check for NULL *address* of constants (From: Jerry Krinock <email@hidden>)

  • Prev by Date: Building for earlier OS X versions : Check for NULL *address* of constants
  • Next by Date: Sharing code between projects
  • Previous by thread: Building for earlier OS X versions : Check for NULL *address* of constants
  • Next by thread: Re: Building for earlier OS X versions : Check for NULL *address* of constants
  • Index(es):
    • Date
    • Thread