Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

fix for windows

  • Loading branch information...
commit 0b4f36123c3b56a0ce0c4b7a2e063f5899d520e5 1 parent 4c749c0
rashfael authored
7 binding.gyp
@@ -27,6 +27,13 @@
27 27 'GCC_ENABLE_CPP_EXCEPTIONS': 'YES'
28 28 }
29 29
  30 + }],
  31 + ['OS=="win"', {
  32 + 'msvs_settings': {
  33 + 'VCCLCompilerTool': {
  34 + 'CompileAs': 2
  35 + }
  36 + }
30 37 }]
31 38 ]
32 39 },
7 deps/msgpack/msgpack.gyp
@@ -28,6 +28,13 @@
28 28 'GCC_ENABLE_CPP_EXCEPTIONS': 'YES'
29 29 }
30 30
  31 + }],
  32 + ['OS=="win"', {
  33 + 'msvs_settings': {
  34 + 'VCCLCompilerTool': {
  35 + 'CompileAs': 2
  36 + }
  37 + }
31 38 }]
32 39 ]
33 40 },
2  src/msgpack.cc
@@ -142,7 +142,7 @@ v8_to_msgpack(Handle<Value> v8obj, msgpack_object *mo, msgpack_zone *mz,
142 142 mo->via.boolean = v8obj->BooleanValue();
143 143 } else if (v8obj->IsNumber()) {
144 144 double d = v8obj->NumberValue();
145   - if (trunc(d) != d) {
  145 + if (static_cast<double>(static_cast<int>(d)) != d) {
146 146 mo->type = MSGPACK_OBJECT_DOUBLE;
147 147 mo->via.dec = d;
148 148 } else if (d > 0) {

1 comment on commit 0b4f361

Maxwell Krohn

This is the commit that causes Issue #42. The problem is that -2^31-1 is packed as a double (since it passes the new test but fails the old). It should be packed as an int64.

Please sign in to comment.
Something went wrong with that request. Please try again.