Files
rgbds/include/link/patch.hpp
2024-02-24 10:51:46 -05:00

35 lines
710 B
C++

/* SPDX-License-Identifier: MIT */
// Applying patches to SECTIONs
#ifndef RGBDS_LINK_PATCH_H
#define RGBDS_LINK_PATCH_H
#include <stdint.h>
#include "link/section.hpp"
#include "linkdefs.hpp"
struct Assertion {
struct Patch patch;
// enum AssertionType type; The `patch`'s field is instead re-used
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);
/*
* Applies all SECTIONs' patches to them
*/
void patch_ApplyPatches(void);
#endif // RGBDS_LINK_PATCH_H