summaryrefslogtreecommitdiffstats
path: root/struct.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2015-09-04 07:08:12 -0700
committerKaz Kylheku <kaz@kylheku.com>2015-09-04 07:08:12 -0700
commitdc552d93b35e4455d2d102a900fab5973ae8e6b8 (patch)
treedcae92408d01694d21f7cdd2eeafca1724c3a852 /struct.c
parent534d081c2c09956870be3a0334792c72da5feac9 (diff)
downloadtxr-dc552d93b35e4455d2d102a900fab5973ae8e6b8.tar.gz
txr-dc552d93b35e4455d2d102a900fab5973ae8e6b8.tar.bz2
txr-dc552d93b35e4455d2d102a900fab5973ae8e6b8.zip
Fix failure of struct.c to compile as C++.
* struct.c (struct_type_ops, struct_inst_ops): Use static_forward and static_macros to handle the forward declarations. Also, cobj_ops_init macro now used for both instead of raw initializer.
Diffstat (limited to 'struct.c')
-rw-r--r--struct.c25
1 files changed, 9 insertions, 16 deletions
diff --git a/struct.c b/struct.c
index 491178d9..298eae0b 100644
--- a/struct.c
+++ b/struct.c
@@ -73,8 +73,8 @@ static val slot_hash;
static val struct_type_finalize_f;
static val struct_type_finalize(val obj);
-static struct cobj_ops struct_type_ops;
-static struct cobj_ops struct_inst_ops;
+static_forward(struct cobj_ops struct_type_ops);
+static_forward(struct cobj_ops struct_inst_ops);
void struct_init(void)
{
@@ -517,18 +517,11 @@ static cnum struct_inst_hash(val obj)
return out;
}
-static struct cobj_ops struct_type_ops = {
- eq,
- struct_type_print,
- cobj_destroy_free_op,
- struct_type_mark,
- cobj_hash_op
-};
+static_def(struct cobj_ops struct_type_ops =
+ cobj_ops_init(eq, struct_type_print, cobj_destroy_free_op,
+ struct_type_mark, cobj_hash_op))
-static struct cobj_ops struct_inst_ops = {
- struct_inst_equal,
- struct_inst_print,
- cobj_destroy_free_op,
- struct_inst_mark,
- struct_inst_hash,
-};
+static_def(struct cobj_ops struct_inst_ops =
+ cobj_ops_init(struct_inst_equal, struct_inst_print,
+ cobj_destroy_free_op, struct_inst_mark,
+ struct_inst_hash))