summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Andersson <j.a.e.andersson@gmail.com>2016-07-05 12:08:34 -0500
committerJoel Andersson <j.a.e.andersson@gmail.com>2016-07-05 17:25:15 -0500
commit288a3239843bdb8be596c62e468368babda7fc0a (patch)
tree4b58d332ba4673a8721696ffccaf23c9fd9b2e30
parent1ce973ef4a578bcb9c9047372911bcbaad1a37ad (diff)
downloadswig-288a3239843bdb8be596c62e468368babda7fc0a.tar.gz
Issue #67 Fixed enums.i
-rw-r--r--Examples/test-suite/enums.i32
-rw-r--r--Examples/test-suite/matlab/enums_runme.m1
2 files changed, 19 insertions, 14 deletions
diff --git a/Examples/test-suite/enums.i b/Examples/test-suite/enums.i
index 14c6efbba..07c90c449 100644
--- a/Examples/test-suite/enums.i
+++ b/Examples/test-suite/enums.i
@@ -12,7 +12,7 @@
%inline %{
-typedef enum {
+typedef enum {
CSP_ITERATION_FWD,
CSP_ITERATION_BWD = 11
} foo1;
@@ -28,7 +28,7 @@ bar1(foo1 x) {}
void
bar2(enum foo2 x) {}
-void
+void
bar3(foo3 x) {}
enum sad { boo, hoo = 5 };
@@ -55,7 +55,7 @@ typedef struct _Foo {
%}
-
+
%warnfilter(SWIGWARN_RUBY_WRONG_NAME) _iFoo;
#ifdef SWIGD
@@ -65,26 +65,33 @@ typedef struct _Foo {
#ifndef __cplusplus
%inline %{
-typedef struct _iFoo
-{
- enum {
+typedef struct _iFoo
+{
+ enum {
Phoo = +50,
Char = 'a'
} e;
-} iFoo;
+} iFoo;
%}
#else
%inline %{
-struct iFoo
-{
- enum {
+struct iFoo
+{
+ enum {
Phoo = +50,
Char = 'a'
- };
-};
+ };
+};
%}
#endif
+/* MATLAB/Octave not (always) case sensitive */
+#ifdef SWIGMATLAB
+%rename(slap_) slap;
+%rename(mine_) mine;
+%rename(thigh_) thigh;
+#endif
+
// enum declaration and initialization
%inline %{
enum Exclamation {
@@ -99,4 +106,3 @@ enum ContainYourself {
thigh
} Slap = slap, Mine = mine, Thigh = thigh, *pThigh = &Thigh, arrayContainYourself[3] = {slap, mine, thigh};
%}
-
diff --git a/Examples/test-suite/matlab/enums_runme.m b/Examples/test-suite/matlab/enums_runme.m
index b04811031..2b39e1da4 100644
--- a/Examples/test-suite/matlab/enums_runme.m
+++ b/Examples/test-suite/matlab/enums_runme.m
@@ -17,4 +17,3 @@ end
if (enums.Thigh ~= 12)
error
end
-