Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
0 registered members (), 18,008 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Stringification in macros #293121
10/09/09 13:04
10/09/09 13:04
Joined: Oct 2004
Posts: 4,134
Netherlands
Joozey Offline OP
Expert
Joozey  Offline OP
Expert

Joined: Oct 2004
Posts: 4,134
Netherlands
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
Re: Stringification in macros [Re: Joozey] #295572
10/26/09 07:43
10/26/09 07:43
Joined: Jul 2000
Posts: 28,024
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,024
Frankfurt
Judging from the compiler source, macro stringification seems to be already implemented but not to work. As soon as I've understood the Chinese comments in the source, I have a chance to make it work.

Re: Stringification in macros [Re: jcl] #296950
11/03/09 22:25
11/03/09 22:25
Joined: Oct 2004
Posts: 4,134
Netherlands
Joozey Offline OP
Expert
Joozey  Offline OP
Expert

Joined: Oct 2004
Posts: 4,134
Netherlands
An attempt is most appreciated.
Thanks.


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

Moderated by  aztec, Spirit 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1