diff --git a/libaegisub/include/libaegisub/access.h b/libaegisub/include/libaegisub/access.h index f956cc920..9916fa33e 100644 --- a/libaegisub/include/libaegisub/access.h +++ b/libaegisub/include/libaegisub/access.h @@ -24,9 +24,9 @@ enum Type { void Check(fs::path const& file, acs::Type); -inline void CheckFileRead(fs::path const& file) { Check(file, acs::FileRead); } -inline void CheckFileWrite(fs::path const& file) { Check(file, acs::FileWrite); } +static inline void CheckFileRead(fs::path const& file) { Check(file, acs::FileRead); } +static inline void CheckFileWrite(fs::path const& file) { Check(file, acs::FileWrite); } -inline void CheckDirRead(fs::path const& dir) { Check(dir, acs::DirRead); } -inline void CheckDirWrite(fs::path const& dir) { Check(dir, acs::DirWrite); } +static inline void CheckDirRead(fs::path const& dir) { Check(dir, acs::DirRead); } +static inline void CheckDirWrite(fs::path const& dir) { Check(dir, acs::DirWrite); } } } diff --git a/libaegisub/include/libaegisub/fs.h b/libaegisub/include/libaegisub/fs.h index 6dbeaf81b..e09711e93 100644 --- a/libaegisub/include/libaegisub/fs.h +++ b/libaegisub/include/libaegisub/fs.h @@ -166,8 +166,8 @@ namespace agi { template void GetAll(T& cont); }; - inline DirectoryIterator& begin(DirectoryIterator &it) { return it; } - inline DirectoryIterator end(DirectoryIterator &) { return DirectoryIterator(); } + static inline DirectoryIterator& begin(DirectoryIterator &it) { return it; } + static inline DirectoryIterator end(DirectoryIterator &) { return DirectoryIterator(); } template inline void DirectoryIterator::GetAll(T& cont) { diff --git a/libaegisub/include/libaegisub/split.h b/libaegisub/include/libaegisub/split.h index 43cf0284c..b2f968cbf 100644 --- a/libaegisub/include/libaegisub/split.h +++ b/libaegisub/include/libaegisub/split.h @@ -25,7 +25,7 @@ namespace agi { return boost::make_split_iterator(str, boost::token_finder([=](Char c) { return c == delim; })); } - inline std::string str(StringRange const& r) { + static inline std::string str(StringRange const& r) { return std::string(r.begin(), r.end()); } } diff --git a/libaegisub/include/libaegisub/util.h b/libaegisub/include/libaegisub/util.h index baeb1ab2e..3a5cd81e0 100644 --- a/libaegisub/include/libaegisub/util.h +++ b/libaegisub/include/libaegisub/util.h @@ -21,7 +21,10 @@ struct tm; namespace agi { namespace util { /// Clamp `b` to the range [`a`,`c`] - template inline T mid(T a, T b, T c) { return std::max(a, std::min(b, c)); } + template + static inline T mid(T a, T b, T c) { + return std::max(a, std::min(b, c)); + } bool try_parse(std::string const& str, double *out); bool try_parse(std::string const& str, int *out); diff --git a/src/compat.cpp b/src/compat.cpp index 1892eaa30..62ac07f04 100644 --- a/src/compat.cpp +++ b/src/compat.cpp @@ -19,3 +19,19 @@ wxArrayString to_wx(std::vector const& vec) { transform(vec.begin(), vec.end(), std::back_inserter(ret), (wxString (*)(std::string const&))to_wx); return ret; } + +wxColour to_wx(agi::Color color) { + return wxColour(color.r, color.g, color.b, 255 - color.a); +} + +wxString to_wx(std::string const& str) { + return wxString(str.c_str(), wxConvUTF8); +} + +agi::Color from_wx(wxColour color) { + return agi::Color(color.Red(), color.Green(), color.Blue(), 255 - color.Alpha()); +} + +std::string from_wx(wxString const& str) { + return std::string(str.utf8_str()); +} diff --git a/src/compat.h b/src/compat.h index f17a7bc4c..88c9c4b38 100644 --- a/src/compat.h +++ b/src/compat.h @@ -9,11 +9,11 @@ #include -inline wxColour to_wx(agi::Color color) { return wxColour(color.r, color.g, color.b, 255 - color.a); } -inline wxString to_wx(std::string const& str) { return wxString(str.c_str(), wxConvUTF8); } +wxColour to_wx(agi::Color color); +wxString to_wx(std::string const& str); wxArrayString to_wx(std::vector const& vec); -inline agi::Color from_wx(wxColour color) { return agi::Color(color.Red(), color.Green(), color.Blue(), 255 - color.Alpha()); } -inline std::string from_wx(wxString const& str) { return std::string(str.utf8_str()); } +agi::Color from_wx(wxColour color); +std::string from_wx(wxString const& str); wxArrayString lagi_MRU_wxAS(const char *list);