From 806580ac2a6ce9b05c97e6306523a2fcd9d07173 Mon Sep 17 00:00:00 2001 From: zawz Date: Thu, 19 Nov 2020 16:53:41 +0100 Subject: [PATCH] Fix gcc compile bug due to external defined inline --- include/parse.hpp | 4 ---- src/generate.cpp | 13 +++++++++++++ 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/include/parse.hpp b/include/parse.hpp index 6577c2e..de5f722 100644 --- a/include/parse.hpp +++ b/include/parse.hpp @@ -23,10 +23,6 @@ std::string import_file(std::string const& path); -bool is_num(char c); -bool is_alpha(char c); -bool is_alphanum(char c); - shmain* parse_text(const char* in, uint32_t size, std::string const& filename=""); inline shmain* parse_text(std::string const& in, std::string const& filename="") { return parse_text(in.c_str(), in.size(), filename); } inline shmain* parse(std::string const& file) { return parse_text(import_file(file), file); } diff --git a/src/generate.cpp b/src/generate.cpp index ee135ee..e665518 100644 --- a/src/generate.cpp +++ b/src/generate.cpp @@ -6,6 +6,19 @@ #include "options.hpp" #include "parse.hpp" +inline bool is_num(char c) +{ + return (c >= '0' && c <= '9'); +} +inline bool is_alpha(char c) +{ + return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'); +} +inline bool is_alphanum(char c) +{ + return is_alpha(c) || is_num(c); +} + bool is_sub_special_cmd(std::string in) { return in == "%include_sub" || in == "%resolve_sub";