[php] Fix function constants for PHP 7.3
The code we were generating no longer compiled.
This commit is contained in:
parent
786efd0ae0
commit
9f84ca8a00
2 changed files with 8 additions and 2 deletions
|
|
@ -60,8 +60,7 @@
|
||||||
SWIG_SetPointerZval(&c.value, (void*)$value, $1_descriptor, 0);
|
SWIG_SetPointerZval(&c.value, (void*)$value, $1_descriptor, 0);
|
||||||
zval_copy_ctor(&c.value);
|
zval_copy_ctor(&c.value);
|
||||||
c.name = zend_string_init("$symname", sizeof("$symname") - 1, 0);
|
c.name = zend_string_init("$symname", sizeof("$symname") - 1, 0);
|
||||||
c.flags = CONST_CS;
|
SWIG_ZEND_CONSTANT_SET_FLAGS(&c, CONST_CS, module_number);
|
||||||
c.module_number = module_number;
|
|
||||||
zend_register_constant(&c);
|
zend_register_constant(&c);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,13 @@ extern "C" {
|
||||||
REGISTER_STRINGL_CONSTANT(#N, &swig_char, 1, CONST_CS | CONST_PERSISTENT);\
|
REGISTER_STRINGL_CONSTANT(#N, &swig_char, 1, CONST_CS | CONST_PERSISTENT);\
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
/* ZEND_CONSTANT_SET_FLAGS is new in PHP 7.3. */
|
||||||
|
#ifdef ZEND_CONSTANT_SET_FLAGS
|
||||||
|
# define SWIG_ZEND_CONSTANT_SET_FLAGS ZEND_CONSTANT_SET_FLAGS
|
||||||
|
#else
|
||||||
|
# define SWIG_ZEND_CONSTANT_SET_FLAGS(C, F, N) do { (C).flags = (F); (C).module_number = (N); } while (0)
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue