A single #name stringify the name
A double ## joins two names
- Code: Select all Expand view
- function Main()
MsgInfo( Test() )
return nil
#pragma BEGINDUMP
#include <hbapi.h>
#include <stdio.h>
#define MEMBER(TYPE,NAME,MORE) TYPE NAME MORE
#define TSTRUCT(NAME,MEMBERS) \
typedef struct NAME { \
MEMBERS \
} NAME; \
const char* const NAME##_Members = #MEMBERS;
TSTRUCT(S,
MEMBER(int,x;,
MEMBER(void*,z[2];,
MEMBER(char,(*f)(char,char);,
MEMBER(char,y;,
)))));
HB_FUNC( TEST )
{
S test;
hb_retni( test.x );
// hb_retc( S_Members );
}
#pragma ENDDUMP