php extension use php7_ext_wrapper.h

pull/10/head
yuqing 2016-02-15 11:35:54 +08:00
parent cfad73a8d5
commit 9f8acd52e9
2 changed files with 13 additions and 29 deletions

View File

@ -1,14 +1,4 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <php.h>
#ifdef ZTS
#include "TSRM.h"
#endif
#include <SAPI.h>
#include <php_ini.h>
#include "php7_ext_wrapper.h"
#include "ext/standard/info.h"
#include <zend_extensions.h>
#include <zend_exceptions.h>
@ -28,20 +18,6 @@
#define MINOR_VERSION 0
#define PATCH_VERSION 3
#if PHP_MAJOR_VERSION < 7
typedef int zend_size_t;
#define ZEND_RETURN_STRINGL(s, l, dup) RETURN_STRINGL(s, l, dup)
#define ZEND_RETURN_STRING(s, dup) RETURN_STRING(s, dup)
#define zend_add_index_string(z, index, value, dup) \
add_index_string(z, index, value, dup)
#else
typedef size_t zend_size_t;
#define ZEND_RETURN_STRINGL(s, l, dup) RETURN_STRINGL(s, l)
#define ZEND_RETURN_STRING(s, dup) RETURN_STRING(s)
#define zend_add_index_string(z, index, value, dup) \
add_index_string(z, index, value)
#endif
#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION < 3)
const zend_fcall_info empty_fcall_info = { 0, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0 };
#undef ZEND_BEGIN_ARG_INFO_EX

View File

@ -20,8 +20,9 @@
#if PHP_MAJOR_VERSION < 7
typedef int zend_size_t;
#define ZEND_RETURN_STRINGL_DUP(s, l) RETURN_STRINGL(s, l, 1)
#define ZEND_RETURN_STRINGL_EX(s, l, callback) \
#define ZEND_RETURN_STRING(s, dup) RETURN_STRING(s, dup)
#define ZEND_RETURN_STRINGL(s, l, dup) RETURN_STRINGL(s, l, dup)
#define ZEND_RETURN_STRINGL_CALLBACK(s, l, callback) \
do { \
RETVAL_STRINGL(s, l, 1); \
callback(s); /* generally for free the pointer */ \
@ -50,6 +51,9 @@ typedef int zend_size_t;
#define zend_add_assoc_bool_ex(z, key, key_len, b) \
add_assoc_bool_ex(z, key, key_len, b)
#define zend_add_index_string(z, index, value, dup) \
add_index_string(z, index, value, dup)
static inline int zend_hash_find_wrapper(HashTable *ht, char *key, int key_len,
zval **value)
{
@ -77,8 +81,9 @@ static inline int zend_get_configuration_directive_wrapper(char *name, int len,
#else
typedef size_t zend_size_t;
#define ZEND_RETURN_STRINGL_DUP(s, l) RETURN_STRINGL(s, l)
#define ZEND_RETURN_STRINGL_EX(s, l, callback) \
#define ZEND_RETURN_STRING(s, dup) RETURN_STRING(s)
#define ZEND_RETURN_STRINGL(s, l, dup) RETURN_STRINGL(s, l)
#define ZEND_RETURN_STRINGL_CALLBACK(s, l, callback) \
do { \
RETVAL_STRINGL(s, l); \
callback(s); \
@ -108,6 +113,9 @@ typedef size_t zend_size_t;
#define zend_add_assoc_bool_ex(z, key, key_len, b) \
add_assoc_bool_ex(z, key, key_len - 1, b)
#define zend_add_index_string(z, index, value, dup) \
add_index_string(z, index, value)
static inline int zend_hash_find_wrapper(HashTable *ht, char *key, int key_len,
zval **value)
{