diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2015-09-04 07:08:12 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2015-09-04 07:08:12 -0700 |
commit | dc552d93b35e4455d2d102a900fab5973ae8e6b8 (patch) | |
tree | dcae92408d01694d21f7cdd2eeafca1724c3a852 | |
parent | 534d081c2c09956870be3a0334792c72da5feac9 (diff) | |
download | txr-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.
-rw-r--r-- | struct.c | 25 |
1 files changed, 9 insertions, 16 deletions
@@ -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)) |