• 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: __FILE__ is absolute, howto get relative?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: __FILE__ is absolute, howto get relative?


  • Subject: Re: __FILE__ is absolute, howto get relative?
  • From: Steve Checkoway <email@hidden>
  • Date: Wed, 9 Nov 2005 05:22:05 -0800

On Nov 8, 2005, at 2:53 PM, Simon Strandgaard wrote:

Is there an option or a define I have overlooked? Well I could extract 'experimental.mm' manually.

Well, this is a bit of a hack, but if you include <string.h> you can use this
#define THIS_FILE ((strrchr(__FILE__, '/') ?: __FILE__ - 1) + 1)


(I knew there had to be a use for the ?:'s default argument. This macro qualifies as the first use I've ever found.)

- Steve

Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
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: __FILE__ is absolute, howto get relative?
      • From: Simon Strandgaard <email@hidden>
References: 
 >__FILE__ is absolute, howto get relative? (From: Simon Strandgaard <email@hidden>)

  • Prev by Date: Re: Subversion, XCode, ADC and 10.4 Server
  • Next by Date: Xcode not compiling a .c file?
  • Previous by thread: Re: __FILE__ is absolute, howto get relative?
  • Next by thread: Re: __FILE__ is absolute, howto get relative?
  • Index(es):
    • Date
    • Thread