mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 18:22:07 +00:00
- Since we have style rules to include foo.hpp at the top of its corresponding foo.cpp, this takes any headers included by foo.hpp as being also guaranteed for foo.cpp. - Use C-style <foo.h> instead of <cfoo>, since the latter only guarantees putting symbols in the `std` namespace, which we are not using for C functions (e.g. `printf` not `std::printf`). - Remove now-unused `__PRETTY_FUNCTION__` reporting
33 lines
657 B
C++
33 lines
657 B
C++
/* SPDX-License-Identifier: MIT */
|
|
|
|
#ifndef RGBDS_LINK_PATCH_H
|
|
#define RGBDS_LINK_PATCH_H
|
|
|
|
#include <deque>
|
|
#include <stdint.h>
|
|
#include <vector>
|
|
|
|
#include "linkdefs.hpp"
|
|
|
|
#include "link/section.hpp"
|
|
|
|
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;
|
|
};
|
|
|
|
/*
|
|
* Checks all assertions
|
|
* @return true if assertion failed
|
|
*/
|
|
void patch_CheckAssertions(std::deque<Assertion> &assertions);
|
|
|
|
/*
|
|
* Applies all SECTIONs' patches to them
|
|
*/
|
|
void patch_ApplyPatches();
|
|
|
|
#endif // RGBDS_LINK_PATCH_H
|