Fix wrapping of constants, broken by warning suppression change.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10009 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
955a50ce7a
commit
29d932886e
2 changed files with 16 additions and 10 deletions
|
|
@ -17,22 +17,20 @@
|
|||
signed char,
|
||||
bool,
|
||||
enum SWIGTYPE
|
||||
"REGISTER_LONG_CONSTANT((char*)\"$symname\", $value, CONST_CS | CONST_PERSISTENT);";
|
||||
"SWIG_LONG_CONSTANT($symname, $value);";
|
||||
|
||||
%typemap(consttab) float,
|
||||
double
|
||||
"REGISTER_DOUBLE_CONSTANT((char*)\"$symname\", $value, CONST_CS | CONST_PERSISTENT);";
|
||||
"SWIG_DOUBLE_CONSTANT($symname, $value);";
|
||||
|
||||
%typemap(consttab) char {
|
||||
static char swig_char = $value;
|
||||
REGISTER_STRINGL_CONSTANT((char*)"$symname", &swig_char, 1, CONST_CS | CONST_PERSISTENT);
|
||||
}
|
||||
%typemap(consttab) char
|
||||
"SWIG_CHAR_CONSTANT($symname, $value);";
|
||||
|
||||
%typemap(consttab) char *,
|
||||
const char *,
|
||||
char [],
|
||||
const char []
|
||||
"REGISTER_STRINGL_CONSTANT((char*)\"$symname\", $value, strlen($value), CONST_CS | CONST_PERSISTENT);";
|
||||
const char *,
|
||||
char [],
|
||||
const char []
|
||||
"SWIG_STRING_CONSTANT($symname, $value);";
|
||||
|
||||
%typemap(consttab) SWIGTYPE *,
|
||||
SWIGTYPE &,
|
||||
|
|
|
|||
|
|
@ -24,6 +24,14 @@ extern "C" {
|
|||
# define SWIG_ZEND_NAMED_FE(ZN, N, A) ZEND_NAMED_FE(ZN, N, A)
|
||||
#endif
|
||||
|
||||
#define SWIG_LONG_CONSTANT(N, V) zend_register_long_constant((char*)#N, sizeof(#N), V, CONST_CS | CONST_PERSISTENT, module_number TSRMLS_CC)
|
||||
#define SWIG_DOUBLE_CONSTANT(N, V) zend_register_double_constant((char*)#N, sizeof(#N), V, CONST_CS | CONST_PERSISTENT, module_number TSRMLS_CC)
|
||||
#define SWIG_STRING_CONSTANT(N, V) zend_register_stringl_constant((char*)#N, sizeof(#N), V, strlen(V), CONST_CS | CONST_PERSISTENT, module_number TSRMLS_CC)
|
||||
#define SWIG_CHAR_CONSTANT(N, V) do {\
|
||||
static char swig_char = (V);\
|
||||
zend_register_stringl_constant((char*)#N, sizeof(#N), &swig_char, 1, CONST_CS | CONST_PERSISTENT, module_number TSRMLS_CC);\
|
||||
} while (0)
|
||||
|
||||
/* These TSRMLS_ stuff should already be defined now, but with older php under
|
||||
redhat are not... */
|
||||
#ifndef TSRMLS_D
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue