mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
Make some changes noticed while porting to C++
This commit is contained in:
@@ -11,6 +11,11 @@
|
||||
|
||||
#include "asm/lexer.h"
|
||||
|
||||
enum FileStackNodeType {
|
||||
NODE_REPT,
|
||||
NODE_FILE,
|
||||
NODE_MACRO,
|
||||
};
|
||||
|
||||
struct FileStackNode {
|
||||
struct FileStackNode *parent; // Pointer to parent node, for error reporting
|
||||
@@ -21,11 +26,7 @@ struct FileStackNode {
|
||||
bool referenced; // If referenced, don't free!
|
||||
uint32_t ID; // Set only if referenced: ID within the object file, -1 if not output yet
|
||||
|
||||
enum {
|
||||
NODE_REPT,
|
||||
NODE_FILE,
|
||||
NODE_MACRO,
|
||||
} type;
|
||||
enum FileStackNodeType type;
|
||||
};
|
||||
|
||||
struct FileStackReptNode { // NODE_REPT
|
||||
|
||||
@@ -11,8 +11,8 @@ void opt_G(char const chars[4]);
|
||||
void opt_P(uint8_t padByte);
|
||||
void opt_Q(uint8_t precision);
|
||||
void opt_L(bool optimize);
|
||||
void opt_W(char const *flag);
|
||||
void opt_Parse(char const *option);
|
||||
void opt_W(char *flag);
|
||||
void opt_Parse(char *option);
|
||||
|
||||
void opt_Push(void);
|
||||
void opt_Pop(void);
|
||||
|
||||
@@ -38,9 +38,9 @@ struct SectionSpec {
|
||||
extern struct Section *currentSection;
|
||||
|
||||
struct Section *sect_FindSectionByName(char const *name);
|
||||
void sect_NewSection(char const *name, uint32_t secttype, uint32_t org,
|
||||
void sect_NewSection(char const *name, enum SectionType type, uint32_t org,
|
||||
struct SectionSpec const *attributes, enum SectionModifier mod);
|
||||
void sect_SetLoadSection(char const *name, uint32_t secttype, uint32_t org,
|
||||
void sect_SetLoadSection(char const *name, enum SectionType type, uint32_t org,
|
||||
struct SectionSpec const *attributes, enum SectionModifier mod);
|
||||
void sect_EndLoadSection(void);
|
||||
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
#include <tuple>
|
||||
#include <utility>
|
||||
|
||||
#include "platform.h" // __PRETTY_FUNCTION__
|
||||
|
||||
template<typename... Ts>
|
||||
static inline void report() {
|
||||
puts(__PRETTY_FUNCTION__);
|
||||
|
||||
@@ -27,16 +27,18 @@ extern bool beVerbose;
|
||||
extern bool isWRA0Mode;
|
||||
extern bool disablePadding;
|
||||
|
||||
enum FileStackNodeType {
|
||||
NODE_REPT,
|
||||
NODE_FILE,
|
||||
NODE_MACRO,
|
||||
};
|
||||
|
||||
struct FileStackNode {
|
||||
struct FileStackNode *parent;
|
||||
// Line at which the parent context was exited; meaningless for the root level
|
||||
uint32_t lineNo;
|
||||
|
||||
enum {
|
||||
NODE_REPT,
|
||||
NODE_FILE,
|
||||
NODE_MACRO,
|
||||
} type;
|
||||
enum FileStackNodeType type;
|
||||
union {
|
||||
char *name; // NODE_FILE, NODE_MACRO
|
||||
struct { // NODE_REPT
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#define RGBDS_LINK_SCRIPT_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "linkdefs.h"
|
||||
|
||||
extern FILE * linkerScript;
|
||||
|
||||
@@ -27,6 +27,15 @@
|
||||
# define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR)
|
||||
#endif
|
||||
|
||||
// gcc has __PRETTY_FUNCTION__, MSVC has __FUNCSIG__, __func__ is standard
|
||||
#ifndef __PRETTY_FUNCTION__
|
||||
# ifdef __FUNCSIG__
|
||||
# define __PRETTY_FUNCTION__ __FUNCSIG__
|
||||
# else
|
||||
# define __PRETTY_FUNCTION__ __func__
|
||||
# endif
|
||||
#endif
|
||||
|
||||
// MSVC doesn't use POSIX types or defines for `read`
|
||||
#ifdef _MSC_VER
|
||||
# include <io.h>
|
||||
|
||||
Reference in New Issue
Block a user