http://gcc.gnu.org/onlinedocs/cpp/Stringification.html#Stringification

EDIT:
I came to realisation one can not use this on non-fixed objects, and for gaining names of fixed objects, one can use engine_getVarInfo();

EDIT2:
And I now came to realisation this can ofcourse still be useful.
Macros allow structure types to be handled, functions do not.
Code:
#define new( x ) create_object( malloc(sizeof(x)), #x )

void *create_object( void *obj, char *name ) {
  //store new object and the structure name into list for management...
}

MY_STRUCT *ms = new( MY_STRUCT );

//now we have created a new custom structure and stored the pointer,
//ánd structure name into a management list.
//With this, all sorts of more fancy stuff can be applied.



As far as I tried this can not be realized without the macro stringification command.
Yes, there are of course ways by passing the name in quotes with the new() definition, but that is quite cumbersome.


Last edited by Joozey; 10/10/09 00:08.

Click and join the 3dgs irc community!
Room: #3dgs