bool typemap mods for Visual C++
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@4300 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
cdaaf78337
commit
38c4c0b7d4
1 changed files with 10 additions and 5 deletions
|
|
@ -158,8 +158,10 @@
|
||||||
/* The following are the in, out, freearg, argout typemaps. These are the JNI code generating typemaps for converting from Java to C and visa versa. */
|
/* The following are the in, out, freearg, argout typemaps. These are the JNI code generating typemaps for converting from Java to C and visa versa. */
|
||||||
|
|
||||||
/* primitive types */
|
/* primitive types */
|
||||||
%typemap(in) bool,
|
%typemap(in) bool
|
||||||
char,
|
%{ $1 = $input ? true : false; %}
|
||||||
|
|
||||||
|
%typemap(in) char,
|
||||||
signed char,
|
signed char,
|
||||||
unsigned char,
|
unsigned char,
|
||||||
short,
|
short,
|
||||||
|
|
@ -256,8 +258,11 @@
|
||||||
%typemap(out) void ""
|
%typemap(out) void ""
|
||||||
|
|
||||||
/* primitive types by reference */
|
/* primitive types by reference */
|
||||||
%typemap(in) const bool & (bool temp),
|
%typemap(in) const bool & (bool temp)
|
||||||
const char & (char temp),
|
%{ temp = $input ? true : false;
|
||||||
|
$1 = &temp; %}
|
||||||
|
|
||||||
|
%typemap(in) const char & (char temp),
|
||||||
const signed char & (signed char temp),
|
const signed char & (signed char temp),
|
||||||
const unsigned char & (unsigned char temp),
|
const unsigned char & (unsigned char temp),
|
||||||
const short & (short temp),
|
const short & (short temp),
|
||||||
|
|
@ -270,7 +275,7 @@
|
||||||
const float & (float temp),
|
const float & (float temp),
|
||||||
const double & (double temp)
|
const double & (double temp)
|
||||||
%{ temp = ($*1_ltype)$input;
|
%{ temp = ($*1_ltype)$input;
|
||||||
$1 = &temp; %}
|
$1 = &temp; %}
|
||||||
|
|
||||||
%typemap(out) const bool & %{ $result = (jboolean)*$1; %}
|
%typemap(out) const bool & %{ $result = (jboolean)*$1; %}
|
||||||
%typemap(out) const char & %{ $result = (jchar)*$1; %}
|
%typemap(out) const char & %{ $result = (jchar)*$1; %}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue