mirror of
https://github.com/yaml/libyaml
synced 2026-06-08 18:28:36 +00:00
fix C++-compat error
we cannot malloc to an anon struct in C++. typedef yaml_anchors_t
This commit is contained in:
+1
-1
@@ -131,7 +131,7 @@ yaml_emitter_dump(yaml_emitter_t *emitter, yaml_document_t *document)
|
||||
|
||||
assert(emitter->opened); /* Emitter should be opened. */
|
||||
|
||||
emitter->anchors = yaml_malloc(sizeof(*(emitter->anchors))
|
||||
emitter->anchors = (yaml_anchors_t*)yaml_malloc(sizeof(*(emitter->anchors))
|
||||
* (document->nodes.top - document->nodes.start));
|
||||
if (!emitter->anchors) goto error;
|
||||
memset(emitter->anchors, 0, sizeof(*(emitter->anchors))
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@
|
||||
#define PUT(emitter,value) \
|
||||
(FLUSH(emitter) \
|
||||
&& (*(emitter->buffer.pointer++) = (yaml_char_t)(value), \
|
||||
emitter->column ++, \
|
||||
emitter->column++, \
|
||||
1))
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user