php: version 0.3.4: supported Windows building

This commit is contained in:
advect
2010-12-28 16:09:13 +09:00
parent 0acf6ec150
commit 9e096a3f0e
11 changed files with 56 additions and 48 deletions

View File

@@ -635,8 +635,8 @@ if(sizeof(unsigned long long) == 2) {
msgpack_pack_inline_func(_float)(msgpack_pack_user x, float d)
{
union { float f; uint32_t i; } mem;
mem.f = d;
unsigned char buf[5];
mem.f = d;
buf[0] = 0xca; _msgpack_store32(&buf[1], mem.i);
msgpack_pack_append_buffer(x, buf, 5);
}
@@ -644,8 +644,8 @@ msgpack_pack_inline_func(_float)(msgpack_pack_user x, float d)
msgpack_pack_inline_func(_double)(msgpack_pack_user x, double d)
{
union { double f; uint64_t i; } mem;
mem.f = d;
unsigned char buf[9];
mem.f = d;
buf[0] = 0xcb; _msgpack_store64(&buf[1], mem.i);
msgpack_pack_append_buffer(x, buf, 9);
}

View File

@@ -96,7 +96,9 @@ msgpack_unpack_func(msgpack_unpack_object, _data)(msgpack_unpack_struct(_context
msgpack_unpack_func(int, _execute)(msgpack_unpack_struct(_context)* ctx, const char* data, size_t len, size_t* off)
{
#ifndef _MSC_VER
assert(len >= *off);
#endif
const unsigned char* p = (unsigned char*)data + *off;
const unsigned char* const pe = (unsigned char*)data + len;
@@ -105,6 +107,9 @@ msgpack_unpack_func(int, _execute)(msgpack_unpack_struct(_context)* ctx, const c
unsigned int trail = ctx->trail;
unsigned int cs = ctx->cs;
unsigned int top = ctx->top;
int ret;
msgpack_unpack_struct(_stack)* stack = ctx->stack;
/*
unsigned int stack_size = ctx->stack_size;
@@ -114,8 +119,6 @@ msgpack_unpack_func(int, _execute)(msgpack_unpack_struct(_context)* ctx, const c
msgpack_unpack_object obj;
msgpack_unpack_struct(_stack)* c = NULL;
int ret;
#define push_simple_value(func) \
if(msgpack_unpack_callback(func)(user, &obj) < 0) { goto _failed; } \
goto _push