mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 18:22:07 +00:00
No more flexible array members (not standard C++) (#1307)
* Replace FAMs with `std::vector`s (or one `std::string`) in four `struct`s * Anonymous types declared in an anonymous union are also non-standard Only Clang complains about this (-Wnested-anon-types)
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "asm/lexer.hpp"
|
||||
|
||||
@@ -28,14 +29,12 @@ struct FileStackNode {
|
||||
|
||||
struct FileStackReptNode { // NODE_REPT
|
||||
struct FileStackNode node;
|
||||
uint32_t reptDepth;
|
||||
// WARNING: if changing this type, change overflow check in `fstk_Init`
|
||||
uint32_t iters[]; // REPT iteration counts since last named node, in reverse depth order
|
||||
std::vector<uint32_t> *iters; // REPT iteration counts since last named node, in reverse depth order
|
||||
};
|
||||
|
||||
struct FileStackNamedNode { // NODE_FILE, NODE_MACRO
|
||||
struct FileStackNode node;
|
||||
char name[]; // File name for files, file::macro name for macros
|
||||
std::string *name; // File name for files, file::macro name for macros
|
||||
};
|
||||
|
||||
#define DEFAULT_MAX_DEPTH 64
|
||||
|
||||
Reference in New Issue
Block a user