From dc552d93b35e4455d2d102a900fab5973ae8e6b8 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Fri, 4 Sep 2015 07:08:12 -0700 Subject: 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. --- struct.c | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) (limited to 'struct.c') 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)) -- cgit v1.2.3