diff --git a/README.md b/README.md index abef17ad..9992feda 100644 --- a/README.md +++ b/README.md @@ -74,8 +74,9 @@ sudo apt install libboost-dev libwxgtk3.0-gtk3-dev libhunspell-dev Then use cmake to build ```` -cmake build -DCMAKE_BUILD_TYPE=Release -cmake --build build +mkdir build && cd build +cmake -DCMAKE_BUILD_TYPE=Release .. +cmake --build . ```` Use `CMAKE_BUILD_TYPE=Debug` for a debug build diff --git a/src/gui/update_checker.cpp b/src/gui/update_checker.cpp index a921d12c..3b1c2570 100644 --- a/src/gui/update_checker.cpp +++ b/src/gui/update_checker.cpp @@ -92,7 +92,9 @@ bool update_available() { class CheckUpdateThread : public wxThread { public: void* Entry() override { - Work(); + #ifndef __APPLE__ + Work(); + #endif return 0; } diff --git a/src/util/io/get_member.cpp b/src/util/io/get_member.cpp index eba0c8ad..e3a31fbc 100644 --- a/src/util/io/get_member.cpp +++ b/src/util/io/get_member.cpp @@ -27,6 +27,9 @@ template <> void GetDefaultMember::handle(const tribool& v) { value = to_sc template <> void GetDefaultMember::handle(const Vector2D& v) { value = to_script(String::Format(_("(%.10lf,%.10lf)"), v.x, v.y)); } template <> void GetDefaultMember::handle(const Color& v) { value = to_script(v); } template <> void GetDefaultMember::handle(const wxDateTime& v) { value = to_script(v); } +#ifdef __APPLE__ + template <> void GetDefaultMember::handle(const unsigned long& v) { value = to_script((int)v); } +#endif void GetDefaultMember::handle(const ScriptValueP& v) { value = v; } void GetDefaultMember::handle(const ScriptP& v) { value = v; } diff --git a/src/util/io/reader.hpp b/src/util/io/reader.hpp index d3058166..d3482254 100644 --- a/src/util/io/reader.hpp +++ b/src/util/io/reader.hpp @@ -10,6 +10,9 @@ #include #include +#ifdef __APPLE__ + #include +#endif template class Defaultable; template class Scriptable; diff --git a/src/util/io/writer.hpp b/src/util/io/writer.hpp index 5efb8130..7a223637 100644 --- a/src/util/io/writer.hpp +++ b/src/util/io/writer.hpp @@ -10,6 +10,9 @@ #include #include +#ifdef __APPLE__ + #include +#endif template class Defaultable; template class Scriptable; diff --git a/src/util/prec.hpp b/src/util/prec.hpp index c142e350..dac98cbd 100644 --- a/src/util/prec.hpp +++ b/src/util/prec.hpp @@ -106,3 +106,13 @@ typedef unsigned int UInt; #define assert(exp) (void)( (exp) || (msvc_assert(nullptr, _CRT_WIDE(#exp), _CRT_WIDE(__FILE__), __LINE__), 0) ) #endif +#ifdef __APPLE__ + #if wxVERSION_NUMBER < 3100 + // wx <= 3.1 doesn't include a hash implementation for wxString + template <> struct std::hash { + size_t operator()(const wxString& k) const { + return hash()(k.ToStdWstring()); + } + }; + #endif +#endif