msgpack 0.4.6-mswin32 → 0.4.7-mswin32

Sign up to get free protection for your applications and to get access to all the features.
data/ext/extconf.rb CHANGED
@@ -1,5 +1,7 @@
1
1
  require 'mkmf'
2
2
  require './version.rb'
3
3
  $CFLAGS << %[ -I.. -Wall -O3 -DMESSAGEPACK_VERSION=\\"#{MessagePack::VERSION}\\" -g]
4
+ have_header("ruby/st.h")
5
+ have_header("st.h")
4
6
  create_makefile('msgpack')
5
7
 
data/ext/pack.c CHANGED
@@ -15,6 +15,7 @@
15
15
  * See the License for the specific language governing permissions and
16
16
  * limitations under the License.
17
17
  */
18
+ #define RSTRING_NOT_MODIFIED
18
19
  #include "ruby.h"
19
20
  #include "compat.h"
20
21
 
@@ -39,8 +40,10 @@ static ID s_append;
39
40
  #include "msgpack/pack_template.h"
40
41
 
41
42
 
42
- #ifndef RUBY_VM
43
- #include "st.h" // ruby hash
43
+ #if defined(HAVE_RUBY_ST_H)
44
+ #include "ruby/st.h" // ruby hash on Ruby 1.9
45
+ #elif defined(HAVE_ST_H)
46
+ #include "st.h" // ruby hash on Ruby 1.8
44
47
  #endif
45
48
 
46
49
  #define ARG_BUFFER(name, argc, argv) \
@@ -219,11 +222,12 @@ static VALUE MessagePack_Array_to_msgpack(int argc, VALUE *argv, VALUE self)
219
222
  {
220
223
  ARG_BUFFER(out, argc, argv);
221
224
  // FIXME check sizeof(long) > sizeof(unsigned int) && RARRAY_LEN(self) > UINT_MAX
222
- msgpack_pack_array(out, (unsigned int)RARRAY_LEN(self));
223
- VALUE* p = RARRAY_PTR(self);
224
- VALUE* const pend = p + RARRAY_LEN(self);
225
- for(;p != pend; ++p) {
226
- rb_funcall(*p, s_to_msgpack, 1, out);
225
+ unsigned int ary_length = (unsigned int)RARRAY_LEN(self);
226
+ unsigned int i = 0;
227
+ msgpack_pack_array(out, ary_length);
228
+ for(; i < ary_length; ++i) {
229
+ VALUE p = rb_ary_entry(self, i);
230
+ rb_funcall(p, s_to_msgpack, 1, out);
227
231
  }
228
232
  return out;
229
233
  }
data/ext/unpack.c CHANGED
@@ -112,7 +112,7 @@ static inline int template_callback_array(unpack_user* u, unsigned int n, VALUE*
112
112
  { *o = rb_ary_new2(n); return 0; }
113
113
 
114
114
  static inline int template_callback_array_item(unpack_user* u, VALUE* c, VALUE o)
115
- { rb_ary_push(*c, o); return 0; } // FIXME set value directry RARRAY_PTR(obj)[RARRAY_LEN(obj)++]
115
+ { rb_ary_push(*c, o); return 0; }
116
116
 
117
117
  static inline int template_callback_map(unpack_user* u, unsigned int n, VALUE* o)
118
118
  { *o = rb_hash_new(); return 0; }
data/ext/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module MessagePack
2
- VERSION = "0.4.6"
2
+ VERSION = "0.4.7"
3
3
  end
data/lib/1.8/msgpack.so CHANGED
Binary file
data/lib/1.9/msgpack.so CHANGED
Binary file
@@ -646,7 +646,12 @@ msgpack_pack_inline_func(_double)(msgpack_pack_user x, double d)
646
646
  union { double f; uint64_t i; } mem;
647
647
  mem.f = d;
648
648
  unsigned char buf[9];
649
- buf[0] = 0xcb; _msgpack_store64(&buf[1], mem.i);
649
+ buf[0] = 0xcb;
650
+ #if defined(__arm__) && !(__ARM_EABI__) // arm-oabi
651
+ // https://github.com/msgpack/msgpack-perl/pull/1
652
+ mem.i = (mem.i & 0xFFFFFFFFUL) << 32UL | (mem.i >> 32UL);
653
+ #endif
654
+ _msgpack_store64(&buf[1], mem.i);
650
655
  msgpack_pack_append_buffer(x, buf, 9);
651
656
  }
652
657
 
data/msgpack/sysdep.h CHANGED
@@ -153,24 +153,24 @@ typedef unsigned int _msgpack_atomic_counter_t;
153
153
  #define _msgpack_be64(x) (x)
154
154
 
155
155
  #define _msgpack_load16(cast, from) ((cast)( \
156
- (((uint16_t)((uint8_t*)from)[1]) << 8) | \
157
- (((uint16_t)((uint8_t*)from)[0]) ) ))
156
+ (((uint16_t)((uint8_t*)from)[0]) << 8) | \
157
+ (((uint16_t)((uint8_t*)from)[1]) ) ))
158
158
 
