mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 18:22:07 +00:00
Use std::deque for assertions
Also fix a memory leak
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
#ifndef RGBDS_LINK_PATCH_H
|
||||
#define RGBDS_LINK_PATCH_H
|
||||
|
||||
#include <deque>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "link/section.hpp"
|
||||
@@ -11,20 +12,17 @@
|
||||
#include "linkdefs.hpp"
|
||||
|
||||
struct Assertion {
|
||||
struct Patch patch;
|
||||
// enum AssertionType type; The `patch`'s field is instead re-used
|
||||
struct Patch patch; // Also used for its `.type`
|
||||
char *message;
|
||||
// This would be redundant with `.section->fileSymbols`... but `section` is sometimes NULL!
|
||||
struct Symbol **fileSymbols;
|
||||
|
||||
struct Assertion *next;
|
||||
};
|
||||
|
||||
/*
|
||||
* Checks all assertions
|
||||
* @return true if assertion failed
|
||||
*/
|
||||
void patch_CheckAssertions(struct Assertion *assertion);
|
||||
void patch_CheckAssertions(std::deque<struct Assertion> &assertions);
|
||||
|
||||
/*
|
||||
* Applies all SECTIONs' patches to them
|
||||
|
||||
Reference in New Issue
Block a user