1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
From c6cc67b5721acf927d712267bebe9d5180e31fc1 Mon Sep 17 00:00:00 2001
From: Remi Collet <fedora@famillecollet.com>
Date: Sat, 26 Dec 2015 17:30:16 +0100
Subject: [PATCH] Fix PHP 7 / 32bits build
---
phongo_compat.h | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/phongo_compat.h b/phongo_compat.h
index da4aed1..adbf21c 100644
--- a/phongo_compat.h
+++ b/phongo_compat.h
@@ -99,7 +99,8 @@
int tmp_len; \
mongoc_log(MONGOC_LOG_LEVEL_WARNING, MONGOC_LOG_DOMAIN, "Integer overflow detected on your platform: %lld", value); \
tmp_len = spprintf(&tmp, 0, "%lld", value); \
- add_index_stringl(zval, index, tmp, tmp_len, 0); \
+ ADD_ASSOC_STRINGL(zval, index, tmp, tmp_len); \
+ efree(tmp); \
} else { \
add_index_long(zval, index, val); \
}
@@ -109,7 +110,8 @@
int tmp_len; \
mongoc_log(MONGOC_LOG_LEVEL_WARNING, MONGOC_LOG_DOMAIN, "Integer overflow detected on your platform: %lld", value); \
tmp_len = spprintf(&tmp, 0, "%lld", value); \
- add_assoc_stringl(zval, key, tmp, tmp_len, 0); \
+ ADD_ASSOC_STRINGL(zval, key, tmp, tmp_len); \
+ efree(tmp); \
} else { \
add_assoc_long(zval, key, value); \
}
From 236e1670e12e527fe0c3ca36fe9fe11b22af9e2b Mon Sep 17 00:00:00 2001
From: Remi Collet <fedora@famillecollet.com>
Date: Wed, 30 Dec 2015 17:53:38 +0100
Subject: [PATCH] PHPC-527: fix call to add_index_stringl
---
phongo_compat.h | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/phongo_compat.h b/phongo_compat.h
index adbf21c..b865b88 100644
--- a/phongo_compat.h
+++ b/phongo_compat.h
@@ -99,7 +99,7 @@
int tmp_len; \
mongoc_log(MONGOC_LOG_LEVEL_WARNING, MONGOC_LOG_DOMAIN, "Integer overflow detected on your platform: %lld", value); \
tmp_len = spprintf(&tmp, 0, "%lld", value); \
- ADD_ASSOC_STRINGL(zval, index, tmp, tmp_len); \
+ ADD_INDEX_STRINGL(zval, index, tmp, tmp_len); \
efree(tmp); \
} else { \
add_index_long(zval, index, val); \
@@ -167,6 +167,7 @@
# define ADD_ASSOC_ZVAL(_zv, _key, _value) add_assoc_zval(_zv, _key, _value);
# define ADD_ASSOC_NULL_EX(_zv, _key) add_assoc_null_ex(_zv, ZEND_STRL(_key));
# define ADD_ASSOC_BOOL_EX(_zv, _key, _value) add_assoc_bool_ex(_zv, ZEND_STRL(_key), _value);
+# define ADD_INDEX_STRINGL(_zv, _ind, _value, _len) add_index_stringl(_zv, _ind, _value, _len);
# define phongo_free_object_arg zend_object
# define phongo_zpp_char_len size_t
# define ZEND_HASH_APPLY_COUNT(ht) (ht)->u.v.nApplyCount
@@ -193,6 +194,7 @@
# define ADD_ASSOC_ZVAL(_zv, _key, _value) add_assoc_zval(_zv, _key, _value);
# define ADD_ASSOC_NULL_EX(_zv, _key) add_assoc_null_ex(_zv, ZEND_STRS(_key));
# define ADD_ASSOC_BOOL_EX(_zv, _key, _value) add_assoc_bool_ex(_zv, ZEND_STRS(_key), _value);
+# define ADD_INDEX_STRINGL(_zv, _ind, _value, _len) add_index_stringl(_zv, _ind, _value, _len, 0);
# define Z_PHPDATE_P(object) zend_object_store_get_object(object TSRMLS_CC)
# define Z_ISUNDEF(x) !x
# define phongo_free_object_arg void
|