Add PHP const ref typemaps for primitive types
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11549 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
4297c7de33
commit
627d9faffd
4 changed files with 66 additions and 1 deletions
|
|
@ -184,6 +184,21 @@
|
|||
ZVAL_LONG(return_value,$1);
|
||||
}
|
||||
|
||||
%typemap(out) const int &,
|
||||
const unsigned int &,
|
||||
const short &,
|
||||
const unsigned short &,
|
||||
const long &,
|
||||
const unsigned long &,
|
||||
const signed char &,
|
||||
const unsigned char &,
|
||||
const bool &,
|
||||
const size_t &,
|
||||
const enum SWIGTYPE &
|
||||
{
|
||||
ZVAL_LONG(return_value,*$1);
|
||||
}
|
||||
|
||||
%typemap(directorin) int,
|
||||
unsigned int,
|
||||
short,
|
||||
|
|
@ -203,6 +218,11 @@
|
|||
ZVAL_BOOL(return_value,($1)?1:0);
|
||||
}
|
||||
|
||||
%typemap(out) const bool &
|
||||
{
|
||||
ZVAL_BOOL(return_value,(*$1)?1:0);
|
||||
}
|
||||
|
||||
%typemap(directorin) bool
|
||||
{
|
||||
ZVAL_BOOL($input,($1_name)?1:0);
|
||||
|
|
@ -214,6 +234,12 @@
|
|||
ZVAL_DOUBLE(return_value,$1);
|
||||
}
|
||||
|
||||
%typemap(out) const float &,
|
||||
const double &
|
||||
{
|
||||
ZVAL_DOUBLE(return_value,*$1);
|
||||
}
|
||||
|
||||
%typemap(directorin) float,
|
||||
double
|
||||
{
|
||||
|
|
@ -225,6 +251,11 @@
|
|||
ZVAL_STRINGL(return_value,&$1, 1, 1);
|
||||
}
|
||||
|
||||
%typemap(out) const char &
|
||||
{
|
||||
ZVAL_STRINGL(return_value,&*$1, 1, 1);
|
||||
}
|
||||
|
||||
%typemap(out) char *,
|
||||
char []
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue