No more anonymous structs (not standard C++) (#1305)

This is one step to restoring `-pedantic` builds
This commit is contained in:
Sylvie
2024-02-19 02:12:20 -05:00
committed by GitHub
parent a02687a83e
commit 9cdd0b8a02
8 changed files with 65 additions and 65 deletions

View File

@@ -39,9 +39,9 @@ struct Symbol {
int32_t (*numCallback)(void);
// For SYM_MACRO and SYM_EQUS; TODO: have separate fields
struct {
size_t macroSize;
char *macro;
};
size_t size;
char *value;
} macro;
// For SYM_EQUS
char const *(*strCallback)(void);
};
@@ -97,7 +97,7 @@ static inline char const *sym_GetStringValue(struct Symbol const *sym)
{
if (sym->hasCallback)
return sym->strCallback();
return sym->macro;
return sym->macro.value;
}
void sym_ForEach(void (*func)(struct Symbol *, void *), void *arg);

View File

@@ -37,9 +37,9 @@ struct FileStackNode {
union {
char *name; // NODE_FILE, NODE_MACRO
struct { // NODE_REPT
uint32_t reptDepth;
uint32_t depth;
uint32_t *iters;
};
} rept;
};
};

View File

@@ -56,7 +56,7 @@
#define restrict
// C++ doesn't support designated array initializers, but they're a gcc extension
#ifdef __GNUC__
#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
# define AT(index) [index] =
#else
# define AT(index)