summaryrefslogtreecommitdiff
path: root/Lib
diff options
context:
space:
mode:
authorWilliam S Fulton <wsf@fultondesigns.co.uk>2015-01-14 12:35:18 +0000
committerWilliam S Fulton <wsf@fultondesigns.co.uk>2015-01-15 19:48:07 +0000
commitfd8dcf44bfbd874972c5e6a48e6e052a11489c51 (patch)
treef1ccba4b9e4db11e4a722dc6cca39918de1803a4 /Lib
parent6a7250d71bf8d1d5e31098935dfeafe0309be960 (diff)
downloadswig-fd8dcf44bfbd874972c5e6a48e6e052a11489c51.tar.gz
C++11 strongly typed enum fixes for directors
Tests added for previous commit. Further refinements to patch #308 and fixes #307.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/csharp/enums.swg2
-rw-r--r--Lib/csharp/enumsimple.swg4
-rw-r--r--Lib/csharp/enumtypesafe.swg4
-rw-r--r--Lib/go/go.swg2
4 files changed, 6 insertions, 6 deletions
diff --git a/Lib/csharp/enums.swg b/Lib/csharp/enums.swg
index 7bdef6f83..5cc265476 100644
--- a/Lib/csharp/enums.swg
+++ b/Lib/csharp/enums.swg
@@ -18,7 +18,7 @@
%typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const enum SWIGTYPE &
%{ static $*1_ltype temp = ($*1_ltype)$input;
$result = &temp; %}
-%typemap(directorin) const enum SWIGTYPE & "$input = $1;"
+%typemap(directorin) const enum SWIGTYPE & "$input = (int)$1;"
%typemap(csdirectorin) const enum SWIGTYPE & "($*csclassname)$iminput"
%typemap(csdirectorout) const enum SWIGTYPE & "(int)$cscall"
diff --git a/Lib/csharp/enumsimple.swg b/Lib/csharp/enumsimple.swg
index 484443652..24e4bcf18 100644
--- a/Lib/csharp/enumsimple.swg
+++ b/Lib/csharp/enumsimple.swg
@@ -20,7 +20,7 @@
%typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const enum SWIGTYPE &
%{ static $*1_ltype temp = ($*1_ltype)$input;
$result = &temp; %}
-%typemap(directorin) const enum SWIGTYPE & "$input = $1;"
+%typemap(directorin) const enum SWIGTYPE & "$input = (int)$1;"
%typemap(csdirectorin) const enum SWIGTYPE & "$iminput"
%typemap(csdirectorout) const enum SWIGTYPE & "$cscall"
@@ -53,7 +53,7 @@
%typemap(out) enum SWIGTYPE %{ $result = (int)$1; %}
%typemap(directorout) enum SWIGTYPE %{ $result = ($1_ltype)$input; %}
-%typemap(directorin) enum SWIGTYPE "$input = $1;"
+%typemap(directorin) enum SWIGTYPE "$input = (int)$1;"
%typemap(csdirectorin) enum SWIGTYPE "$iminput"
%typemap(csdirectorout) enum SWIGTYPE "$cscall"
diff --git a/Lib/csharp/enumtypesafe.swg b/Lib/csharp/enumtypesafe.swg
index b7079343c..fd6801730 100644
--- a/Lib/csharp/enumtypesafe.swg
+++ b/Lib/csharp/enumtypesafe.swg
@@ -19,7 +19,7 @@
%typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const enum SWIGTYPE &
%{ static $*1_ltype temp = ($*1_ltype)$input;
$result = &temp; %}
-%typemap(directorin) const enum SWIGTYPE & "$input = $1;"
+%typemap(directorin) const enum SWIGTYPE & "$input = (int)$1;"
%typemap(csdirectorin) const enum SWIGTYPE & "$*csclassname.swigToEnum($iminput)"
%typemap(csdirectorout) const enum SWIGTYPE & "$cscall.swigValue"
@@ -52,7 +52,7 @@
%typemap(out) enum SWIGTYPE %{ $result = (int)$1; %}
%typemap(directorout) enum SWIGTYPE %{ $result = ($1_ltype)$input; %}
-%typemap(directorin) enum SWIGTYPE "$input = $1;"
+%typemap(directorin) enum SWIGTYPE "$input = (int)$1;"
%typemap(csdirectorin) enum SWIGTYPE "$csclassname.swigToEnum($iminput)"
%typemap(csdirectorout) enum SWIGTYPE "$cscall.swigValue"
diff --git a/Lib/go/go.swg b/Lib/go/go.swg
index c680844c4..e0ad5d147 100644
--- a/Lib/go/go.swg
+++ b/Lib/go/go.swg
@@ -379,7 +379,7 @@
%{ $result = (intgo)$1; %}
%typemap(directorin) enum SWIGTYPE
-%{ $input = ($1_ltype)$1; %}
+%{ $input = (intgo)$1; %}
%typemap(directorout) enum SWIGTYPE
%{ $result = ($1_ltype)$input; %}