summaryrefslogtreecommitdiff
path: root/Examples/test-suite/tag_no_clash_with_variable.i
blob: 5d63423141f261cc3b3e40aae45e40ae8c639eda (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/* This is a test case for -*- C -*- mode. */
%module tag_no_clash_with_variable

%inline %{

/* error_action is only a tag, not a type... */
enum error_action {
    ERRACT_ABORT,
    ERRACT_EXIT, 
    ERRACT_THROW
};

/* ... thus it does not clash with a variable of the same name. */ 
enum error_action error_action;

/* Likewise for structs: */

struct buffalo { 
  int foo;
};

struct buffalo buffalo; 

/* And for union */

union onion {
  int cheese;
};

union onion onion;
 
%}