Game Development Community

OnShutdown macro conflicts!!!

by Huan Li · in Torque 3D Professional · 05/22/2009 (2:49 am) · 2 replies

There are NEW two macro defines in file "platform.h" in BETA 2:
#define OnStartup                                              
   namespace { struct _StaticStartup { _StaticStartup(); }; }  
   static const _StaticStartup _staticStartup;                 
   _StaticStartup::_StaticStartup()

#define OnShutdown                                                
   namespace { struct _StaticShutdown { ~_StaticShutdown(); }; }  
   static const _StaticShutdown _staticShutdown;                  
   _StaticShutdown::~_StaticShutdown()

At least OnShutdown makes a conflict against function "OnShutdown" in win SDK "atlbase.h":
void OnShutdown() throw()
	{
	}

How to resolve it?
Any help will be appreciated!

And I recommand GG to add a prefix to the function or macro you defined, e.g. torque_OnShutdown or GG_OnShutdown
to avoid such conflicts.

#1
05/22/2009 (7:44 pm)
@Huan - You can comment or rename those macros for now on your local copy... i'll rename them for beta 3.
#2
05/24/2009 (1:54 am)
@Tom Spilman
That'll be good:)

For now, i use #undef OnShutdown at the beginning of the source file which uses <atlbase.h>.

beta 3 is expected.....