Files
rgbds/include/link/patch.hpp
Sylvie 17444e825a Reduce the header declarations (#1342)
- 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
2024-03-09 14:55:39 -05:00

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