mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-21 02:32: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:
@@ -14,11 +14,6 @@
|
||||
# include <strings.h>
|
||||
#endif
|
||||
|
||||
// MSVC has deprecated strdup in favor of _strdup
|
||||
#ifdef _MSC_VER
|
||||
# define strdup _strdup
|
||||
#endif
|
||||
|
||||
// MSVC prefixes the names of S_* macros with underscores,
|
||||
// and doesn't define any S_IS* macros; define them ourselves
|
||||
#ifdef _MSC_VER
|
||||
|
||||
Reference in New Issue
Block a user