mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 18:22:07 +00:00
Make failedOnMissingInclude not extern
This commit is contained in:
@@ -58,6 +58,7 @@ void fstk_AddIncludePath(std::string const &path);
|
|||||||
void fstk_AddPreIncludeFile(std::string const &path);
|
void fstk_AddPreIncludeFile(std::string const &path);
|
||||||
std::optional<std::string> fstk_FindFile(std::string const &path);
|
std::optional<std::string> fstk_FindFile(std::string const &path);
|
||||||
bool fstk_FileError(std::string const &path, char const *functionName);
|
bool fstk_FileError(std::string const &path, char const *functionName);
|
||||||
|
bool fstk_FailedOnMissingInclude();
|
||||||
|
|
||||||
bool yywrap();
|
bool yywrap();
|
||||||
bool fstk_RunInclude(std::string const &path);
|
bool fstk_RunInclude(std::string const &path);
|
||||||
|
|||||||
@@ -41,7 +41,6 @@ struct Options {
|
|||||||
};
|
};
|
||||||
|
|
||||||
extern Options options;
|
extern Options options;
|
||||||
extern bool failedOnMissingInclude;
|
|
||||||
|
|
||||||
#define verbosePrint(...) \
|
#define verbosePrint(...) \
|
||||||
do { \
|
do { \
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ static std::stack<Context> contextStack;
|
|||||||
// The first include path for `fstk_FindFile` to try is none at all
|
// The first include path for `fstk_FindFile` to try is none at all
|
||||||
static std::vector<std::string> includePaths = {""}; // -I
|
static std::vector<std::string> includePaths = {""}; // -I
|
||||||
static std::deque<std::string> preIncludeNames; // -P
|
static std::deque<std::string> preIncludeNames; // -P
|
||||||
|
static bool failedOnMissingInclude = false;
|
||||||
|
|
||||||
std::string FileStackNode::reptChain() const {
|
std::string FileStackNode::reptChain() const {
|
||||||
std::string chain;
|
std::string chain;
|
||||||
@@ -317,6 +318,10 @@ bool fstk_FileError(std::string const &path, char const *functionName) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool fstk_FailedOnMissingInclude() {
|
||||||
|
return failedOnMissingInclude;
|
||||||
|
}
|
||||||
|
|
||||||
bool fstk_RunInclude(std::string const &path) {
|
bool fstk_RunInclude(std::string const &path) {
|
||||||
if (std::optional<std::string> fullPath = fstk_FindFile(path); fullPath) {
|
if (std::optional<std::string> fullPath = fstk_FindFile(path); fullPath) {
|
||||||
newFileContext(*fullPath, false);
|
newFileContext(*fullPath, false);
|
||||||
|
|||||||
@@ -26,8 +26,6 @@
|
|||||||
|
|
||||||
Options options;
|
Options options;
|
||||||
|
|
||||||
bool failedOnMissingInclude = false;
|
|
||||||
|
|
||||||
// Escapes Make-special chars from a string
|
// Escapes Make-special chars from a string
|
||||||
static std::string make_escape(std::string &str) {
|
static std::string make_escape(std::string &str) {
|
||||||
std::string escaped;
|
std::string escaped;
|
||||||
@@ -424,7 +422,7 @@ int main(int argc, char *argv[]) {
|
|||||||
nbErrors = 1;
|
nbErrors = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!failedOnMissingInclude) {
|
if (!fstk_FailedOnMissingInclude()) {
|
||||||
sect_CheckUnionClosed();
|
sect_CheckUnionClosed();
|
||||||
sect_CheckLoadClosed();
|
sect_CheckLoadClosed();
|
||||||
sect_CheckSizes();
|
sect_CheckSizes();
|
||||||
@@ -440,7 +438,7 @@ int main(int argc, char *argv[]) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// If parse aborted due to missing an include, and `-MG` was given, exit normally
|
// If parse aborted due to missing an include, and `-MG` was given, exit normally
|
||||||
if (failedOnMissingInclude) {
|
if (fstk_FailedOnMissingInclude()) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user