summaryrefslogtreecommitdiffhomepage
path: root/src/codegen.c
diff options
context:
space:
mode:
authorMitchell Blank Jr <[email protected]>2012-05-19 22:40:57 -0700
committerMitchell Blank Jr <[email protected]>2012-05-19 22:40:57 -0700
commit3471e2b1340cb84504272da26051f149f350ee94 (patch)
tree3e84410470fb2f98bd5369511c53901c612d0b0d /src/codegen.c
parent4105b595684bb9f1e176563f819de2917d0471fd (diff)
downloadmruby-3471e2b1340cb84504272da26051f149f350ee94.tar.gz
mruby-3471e2b1340cb84504272da26051f149f350ee94.zip
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
Diffstat (limited to 'src/codegen.c')
-rw-r--r--src/codegen.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/codegen.c b/src/codegen.c
index 769f9e538..263490f27 100644
--- a/src/codegen.c
+++ b/src/codegen.c
@@ -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;