Add assertions

Closes #292
This commit is contained in:
ISSOtm
2020-03-05 02:58:48 +01:00
parent 03967bd623
commit fb58166e5d
18 changed files with 506 additions and 82 deletions

View File

@@ -10,6 +10,28 @@
#ifndef RGBDS_LINK_PATCH_H
#define RGBDS_LINK_PATCH_H
#include <stdbool.h>
#include <stdint.h>
#include "link/section.h"
#include "linkdefs.h"
struct Assertion {
struct Patch patch;
// enum AssertionType type; The `patch`'s field is instead re-used
struct Section *section;
char *message;
struct Assertion *next;
};
/**
* Checks all assertions
* @return true if assertion failed
*/
void patch_CheckAssertions(struct Assertion *assertion);
/**
* Applies all SECTIONs' patches to them
*/