compat.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #ifndef _PHP_COMPAT_H_
  2. #define _PHP_COMPAT_H_
  3. #include <zend.h>
  4. #include <zend_constants.h>
  5. #include <zend_modules.h>
  6. #ifdef ZEND_ENGINE_3
  7. // #define Z_BVAL_P(zv) Z_LVAL_P(zv)
  8. /*
  9. #define Z_BVAL_PP(zv) Z_LVAL_P(*(zv))
  10. #define Z_LVAL_PP(zv) Z_LVAL_P(*(zv))
  11. #define Z_DVAL_PP(zv) Z_DVAL_P(*(zv))
  12. #define Z_STRVAL_PP(zv) Z_STRVAL_P(*(zv))
  13. #define Z_STRLEN_PP(zv) Z_STRLEN_P(*(zv))
  14. #define Z_ARRVAL_PP(zv) Z_ARRVAL_P(*(zv))
  15. #define Z_TYPE_PP(zv) Z_TYPE_P(*(zv))
  16. */
  17. #endif
  18. #ifdef ZEND_ENGINE_2
  19. typedef long zend_long;
  20. #define _IS_BOOL IS_BOOL
  21. #define IS_TRUE (IS_CALLABLE+1)
  22. #define IS_FALSE (IS_CALLABLE+2)
  23. #define IS_UNDEF (IS_CALLABLE+3)
  24. #if !defined(IS_CONSTANT_AST)
  25. #if ZEND_MODULE_API_NO < 20121212 // < PHP 5.5
  26. #error "Maybe you are using not supported zend < 2.5.0 (PHP < 5.5.0)"
  27. #else
  28. #define IS_CONSTANT_AST (IS_CALLABLE+4)
  29. #endif
  30. #endif
  31. #endif
  32. ZEND_API void zend_register_stringl_constant_compat(const char *name, size_t name_len, char *strval, size_t strlen, int flags, int module_number);
  33. ZEND_API void zend_register_long_constant_compat(const char *name, size_t name_len, zend_long lval, int flags, int module_number);
  34. ZEND_API void zend_register_double_constant_compat(const char *name, size_t name_len, double dval, int flags, int module_number);
  35. ZEND_API void zend_register_bool_constant_compat(const char *name, size_t name_len, zend_bool bval, int flags, int module_number);
  36. ZEND_API void zend_register_null_constant_compat(const char *name, size_t name_len, int flags, int module_number);
  37. #endif