Ticket #3258: t3258_missing_script_conversions_for_windows_v1.patch

File t3258_missing_script_conversions_for_windows_v1.patch, 1.2 KB (added by elexis, 9 years ago)

These script conversions are required by windows. Either we need to modify this patch so that it compiles on linux too, or I need to change the code so that it doesn't need them.

  • source/scriptinterface/ScriptConversions.cpp

    template<> void ScriptInterface::ToJSVal  
    266266template<> void ScriptInterface::ToJSVal<unsigned long>(JSContext* UNUSED(cx), JS::MutableHandleValue ret, const unsigned long& val)
    267267{
    268268    ret.set(JS::NumberValue((int)val));
    269269}
    270270
     271template<> void ScriptInterface::ToJSVal<time_t>(JSContext* UNUSED(cx), JS::MutableHandleValue ret, const time_t& val)
     272{
     273    ret.set(JS::NumberValue((int)val));
     274}
     275
     276template<> void ScriptInterface::ToJSVal<u64>(JSContext* UNUSED(cx), JS::MutableHandleValue ret, const u64& val)
     277{
     278    ret.set(JS::NumberValue((int)val));
     279}
     280
    271281// (s)size_t are considered to be identical to (unsigned) int by GCC and
    272282// their specializations would cause conflicts there. On x86_64 GCC, s/size_t
    273283// is equivalent to (unsigned) long, but the same solution applies; use the
    274284// long and unsigned long specializations instead of s/size_t.
    275285// for some reason, x64 MSC treats size_t as distinct from unsigned long: