mirror of
https://github.com/gbdev/rgbds.git
synced 2026-10-05 19:56:18 +00:00
Merge branch 'master' into features-1.1.0
This commit is contained in:
commit
9b7d4bf613
17 files changed
+500
-404
No files matched your search
@@ -18,7 +18,7 @@ enum StateFeature { STATE_EQU, STATE_VAR, STATE_EQUS, STATE_CHAR, STATE_MACRO, N
|
||||
|
||||
void out_RegisterNode(std::shared_ptr<FileStackNode> node);
|
||||
void out_RegisterSymbol(Symbol &sym);
|
||||
void out_CreatePatch(uint32_t type, Expression const &expr, uint32_t ofs, uint32_t pcShift);
|
||||
void out_CreatePatch(PatchType type, Expression const &expr, uint32_t ofs, uint32_t pcShift);
|
||||
void out_CreateAssert(
|
||||
AssertionType type, Expression const &expr, std::string const &message, uint32_t ofs
|
||||
);
|
||||
|
||||
@@ -24,7 +24,7 @@ struct Patch {
|
||||
uint32_t offset;
|
||||
Section *pcSection;
|
||||
uint32_t pcOffset;
|
||||
uint8_t type;
|
||||
PatchType type;
|
||||
std::vector<uint8_t> rpn;
|
||||
};
|
||||
|
||||
|
||||
@@ -11,10 +11,12 @@
|
||||
struct Symbol;
|
||||
|
||||
struct Assertion {
|
||||
Patch patch; // Also used for its `.type`
|
||||
Expression rpn;
|
||||
uint32_t offset;
|
||||
AssertionType type;
|
||||
std::string message;
|
||||
// This would be redundant with `patch.pcSection->fileSymbols`, but `section` is sometimes
|
||||
// `nullptr`!
|
||||
// This would be redundant with `rpn.pcSection->fileSymbols`,
|
||||
// but `rpn.pcSection` is sometimes `nullptr`!
|
||||
std::vector<Symbol> *fileSymbols;
|
||||
};
|
||||
|
||||
|
||||
@@ -15,15 +15,19 @@ struct FileStackNode;
|
||||
struct Section;
|
||||
struct Symbol;
|
||||
|
||||
struct Patch {
|
||||
struct Expression {
|
||||
FileStackNode const *src;
|
||||
uint32_t lineNo;
|
||||
uint32_t offset;
|
||||
Section const *pcSection;
|
||||
uint32_t pcSectionID;
|
||||
uint32_t pcOffset;
|
||||
std::vector<uint8_t> rpn;
|
||||
};
|
||||
|
||||
struct Patch {
|
||||
Expression rpn;
|
||||
uint32_t offset;
|
||||
PatchType type;
|
||||
std::vector<uint8_t> rpnExpression;
|
||||
};
|
||||
|
||||
struct Section {
|
||||
|
||||
@@ -67,6 +67,13 @@
|
||||
#define setmode(fd, mode) (0)
|
||||
#endif
|
||||
|
||||
// Windows has 32-bit `long`, which limits `fseek` and `ftell` to 2 GiB
|
||||
#if defined(_MSC_VER) || defined(__MINGW32__)
|
||||
#include <stdio.h> // IWYU pragma: export
|
||||
#define fseek _fseeki64
|
||||
#define ftell _ftelli64
|
||||
#endif
|
||||
|
||||
// Apple has deprecated `sprintf` since Xcode 14 (for macOS 13), but we use it solely in
|
||||
// contexts where both the size of the buffer *and* max size of the printed string are
|
||||
// known statically, which GCC thus checks for.
|
||||
|
||||
Reference in new issue
Block a user