mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-21 10:42:07 +00:00
Use a patch_AddAssertion function instead of extern assertions
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
|
||||
#include "link/assign.hpp"
|
||||
#include "link/main.hpp"
|
||||
#include "link/patch.hpp"
|
||||
#include "link/sdas_obj.hpp"
|
||||
#include "link/section.hpp"
|
||||
#include "link/symbol.hpp"
|
||||
@@ -544,7 +545,7 @@ void obj_ReadFile(char const *fileName, unsigned int fileID) {
|
||||
tryReadLong(nbAsserts, file, "%s: Cannot read number of assertions: %s", fileName);
|
||||
verbosePrint("Reading %" PRIu32 " assertions...\n", nbAsserts);
|
||||
for (uint32_t i = 0; i < nbAsserts; i++) {
|
||||
Assertion &assertion = assertions.emplace_front();
|
||||
Assertion &assertion = patch_AddAssertion();
|
||||
|
||||
readAssertion(file, assertion, fileName, i, nodes[fileID]);
|
||||
linkPatchToPCSect(assertion.patch, fileSections);
|
||||
|
||||
@@ -459,6 +459,10 @@ static int32_t computeRPNExpr(Patch const &patch, std::vector<Symbol> const &fil
|
||||
return popRPN(patch);
|
||||
}
|
||||
|
||||
Assertion &patch_AddAssertion() {
|
||||
return assertions.emplace_front();
|
||||
}
|
||||
|
||||
void patch_CheckAssertions() {
|
||||
verbosePrint("Checking assertions...\n");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user