reduce boilerplate code

This commit is contained in:
Glenn Maynard
2006-12-17 07:00:30 +00:00
parent f55345ad84
commit d4f43cf844
3 changed files with 3 additions and 6 deletions
@@ -75,8 +75,7 @@ struct RegisterInputHandler
RegisterInputHandler( const istring &sName, CreateInputHandlerFn pfn );
};
#define REGISTER_INPUT_HANDLER_CLASS2( name, x ) \
static InputHandler *Create##name() { return new InputHandler_##x; } \
static RegisterInputHandler register_##name( #name, Create##name )
static RegisterInputHandler register_##name( #name, CreateClass<InputHandler_##x, InputHandler> )
#define REGISTER_INPUT_HANDLER_CLASS( name ) REGISTER_INPUT_HANDLER_CLASS2( name, name )