Browse Source

fix build: ISREF undefined in <=PHP_5_2

git-svn-id: svn://svn.lighttpd.net/xcache/trunk@798 c26eb9a1-5813-0410-bd6c-c2e55f420ca7
3.0
Xuefer 11 years ago
parent
commit
79015d6a30
  1. 4
      xcache.c
  2. 6
      xcache.h

4
xcache.c

@ -2883,7 +2883,7 @@ PHP_FUNCTION(xcache_get_refcount)
RETURN_NULL();
}
RETURN_LONG(Z_REFCOUNT_P(variable));
RETURN_LONG(Z_REFCOUNT(*variable));
}
/* }}} */
/* {{{ proto bool xcache_get_isref(mixed variable)
@ -2899,7 +2899,7 @@ PHP_FUNCTION(xcache_get_isref)
RETURN_NULL();
}
RETURN_BOOL(Z_ISREF_P(variable) && Z_REFCOUNT_P(variable) >= 3);
RETURN_BOOL(Z_ISREF(*variable) && Z_REFCOUNT(*variable) >= 3);
}
/* }}} */
#ifdef HAVE_XCACHE_DPRINT

6
xcache.h

@ -53,12 +53,18 @@
# define my_free_alloca(size, use_heap) free_alloca(size)
# define ALLOCA_FLAG(x)
#endif
#ifndef Z_ISREF
# define Z_ISREF(z) (z).is_ref
#endif
#ifndef Z_SET_ISREF
# define Z_SET_ISREF(z) (z).is_ref = 1
#endif
#ifndef Z_UNSET_ISREF
# define Z_UNSET_ISREF(z) (z).is_ref = 0
#endif
#ifndef Z_REFCOUNT
# define Z_REFCOUNT(z) (z).refcount
#endif
#ifndef Z_SET_REFCOUNT
# define Z_SET_REFCOUNT(z, rc) (z).refcount = rc
#endif

Loading…
Cancel
Save