mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
No more anonymous structs (not standard C++) (#1305)
This is one step to restoring `-pedantic` builds
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user