diff options
author | Reini Urban <rurban@cpanel.net> | 2016-05-04 08:53:47 +0200 |
---|---|---|
committer | Tina Müller <cpan2@tinita.de> | 2018-07-17 23:08:09 +0200 |
commit | 75eddf785fedc2aeb9bf96db5a9bee97f7e4e72e (patch) | |
tree | d6a230dc193aa40196a7afb815fe2ee9b6b2e4d1 /include | |
parent | 20496ee288fc0cbb9416a328f39379f69a5667da (diff) | |
download | libyaml-git-75eddf785fedc2aeb9bf96db5a9bee97f7e4e72e.tar.gz |
fix C++-compat error
we cannot malloc to an anon struct in C++.
typedef yaml_anchors_t
Diffstat (limited to 'include')
-rw-r--r-- | include/yaml.h | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/include/yaml.h b/include/yaml.h index 97f655a..c225908 100644 --- a/include/yaml.h +++ b/include/yaml.h @@ -1517,6 +1517,18 @@ typedef enum yaml_emitter_state_e { YAML_EMIT_END_STATE } yaml_emitter_state_t; + +/* This is needed for C++ */ + +typedef struct yaml_anchors_s { + /** The number of references. */ + int references; + /** The anchor id. */ + int anchor; + /** If the node has been emitted? */ + int serialized; +} yaml_anchors_t; + /** * The emitter structure. * @@ -1742,14 +1754,7 @@ typedef struct yaml_emitter_s { int closed; /** The information associated with the document nodes. */ - struct { - /** The number of references. */ - int references; - /** The anchor id. */ - int anchor; - /** If the node has been emitted? */ - int serialized; - } *anchors; + yaml_anchors_t *anchors; /** The last assigned anchor id. */ int last_anchor_id; |