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
+6 -4
View File
@@ -11,12 +11,14 @@
extern "C" {
#endif
struct mrb_range_edges {
mrb_value beg;
mrb_value end;
};
struct RRange {
MRUBY_OBJECT_HEADER;
struct mrb_range_edges {
mrb_value beg;
mrb_value end;
} *edges;
struct mrb_range_edges *edges;
int excl;
};