• 0

Having some issues here, help needed


Question

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.

#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)

#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'

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.