Files
rgbds/include/link/patch.hpp
Rangi42 26a93a530b Use std::deque for assertions
Also fix a memory leak
2024-02-29 13:44:08 -05:00

33 lines
675 B
C++

/* SPDX-License-Identifier: MIT */
// Applying patches to SECTIONs
#ifndef RGBDS_LINK_PATCH_H
#define RGBDS_LINK_PATCH_H
#include <deque>
#include <stdint.h>
#include "link/section.hpp"
#include "linkdefs.hpp"
struct Assertion {
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;
};
/*
* Checks all assertions
* @return true if assertion failed
*/
void patch_CheckAssertions(std::deque<struct Assertion> &assertions);
/*
* Applies all SECTIONs' patches to them
*/
void patch_ApplyPatches(void);
#endif // RGBDS_LINK_PATCH_H