> Elan Ruskin gave a good talk on porting to consoles at GDC08. The
> slides are on Valve's website. There's something in there that may
> help you here:
>
> #ifdef __GNUC__
> #define MAXSI_THREADED_VARIABLE __thread
> #else
> #define MAXSI_THREADED_VARIABLE __declspec( thread )
> #endif
>
> You may wish to use another define for windows rather than an else
> statement in case you wish to port it somewhere else in the future.
>    

Of course. I should have noted that the examples I showed was not the 
actual code. I try to be very religious about my #ifdefs. But if I port 
this to another platform and try to compile, I will just get compiler 
errors that are easy to track back to this #ifdef. Then in this case it 
will be rather easy to fix it. But thanks a lot for pointing this out 
anyways, I tried to make a point about proper #ifdefs in my original 
post, but I cut it because it didn't feel relevant. I will check out the 
slides, though.

Thanks,
Jonas 'Sortie' Termansen.

_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

Reply via email to