I am porting a Windows project to Xcode. I have the following in a .h file which is included in multiple files within the project.
-------------
#ifndef MyConversionH #define MyConversionH
#ifdef __cplusplus extern "C" { #endif
/* MACOSX has been defined in Xcode */ #ifdef MACOSX #define __inline __inline__ #endif
#define MilliUnits 1000
__inline int64_t UnitsToMilliUnits(int64_t myUnit) { return (myUnit / MilliUnits); };
#ifdef __cplusplus } #endif
#endif
------------- Even though I have bracketed the entire file with:.
#ifndef MyConversionH #define MyConversionH ...
#endif
It appears it is added during the compile phase multiple times. I am getting an error during the link phase indicating multiple definitions of symbol _UnitsToMilliUnits
If I change:
#define __inline __inline__
to:
#define __inline extern __inline__
It will compile and link, however by doing this I assume I never actually define the function. It appears to be working in Windows. How do I define this so that GCC will be happy? Has this file been magically cached somewhere and do I need to change one of my Xcode settings which I have missed?
- George Lawrence Storm DivX, Inc.
|