159
159
  #define _msgpack_load32(cast, from) ((cast)( \
160
- (((uint32_t)((uint8_t*)from)[3]) << 24) | \
161
- (((uint32_t)((uint8_t*)from)[2]) << 16) | \
162
- (((uint32_t)((uint8_t*)from)[1]) << 8) | \
163
- (((uint32_t)((uint8_t*)from)[0]) ) ))
160
+ (((uint32_t)((uint8_t*)from)[0]) << 24) | \
161
+ (((uint32_t)((uint8_t*)from)[1]) << 16) | \
162
+ (((uint32_t)((uint8_t*)from)[2]) << 8) | \
163
+ (((uint32_t)((uint8_t*)from)[3]) ) ))
164
164
 
165
165
  #define _msgpack_load64(cast, from) ((cast)( \
166
- (((uint64_t)((uint8_t*)from)[7]) << 56) | \
167
- (((uint64_t)((uint8_t*)from)[6]) << 48) | \
168
- (((uint64_t)((uint8_t*)from)[5]) << 40) | \
169
- (((uint64_t)((uint8_t*)from)[4]) << 32) | \
170
- (((uint64_t)((uint8_t*)from)[3]) << 24) | \
171
- (((uint64_t)((uint8_t*)from)[2]) << 16) | \
172
- (((uint64_t)((uint8_t*)from)[1]) << 8) | \
173
- (((uint64_t)((uint8_t*)from)[0]) ) ))
166
+ (((uint64_t)((uint8_t*)from)[0]) << 56) | \
167
+ (((uint64_t)((uint8_t*)from)[1]) << 48) | \
168
+ (((uint64_t)((uint8_t*)from)[2]) << 40) | \
169
+ (((uint64_t)((uint8_t*)from)[3]) << 32) | \
170
+ (((uint64_t)((uint8_t*)from)[4]) << 24) | \
171
+ (((uint64_t)((uint8_t*)from)[5]) << 16) | \
172
+ (((uint64_t)((uint8_t*)from)[6]) << 8) | \
173
+ (((uint64_t)((uint8_t*)from)[7]) ) ))
174
174
  #endif
175
175
 
176
176
 
@@ -263,6 +263,10 @@ msgpack_unpack_func(int, _execute)(msgpack_unpack_struct(_context)* ctx, const c
263
263
  case CS_DOUBLE: {
264
264
  union { uint64_t i; double f; } mem;
265
265
  mem.i = _msgpack_load64(uint64_t,n);
266
+ #if defined(__arm__) && !(__ARM_EABI__) // arm-oabi
267
+ // https://github.com/msgpack/msgpack-perl/pull/1
268
+ mem.i = (mem.i & 0xFFFFFFFFUL) << 32UL | (mem.i >> 32UL);
269
+ #endif
266
270
  push_fixed_value(_double, mem.f); }
267
271
  case CS_UINT_8:
268
272
  push_fixed_value(_uint8, *(uint8_t*)n);
metadata CHANGED
@@ -1,13 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: msgpack
3
3
  version: !ruby/object:Gem::Version
4
- hash: 3
5
- prerelease: false
4
+ hash: 1
6
5
  segments:
7
6
  - 0
8
7
  - 4
9
- - 6
10
- version: 0.4.6
8
+ - 7
9
+ version: 0.4.7
11
10
  platform: mswin32
12
11
  authors:
13
12
  - FURUHASHI Sadayuki
@@ -15,8 +14,7 @@ autorequire:
15
14
  bindir: bin
16
15
  cert_chain: []
17
16
 
18
- date: 2011-08-09 00:00:00 +09:00
19
- default_executable:
17
+ date: 2012-05-06 00:00:00 Z
20
18
  dependencies: []
21
19
 
22
20
  description:
@@ -51,7 +49,6 @@ files:
51
49
  - test/test_encoding.rb
52
50
  - test/test_helper.rb
53
51
  - test/test_pack_unpack.rb
54
- has_rdoc: true
55
52
  homepage: http://msgpack.org/
56
53
  licenses: []
57
54
 
@@ -81,7 +78,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
81
78
  requirements: []
82
79
 
83
80
  rubyforge_project: msgpack
84
- rubygems_version: 1.3.6
81
+ rubygems_version: 1.8.16
85
82
  signing_key:
86
83
  specification_version: 3
87
84
  summary: MessagePack, a binary-based efficient data interchange format.