[php] Fix function constants for PHP 7.3
The code we were generating no longer compiled.
This commit is contained in:
parent
ebc9e6ad9f
commit
89c6c01c40
2 changed files with 8 additions and 2 deletions
|
|
@ -39,8 +39,7 @@
|
|||
SWIG_SetPointerZval(&c.value, (void*)$value, $1_descriptor, 0);
|
||||
zval_copy_ctor(&c.value);
|
||||
c.name = zend_string_init("$symname", sizeof("$symname") - 1, 0);
|
||||
c.flags = CONST_CS;
|
||||
c.module_number = module_number;
|
||||
SWIG_ZEND_CONSTANT_SET_FLAGS(&c, CONST_CS, module_number);
|
||||
zend_register_constant(&c);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -32,6 +32,13 @@ extern "C" {
|
|||
REGISTER_STRINGL_CONSTANT(#N, &swig_char, 1, CONST_CS | CONST_PERSISTENT);\
|
||||
} 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
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue