[torquedev] Libtorque on Mac OS X

Scott Wilson scott at epistemy.com
Fri Jul 16 07:32:26 MDT 2010


On 16 Jul 2010, at 13:26, Michael Barnes wrote:

> On Jul 15, 2010, at 7:33 PM, Joshua Bernstein wrote:
> 
>> Sadly I haven't unpacked my new MBP yet, so I'm only able to build 
>> TORQUE on OS X 10.5 where this doesn't seem to be a problem.
>> 
>> You should be able to just add a #define as you suggest inside of the 
>> libtorque C file, so the symbol is actually defined in there.
> 
> Symbols don't get defined by #defines.  They are substituted before
> compile and link time by the preprocessor.
> 
> What I've done in the past is to make a dummy function or a wrapper
> function to provide the symbol.
> 
> If the symbol is a variable, this is more difficult.  Again, you could
> provide a dummy value for it, but if the code actually needs that
> symbol with meaningful data, you will run into issues.

As far as I can tell, that exactly what's happening here:

> #define environ (*_NSGetEnviron())


It appears to be substituting in a call to some Cocoa function. This seems to be The Workaround, at least according to Google. From the name, it seems to be the a description of the environment, so I can't see why this wouldn't work.

What file does it go in, though! I promise I'll come back and tell you if it doesn't work. ;-)

Scott


More information about the torquedev mailing list