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

@ -1,5 +1,10 @@
msgpack extension changelog
Version 0.3.4
-------------
* Support PHP 5.3.x version on Windows.
(note: NAN and Resource is failed)
Version 0.3.3
-------------
* Update msgpack header files.

View File

@ -1,9 +1,9 @@
// $Id$
// vim:ft=javascript
// If your extension references something external, use ARG_WITH
// ARG_WITH("msgpack", "for msgpack support", "no");
ARG_ENABLE("msgpack", "for msgpack support", "yes");
if (PHP_MSGPACK != "no") {
EXTENSION("msgpack", "msgpack.c msgpack_pack.c msgpack_unpack.c msgpack_class.c");
EXTENSION("msgpack", "msgpack.c", PHP_MSGPACK_SHARED, "");
ADD_SOURCES(configure_module_dirname, "msgpack_pack.c msgpack_unpack.c msgpack_class.c", "msgpack");
}

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

View File

@ -258,7 +258,7 @@ static zend_object_value php_msgpack_unpacker_new(
/* MessagePack */
static ZEND_METHOD(msgpack, __construct)
{
bool php_only = MSGPACK_G(php_only);
zend_bool php_only = MSGPACK_G(php_only);
MSGPACK_BASE_OBJECT;
if (zend_parse_parameters(
@ -369,7 +369,7 @@ static ZEND_METHOD(msgpack, unpacker)
/* MessagePackUnpacker */
static ZEND_METHOD(msgpack_unpacker, __construct)
{
bool php_only = MSGPACK_G(php_only);
zend_bool php_only = MSGPACK_G(php_only);
MSGPACK_UNPACKER_OBJECT;
if (zend_parse_parameters(

View File

@ -231,12 +231,12 @@ inline static void msgpack_serialize_class(
}
inline static void msgpack_serialize_array(
smart_str *buf, zval *val, HashTable *var_hash, bool object,
smart_str *buf, zval *val, HashTable *var_hash, zend_bool object,
char* class_name, zend_uint name_len, zend_bool incomplete_class TSRMLS_DC)
{
HashTable *ht;
size_t n;
bool hash = true;
zend_bool hash = 1;
if (object)
{
@ -283,12 +283,12 @@ inline static void msgpack_serialize_array(
else
{
msgpack_pack_array(buf, n);
hash = false;
hash = 0;
}
}
else if (n == 0)
{
hash = false;
hash = 0;
msgpack_pack_array(buf, n);
}
else
@ -367,8 +367,6 @@ inline static void msgpack_serialize_array(
Z_ARRVAL_PP(data)->nApplyCount++;
}
//php_var_dump(data, 1 TSRMLS_CC); //hoge
msgpack_serialize_zval(buf, *data, var_hash TSRMLS_CC);
if (Z_TYPE_PP(data) == IS_ARRAY)
@ -471,7 +469,7 @@ inline static void msgpack_serialize_object(
}
msgpack_serialize_array(
buf, val, var_hash, true,
buf, val, var_hash, 1,
class_name, name_len, incomplete_class TSRMLS_CC);
}
@ -541,7 +539,7 @@ void msgpack_serialize_zval(
break;
case IS_ARRAY:
msgpack_serialize_array(
buf, val, var_hash, false, NULL, 0, 0 TSRMLS_CC);
buf, val, var_hash, 0, NULL, 0, 0 TSRMLS_CC);
break;
case IS_OBJECT:
{

View File

@ -22,13 +22,13 @@ typedef struct
void *next;
} var_entries;
#define MSGPACK_UNSERIALIZE_ALLOC_STACK(_unpack) \
if (_unpack->deps <= 0) { \
*obj = _unpack->retval; \
msgpack_stack_push(_unpack->var_hash, obj, false); \
} else { \
ALLOC_INIT_ZVAL(*obj); \
msgpack_stack_push(_unpack->var_hash, obj, true); \
#define MSGPACK_UNSERIALIZE_ALLOC_STACK(_unpack) \
if (_unpack->deps <= 0) { \
*obj = _unpack->retval; \
msgpack_stack_push(_unpack->var_hash, obj, 0); \
} else { \
ALLOC_INIT_ZVAL(*obj); \
msgpack_stack_push(_unpack->var_hash, obj, 1); \
}
#define MSGPACK_UNSERIALIZE_ALLOC_VALUE(_unpack) \
@ -42,9 +42,8 @@ typedef struct
#define MSGPACK_UNSERIALIZE_FINISH_ITEM(_unpack, _count) \
msgpack_stack_pop(_unpack->var_hash, _count); \
long deps = _unpack->deps - 1; \
_unpack->stack[deps]--; \
if (_unpack->stack[deps] == 0) { \
_unpack->stack[_unpack->deps-1]--; \
if (_unpack->stack[_unpack->deps-1] == 0) { \
_unpack->deps--; \
}
@ -118,7 +117,7 @@ inline static int msgpack_var_access(
}
inline static void msgpack_stack_push(
php_unserialize_data_t *var_hashx, zval **rval, bool save)
php_unserialize_data_t *var_hashx, zval **rval, zend_bool save)
{
var_entries *var_hash, *prev = NULL;
@ -197,7 +196,7 @@ inline static zend_class_entry* msgpack_unserialize_class(
zval **container, char *class_name, size_t name_len)
{
zend_class_entry *ce, **pce;
bool incomplete_class = false;
zend_bool incomplete_class = 0;
zval *user_func, *retval_ptr, **args[1], *arg_func_name;
TSRMLS_FETCH();
@ -262,7 +261,7 @@ inline static zend_class_entry* msgpack_unserialize_class(
"it was called for", __FUNCTION__, class_name);
}
incomplete_class = true;
incomplete_class = 1;
ce = PHP_IC_ENTRY;
}
@ -299,7 +298,8 @@ void msgpack_unserialize_var_init(php_unserialize_data_t *var_hashx)
var_hashx->first_dtor = 0;
}
void msgpack_unserialize_var_destroy(php_unserialize_data_t *var_hashx, bool err)
void msgpack_unserialize_var_destroy(
php_unserialize_data_t *var_hashx, zend_bool err)
{
void *next;
long i;
@ -529,10 +529,12 @@ int msgpack_unserialize_map(
int msgpack_unserialize_map_item(
msgpack_unserialize_data *unpack, zval **container, zval *key, zval *val)
{
long deps;
TSRMLS_FETCH();
if (MSGPACK_G(php_only))
{
zend_class_entry *ce;
if (Z_TYPE_P(key) == IS_NULL)
{
unpack->type = MSGPACK_SERIALIZE_TYPE_NONE;
@ -556,7 +558,7 @@ int msgpack_unserialize_map_item(
}
else if (Z_TYPE_P(val) == IS_STRING)
{
zend_class_entry *ce = msgpack_unserialize_class(
ce = msgpack_unserialize_class(
container, Z_STRVAL_P(val), Z_STRLEN_P(val));
if (ce == NULL)
@ -575,7 +577,7 @@ int msgpack_unserialize_map_item(
{
unpack->type = MSGPACK_SERIALIZE_TYPE_NONE;
zend_class_entry *ce = msgpack_unserialize_class(
ce = msgpack_unserialize_class(
container, Z_STRVAL_P(key), Z_STRLEN_P(key));
if (ce == NULL)
@ -698,7 +700,7 @@ int msgpack_unserialize_map_item(
zval_ptr_dtor(&key);
msgpack_stack_pop(unpack->var_hash, 2);
long deps = unpack->deps - 1;
deps = unpack->deps - 1;
unpack->stack[deps]--;
if (unpack->stack[deps] == 0)
{

View File

@ -26,7 +26,7 @@ typedef struct {
void msgpack_unserialize_var_init(php_unserialize_data_t *var_hashx);
void msgpack_unserialize_var_destroy(
php_unserialize_data_t *var_hashx, bool err);
php_unserialize_data_t *var_hashx, zend_bool err);
void msgpack_unserialize_init(msgpack_unserialize_data *unpack);

View File

@ -10,11 +10,11 @@
<email>advect@gmail.com</email>
<active>yes</active>
</lead>
<date>2010-12-27</date>
<time>10:30:54</time>
<date>2010-12-28</date>
<time>15:40:02</time>
<version>
<release>0.3.3</release>
<api>0.3.3</api>
<release>0.3.4</release>
<api>0.3.4</api>
</version>
<stability>
<release>beta</release>
@ -32,17 +32,17 @@
<file md5sum="8cc392f13f5a89d033cf73e612377b95" name="config.m4" role="src" />
<file md5sum="712ddaf861db6e52a7cf4885c6eced70" name="config.w32" role="src" />
<file md5sum="c9216741b72004ddf1a1347398220433" name="msgpack.c" role="src" />
<file md5sum="55455423c25b0a13946809aa5345a160" name="msgpack_class.c" role="src" />
<file md5sum="1b97cb7ae1cb157115ba8df0b3331229" name="msgpack_class.c" role="src" />
<file md5sum="b8eadd32c3eafb67645bb4ffe16f687c" name="msgpack_class.h" role="src" />
<file md5sum="20c46a37124113e6f6a45df46e5496ba" name="msgpack_pack.c" role="src" />
<file md5sum="d08dda734f564bda69136293aac67c9f" name="msgpack_pack.c" role="src" />
<file md5sum="eae6797621ca53f8a7b0c2d9cb8a4d21" name="msgpack_pack.h" role="src" />
<file md5sum="b965b77a1732e78361a9037ad46ac976" name="msgpack_unpack.c" role="src" />
<file md5sum="57657b955720eedcad10c2e510f2c825" name="msgpack_unpack.h" role="src" />
<file md5sum="714bca7f7e5e1ef9e6d190e72ca04cad" name="php_msgpack.h" role="src" />
<file md5sum="163d17e17abc50915668c64145283049" name="msgpack_unpack.c" role="src" />
<file md5sum="1a31c49f353c8deec86affd1564909d1" name="msgpack_unpack.h" role="src" />
<file md5sum="9c3b5db959fbd5df57f2c2af8e69eaef" name="php_msgpack.h" role="src" />
<file md5sum="82079e9a298ecdda2122757ddfbf576e" name="msgpack/pack_define.h" role="src" />
<file md5sum="634c90d15cba0aa0cb0bd7f4fbef114d" name="msgpack/pack_template.h" role="src" />
<file md5sum="af3f5ca341be55d866fe151c45186d22" name="msgpack/pack_template.h" role="src" />
<file md5sum="09510085da29090ea0f3919c2e708f46" name="msgpack/unpack_define.h" role="src" />
<file md5sum="cf387b1971d55b529593fcbc7972ced4" name="msgpack/unpack_template.h" role="src" />
<file md5sum="61cd2025a8357329430154bd3e568be9" name="msgpack/unpack_template.h" role="src" />
<file md5sum="5eea4af1097495efab534b174c16d939" name="msgpack/sysdep.h" role="src" />
<file md5sum="2e346ebe243e8b770ed01f56d9f886ba" name="msgpack/version.h" role="src" />
<file md5sum="237eda031928a5546bdb92a34815830f" name="tests/001.phpt" role="test" />

View File

@ -3,7 +3,7 @@
Summary: PHP extension for interfacing with MessagePack
Name: php-msgpack
Version: 0.3.3
Version: 0.3.4
Release: 1%{?dist}
Source: php-msgpack-%{version}.tar.gz
License: New BSD License

View File

@ -2,7 +2,7 @@
#ifndef PHP_MSGPACK_H
#define PHP_MSGPACK_H
#define MSGPACK_EXTENSION_VERSION "0.3.3"
#define MSGPACK_EXTENSION_VERSION "0.3.4"
#include "ext/standard/php_smart_str.h"