Skip to content

Commit

Permalink
Issue #67 Fixed enums.i
Browse files Browse the repository at this point in the history
  • Loading branch information
jaeandersson committed Jul 5, 2016
1 parent 204403d commit dd3b60c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 14 deletions.
32 changes: 19 additions & 13 deletions Examples/test-suite/enums.i
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

%inline %{

typedef enum {
typedef enum {
CSP_ITERATION_FWD,
CSP_ITERATION_BWD = 11
} foo1;
Expand All @@ -28,7 +28,7 @@ bar1(foo1 x) {}
void
bar2(enum foo2 x) {}

void
void
bar3(foo3 x) {}

enum sad { boo, hoo = 5 };
Expand All @@ -55,7 +55,7 @@ typedef struct _Foo {

%}


%warnfilter(SWIGWARN_RUBY_WRONG_NAME) _iFoo;

#ifdef SWIGD
Expand All @@ -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 {
Expand All @@ -99,4 +106,3 @@ enum ContainYourself {
thigh
} Slap = slap, Mine = mine, Thigh = thigh, *pThigh = &Thigh, arrayContainYourself[3] = {slap, mine, thigh};
%}

1 change: 0 additions & 1 deletion Examples/test-suite/matlab/enums_runme.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,3 @@
if (enums.Thigh ~= 12)
error
end

0 comments on commit dd3b60c

Please sign in to comment.