mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
Refactor to avoid redundant obj_CheckAssertions function
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
|
||||
// GUIDELINE: external code MUST NOT BE AWARE of the data structure used!
|
||||
|
||||
#include <deque>
|
||||
#include <memory>
|
||||
#include <stdint.h>
|
||||
#include <string>
|
||||
@@ -13,6 +14,7 @@
|
||||
#include "linkdefs.hpp"
|
||||
|
||||
#include "link/main.hpp"
|
||||
#include "link/patch.hpp"
|
||||
|
||||
struct FileStackNode;
|
||||
struct Section;
|
||||
@@ -53,6 +55,15 @@ struct Section {
|
||||
std::unique_ptr<Section> nextu; // The next "component" of this unionized sect
|
||||
};
|
||||
|
||||
struct Assertion {
|
||||
Patch patch; // Also used for its `.type`
|
||||
std::string message;
|
||||
// This would be redundant with `.section->fileSymbols`, but `section` is sometimes `nullptr`!
|
||||
std::vector<Symbol> *fileSymbols;
|
||||
};
|
||||
|
||||
extern std::deque<Assertion> assertions;
|
||||
|
||||
/*
|
||||
* Execute a callback for each section currently registered.
|
||||
* This is to avoid exposing the data structure in which sections are stored.
|
||||
|
||||
Reference in New Issue
Block a user