C++ compilability - don't define types inside others

The following is legal code in both C and C++:

  struct foo {
    struct bar { int a } x;
    int y;
  };

...however in C++ it defines a type called "foo::bar" instead of "bar".
Just avoid this construct altogether
This commit is contained in:
Mitchell Blank Jr
2012-05-19 22:40:57 -07:00
parent 4105b59568
commit 3471e2b134
5 changed files with 37 additions and 27 deletions
+9 -7
View File
@@ -20,14 +20,16 @@
typedef mrb_ast_node node;
typedef struct mrb_parser_state parser_state;
enum looptype {
LOOP_NORMAL,
LOOP_BLOCK,
LOOP_FOR,
LOOP_BEGIN,
LOOP_RESCUE,
} type;
struct loopinfo {
enum looptype {
LOOP_NORMAL,
LOOP_BLOCK,
LOOP_FOR,
LOOP_BEGIN,
LOOP_RESCUE,
} type;
enum looptype type;
int pc1, pc2, pc3, acc;
int ensure_level;
struct loopinfo *prev;