mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
Use std::string_view for macro bodies (#1326)
This removes the last use of `strdup` This required making a lot of related pointers be `const`. That in turn conflicted with the need to `munmap()` a pointer eventually, which was similar to the need to eventually `free()` an `Expansion`'s contents, so I used the same solution of a `union`. That lets us normally use the `const` pointer for `const` correctness, and the non-`const` one for the not-really- mutating destruction cases.
This commit is contained in:
@@ -61,9 +61,9 @@ std::string *fstk_FindFile(char const *path);
|
||||
bool yywrap();
|
||||
void fstk_RunInclude(char const *path);
|
||||
void fstk_RunMacro(char const *macroName, MacroArgs *args);
|
||||
void fstk_RunRept(uint32_t count, int32_t reptLineNo, char *body, size_t size);
|
||||
void fstk_RunRept(uint32_t count, int32_t reptLineNo, char const *body, size_t size);
|
||||
void fstk_RunFor(char const *symName, int32_t start, int32_t stop, int32_t step,
|
||||
int32_t reptLineNo, char *body, size_t size);
|
||||
int32_t reptLineNo, char const *body, size_t size);
|
||||
void fstk_StopRept();
|
||||
bool fstk_Break();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user