Browse Source

fix build for <=PHP_5_2, optimize dirname call

git-svn-id: svn://svn.lighttpd.net/xcache/trunk@847 c26eb9a1-5813-0410-bd6c-c2e55f420ca7
3.0
Xuefer 9 years ago
parent
commit
9579c77164
  1. 5
      optimizer.c
  2. 9
      utils.c
  3. 6
      utils.h
  4. 2
      xcache.c

5
optimizer.c

@ -104,7 +104,10 @@ static int op_array_convert_switch(zend_op_array *op_array) /* {{{ */
switch (brk_opline->opcode) {
case ZEND_SWITCH_FREE:
case ZEND_FREE:
if (!(brk_opline->extended_value & EXT_TYPE_FREE_ON_RETURN)) {
#ifdef EXT_TYPE_FREE_ON_RETURN
if (!(brk_opline->extended_value & EXT_TYPE_FREE_ON_RETURN))
#endif
{
can_convert = 0;
}
break;

9
utils.c

@ -969,14 +969,19 @@ int xc_trace(const char *fmt, ...) /* {{{ */
/* }}} */
#ifndef ZEND_ENGINE_2_3
size_t zend_dirname(char *path, size_t len) /* {{{ */
#include "ext/standard/php_string.h"
size_t xc_dirname(char *path, size_t len) /* {{{ */
{
#ifdef ZEND_ENGINE_2
return php_dirname(path, len);
#else
php_dirname(path, len);
return strlen(path);
#endif
}
/* }}} */
long zend_atol(const char *str, int str_len) /* {{{ */
long xc_atol(const char *str, int str_len) /* {{{ */
{
long retval;

6
utils.h

@ -134,8 +134,10 @@ void xc_copy_internal_zend_constants(HashTable *target, HashTable *source);
#endif
#ifndef ZEND_ENGINE_2_3
size_t zend_dirname(char *path, size_t len);
long zend_atol(const char *str, int len);
size_t xc_dirname(char *path, size_t len);
#define zend_dirname xc_dirname
long xc_atol(const char *str, int len);
#define zend_atol xc_atol
#endif
typedef struct {

2
xcache.c

@ -3711,7 +3711,7 @@ static ZEND_MODULE_POST_ZEND_DEACTIVATE_D(xcache)
/* }}} */
/* {{{ module dependencies */
#if ZEND_MODULE_API_NO >= 20050922
static const zend_module_dep xcache_module_deps[] = {
static zend_module_dep xcache_module_deps[] = {
ZEND_MOD_REQUIRED("standard")
ZEND_MOD_CONFLICTS("apc")
ZEND_MOD_CONFLICTS("eAccelerator")

Loading…
Cancel
Save