• 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: Seeking Preprocessor macro clarification
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Seeking Preprocessor macro clarification


  • Subject: Re: Seeking Preprocessor macro clarification
  • From: Chris Espinosa <email@hidden>
  • Date: Tue, 7 Aug 2007 15:22:39 -0700


On Aug 7, 2007, at 1:17 PM, Michael McLaughlin wrote:

I am an Xcode newbie, having spent >10 years with CodeWarrior.  I am

"practicing" Xcode by trying to port an open-source project: SFMT.


http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/


This code has several #defines to trigger conditional compilation blocks,

e.g. For Altivec vs. SSE2.


In target scope (Deployment), I set one such macro, HAVE_ALTIVEC=1, but it

does not show up in Project Symbols as I had expected, nor is its effect

apparent in Xcode prior to compilation.


If I #define this symbol in the top-level header, then it does show up in

Project Symbols and it does seem to trigger the necessary changes, e.g. from


#if defined(HAVE_ALTIVEC)

  #if !defined(__APPLE__)

    #include <altivec.h>

  #endif

/** 128-bit data structure */

union W128_T {

    vector unsigned int s;

    uint32_t u[4];

};

/** 128-bit data type */

typedef union W128_T w128_t;


#elif defined(HAVE_SSE2)

...


Should I expect see such conditional definitions in Xcode or is the latter

oblivious to anything not given in a header (such as -DHAVE_ALTIVEC=1)?  I

observe, in the Build log, that the macro is sent to the compiler but

debugging is more difficult when conditional definitions are ambiguous.


Unfortunately, nothing defined in Build Settings will show up in the project index, which drives not only the Project Symbols smartgroup but also navigational items.  

The Prefix Header is the best place for such global definitions and uses if you want the navigation abilities to find it.

Chris
 _______________________________________________
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

References: 
 >Seeking Preprocessor macro clarification (From: Michael McLaughlin <email@hidden>)

  • Prev by Date: Re: How packages are recognized...
  • Next by Date: Re: How packages are recognized...
  • Previous by thread: Seeking Preprocessor macro clarification
  • Next by thread: long double on 64 bit Intel
  • Index(es):
    • Date
    • Thread