From 6de715557efdd6841436d135d2f143d19dc88b1d Mon Sep 17 00:00:00 2001 From: "Carl Miller, Jr" <19718484+halian@users.noreply.github.com> Date: Mon, 15 Feb 2021 02:25:47 -0500 Subject: [PATCH] added fixes that close twanvl's #105 and #107 --- src/util/io/get_member.cpp | 1 + src/util/prec.hpp | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/src/util/io/get_member.cpp b/src/util/io/get_member.cpp index eba0c8ad..51d00ce2 100644 --- a/src/util/io/get_member.cpp +++ b/src/util/io/get_member.cpp @@ -29,6 +29,7 @@ template <> void GetDefaultMember::handle(const Color& v) { value = to_sc template <> void GetDefaultMember::handle(const wxDateTime& v) { value = to_script(v); } void GetDefaultMember::handle(const ScriptValueP& v) { value = v; } void GetDefaultMember::handle(const ScriptP& v) { value = v; } +template <> void GetDefaultMember::handle(const unsigned long& v) { value = to_script((int)v); } // ----------------------------------------------------------------------------- : GetMember diff --git a/src/util/prec.hpp b/src/util/prec.hpp index c142e350..7e60b10c 100644 --- a/src/util/prec.hpp +++ b/src/util/prec.hpp @@ -106,3 +106,11 @@ typedef unsigned int UInt; #define assert(exp) (void)( (exp) || (msvc_assert(nullptr, _CRT_WIDE(#exp), _CRT_WIDE(__FILE__), __LINE__), 0) ) #endif +#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