Been working on this little thing for a few months now, having some issues with some structs. This compiled correctly in vs 2003 but doesnt work properly in c++ 2005. (Most of this is others work and open sourced stuff) Any help is appreciated with why I ths doesnt work.
CODE
#ifdef _DEFINE_VARS
#define MYVAR(type, name) type v##_##name;
#define DEFINEVAR(type, name) type name;
#define MYCARRAY(type, name) CArrayEx<type, type> v_##name;
#define MYTOGGLE(name) BOOL v_##name; INT vK_##name;
#define MYKEY(name) INT vK_##name;
CArrayEx<LevelNameInfo*, LevelNameInfo*> LevelNames;
#else
#define MYVAR(d1, v1) extern d1 v_##v1;
#define DEFINEVAR(type, name) extern type name;
#define MYCARRAY(type, name) extern CArrayEx<type, type> v_##name;
#define MYTOGGLE(name) extern BOOL v_##name; extern INT vK_##name;
#define MYKEY(name) extern INT vK_##name;
extern CArrayEx<LevelNameInfo*, LevelNameInfo*> LevelNames;
#endif
MYVAR(DLLINFO, DllInfo)
CODE
#ifndef _COMMONSTRUCTS_H
#define _COMMONSTRUCTS_H
typedef struct DllInfo_t
{
DWORD dwBaseAddress;
DWORD dwImageSize;
CHAR szModulePath[MAX_PATH];
DWORD dwMagicNumber;
} DLLINFO, *PDLLINFO;
Errors
vars.h(20) : error C2146: syntax error : missing ';' before identifier 'v_DllInfo'
vars.h(20) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
commonstructs.h(16) : error C2378: 'DLLINFO' : redefinition; symbol cannot be overloaded with a typedef
vars.h(20) : see declaration of 'DLLINFO'