Check for macros within .STRUCT/.ENUM.

git-svn-id: svn://svn.cc65.org/cc65/trunk@5076 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
uz
2011-07-08 09:55:17 +00:00
parent 241afdc738
commit bf6b0b9eb7
3 changed files with 23 additions and 4 deletions

View File

@@ -40,6 +40,7 @@
#include "condasm.h"
#include "error.h"
#include "expr.h"
#include "macro.h"
#include "nexttok.h"
#include "scanner.h"
#include "sizeof.h"
@@ -133,6 +134,16 @@ static long DoStructInternal (long Offs, unsigned Type)
/* The format is "[identifier] storage-allocator [, multiplicator]" */
Sym = 0;
if (CurTok.Tok == TOK_IDENT) {
/* Beware: An identifier may also be a macro, in which case we have
* to start over.
*/
Macro* M = FindMacro (&CurTok.SVal);
if (M) {
MacExpandStart (M);
continue;
}
/* We have an identifier, generate a symbol */
Sym = SymFind (CurrentScope, &CurTok.SVal, SYM_ALLOC_NEW);