summaryrefslogtreecommitdiffhomepage
path: root/src/gc.h
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/gc.h
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/gc.h')
-rw-r--r--src/gc.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/gc.h b/src/gc.h
index 0a4bc1c51..fea761d1b 100644
--- a/src/gc.h
+++ b/src/gc.h
@@ -11,12 +11,14 @@
extern "C" {
#endif
+struct free_obj {
+ MRUBY_OBJECT_HEADER;
+ struct RBasic *next;
+};
+
typedef struct {
union {
- struct free_obj {
- MRUBY_OBJECT_HEADER;
- struct RBasic *next;
- } free;
+ struct free_obj free;
struct RBasic basic;
struct RObject object;
struct RClass klass;