Skip to content

Commit 59bacd8

Browse files
committed
Release version 0.5.0
1 parent b2bed16 commit 59bacd8

File tree

8 files changed

+276
-88
lines changed

8 files changed

+276
-88
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Change Log
22

3-
## [0.5.0-pre]
3+
## [0.5.0]
44
- New schema type aliases: int8, uint8, int16, uint16, int32, uint32,
55
int64, uint64, float32, float64.
66
- Low-level: access multiple user frames in builder via handles.

README.md

Lines changed: 18 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,6 @@ Windows: [![Windows Build Status](https://ci.appveyor.com/api/projects/status/gi
33

44
# FlatCC FlatBuffers in C for C
55

6-
_NOTE: ongoing work towards version 0.5.0 features might cause minor
7-
breakage. For full backwards compatibility use the v0.4.3 tag.
8-
If you work with JSON parsing, you may want to patch v0.4.3 with commit
9-
[1cb266](https://github.com/dvidelabs/flatcc/commit/1cb2664dcd104b2051d410955018cb255370302e)
10-
which only affects code generation, not the runtime library._
11-
126
`flatcc` has no external dependencies except for build and compiler
137
tools, and the C runtime library. With concurrent Ninja builds, a small
148
client project can build flatcc with libraries, generate schema code,
@@ -234,21 +228,21 @@ fi
234228

235229
## Status
236230

237-
v0.5.0 is in development on master branch primarily to reach feature
238-
parity with Googles flatc schema parser as of end 2017. These new
239-
features are union vectors and mixed type unions that can include
240-
tables, structs and strings, and type aliases for int8, uint8, int16,
241-
uint16, int32, uint32, int64, uint64, float32, float64 types in the
242-
schema. Support for base64(url) JSON encoded [ubyte] vectors has been
243-
added which will also be added to Googles flatc tool in a future
244-
release. In addition the following changes have been added: Runtime
245-
builder library support for `aligned_alloc/free`. Handling of unions is
246-
slightly incompatible with previous releases as covered in the
247-
documentation. v0.5.0 fixes a bug that could cause a JSON parser to
248-
reject some valid symbols for some schemas and also fixes a non-critical
249-
JSON scoping issue with symbolic union names and a bug verifying buffers
250-
with a struct as root. Low-level custom frame support has been improved
251-
in the builder library which is useful for complex parsing scenarios.
231+
Release 0.5.0 aims to reach feature parity with C++ FlatBuffers as of
232+
end 2017. These new features are union vectors and mixed type unions
233+
that can include tables, structs and strings, and type aliases for int8,
234+
uint8, int16, uint16, int32, uint32, int64, uint64, float32, float64
235+
types in the schema. Support for base64(url) JSON encoded [ubyte]
236+
vectors has been added which will also be added to Googles flatc tool in
237+
a future release. In addition the following changes have been added:
238+
Runtime builder library support for `aligned_alloc/free`. Handling of
239+
unions is slightly incompatible with previous releases as covered in the
240+
documentation and the changelog. v0.5.0 fixes a bug that could cause a
241+
JSON parser to reject some valid symbols for some schemas and also fixes
242+
a non-critical JSON scoping issue with symbolic union names and a bug
243+
verifying buffers with a struct as root. Low-level custom frame support
244+
has been improved in the builder library which is useful for complex
245+
parsing scenarios.
252246

253247

254248
Main features supported as of 0.5.0
@@ -271,9 +265,9 @@ Main features supported as of 0.5.0
271265
- flexible configuration of malloc alternatives and runtime
272266
aligned_alloc/free support in builder library.
273267
- feature parity with C++ FlatBuffers schema features added in 2017
274-
union vectors and mixed type unions of strings, structs, and tables.
275-
- base64(url) encoded binary data in JSON, soon to also be supported by
276-
Googles flatc JSON parser.
268+
adding support for union vectors and mixed type unions of strings,
269+
structs, and tables, and type aliases for uint8, ..., float64.
270+
- base64(url) encoded binary data in JSON.
277271

278272

279273
Supported platforms (as covered by CI release tests on ci-more branch):

include/flatcc/flatcc_version.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#define FLATCC_VERSION_TEXT "0.5.0-pre"
1+
#define FLATCC_VERSION_TEXT "0.5.0"
22
#define FLATCC_VERSION_MAJOR 0
33
#define FLATCC_VERSION_MINOR 5
44
#define FLATCC_VERSION_PATCH 0
55
/* 1 or 0 */
6-
#define FLATCC_VERSION_RELEASED 0
6+
#define FLATCC_VERSION_RELEASED 1

include/flatcc/reflection/flatbuffers_common_builder.h

Lines changed: 133 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#ifndef FLATBUFFERS_COMMON_BUILDER_H
22
#define FLATBUFFERS_COMMON_BUILDER_H
33

4-
/* Generated by flatcc 0.4.3 FlatBuffers schema compiler for C by dvide.com */
4+
/* Generated by flatcc 0.5.0 FlatBuffers schema compiler for C by dvide.com */
55

66
/* Common FlatBuffers build functionality for C. */
77

@@ -13,6 +13,8 @@
1313
typedef flatcc_builder_t flatbuffers_builder_t;
1414
typedef flatcc_builder_ref_t flatbuffers_ref_t;
1515
typedef flatcc_builder_ref_t flatbuffers_vec_ref_t;
16+
typedef flatcc_builder_union_ref_t flatbuffers_union_ref_t;
17+
typedef flatcc_builder_union_vec_ref_t flatbuffers_union_vec_ref_t;
1618
/* integer return code (ref and ptr always fail on 0) */
1719
#define flatbuffers_failed(x) ((x) < 0)
1820
typedef flatbuffers_ref_t flatbuffers_root_t;
@@ -85,7 +87,15 @@ static inline NS ## buffer_ref_t N ## _create_as_typed_root(NS ## builder_t *B _
8587
N ## _create(B __ ## N ## _call_args), A, 0); }\
8688
static inline NS ## buffer_ref_t N ## _create_as_typed_root_with_size(NS ## builder_t *B __ ## N ## _formal_args)\
8789
{ return flatcc_builder_create_buffer(B, TFID, 0,\
88-
N ## _create(B __ ## N ## _call_args), A, flatcc_builder_with_size); }
90+
N ## _create(B __ ## N ## _call_args), A, flatcc_builder_with_size); }\
91+
static inline NS ## buffer_ref_t N ## _clone_as_root(NS ## builder_t *B, N ## _struct_t p)\
92+
{ return flatcc_builder_create_buffer(B, FID, 0, N ## _clone(B, p), A, 0); }\
93+
static inline NS ## buffer_ref_t N ## _clone_as_root_with_size(NS ## builder_t *B, N ## _struct_t p)\
94+
{ return flatcc_builder_create_buffer(B, FID, 0, N ## _clone(B, p), A, flatcc_builder_with_size); }\
95+
static inline NS ## buffer_ref_t N ## _clone_as_typed_root(NS ## builder_t *B, N ## _struct_t p)\
96+
{ return flatcc_builder_create_buffer(B, TFID, 0, N ## _clone(B, p), A, 0); }\
97+
static inline NS ## buffer_ref_t N ## _clone_as_typed_root_with_size(NS ## builder_t *B, N ## _struct_t p)\
98+
{ return flatcc_builder_create_buffer(B, TFID, 0, N ## _clone(B, p), A, flatcc_builder_with_size); }
8999

90100
#define __flatbuffers_build_nested_table_root(NS, N, TN, FID, TFID)\
91101
static inline int N ## _start_as_root(NS ## builder_t *B)\
@@ -169,6 +179,29 @@ static inline N ## _vec_ref_t N ## _vec_slice(NS ## builder_t *B, N ##_vec_t vec
169179
return flatcc_builder_create_vector(B, N ## __const_ptr_add(vec, index), len, S, A, FLATBUFFERS_COUNT_MAX(S)); }\
170180
__flatbuffers_build_vector_ops(NS, N ## _vec, N, N, T)
171181

182+
#define __flatbuffers_build_union_vector_ops(NS, V, N, TN)\
183+
static inline TN ## _union_ref_t *V ## _extend(NS ## builder_t *B, size_t len)\
184+
{ return flatcc_builder_extend_union_vector(B, len); }\
185+
static inline TN ## _union_ref_t *V ## _append(NS ## builder_t *B, const TN ## _union_ref_t *data, size_t len)\
186+
{ return flatcc_builder_append_union_vector(B, data, len); }\
187+
static inline int V ## _truncate(NS ## builder_t *B, size_t len)\
188+
{ return flatcc_builder_truncate_union_vector(B, len); }\
189+
static inline TN ## _union_ref_t *V ## _edit(NS ## builder_t *B)\
190+
{ return flatcc_builder_union_vector_edit(B); }\
191+
static inline size_t V ## _reserved_len(NS ## builder_t *B)\
192+
{ return flatcc_builder_union_vector_count(B); }\
193+
static inline TN ## _union_ref_t *V ## _push(NS ## builder_t *B, const TN ## _union_ref_t ref)\
194+
{ return flatcc_builder_union_vector_push(B, ref); }
195+
196+
#define __flatbuffers_build_union_vector(NS, N)\
197+
static inline int N ## _vec_start(NS ## builder_t *B)\
198+
{ return flatcc_builder_start_union_vector(B); }\
199+
static inline N ## _union_vec_ref_t N ## _vec_end(NS ## builder_t *B)\
200+
{ return flatcc_builder_end_union_vector(B); }\
201+
static inline N ## _union_vec_ref_t N ## _vec_create(NS ## builder_t *B, const N ## _union_ref_t *data, size_t len)\
202+
{ return flatcc_builder_create_union_vector(B, data, len); }\
203+
__flatbuffers_build_union_vector_ops(NS, N ## _vec, N, N)
204+
172205
#define __flatbuffers_build_string_vector_ops(NS, N)\
173206
static inline int N ## _push_start(NS ## builder_t *B)\
174207
{ return NS ## string_start(B); }\
@@ -279,7 +312,7 @@ static inline N ## _t *N ##_to_pe(N ## _t *p)\
279312
{ if (!NS ## is_native_pe()) { N ## _copy_to_pe(p, p); }; return p; }\
280313
static inline N ## _t *N ##_from_pe(N ## _t *p)\
281314
{ if (!NS ## is_native_pe()) { N ## _copy_from_pe(p, p); }; return p; }\
282-
static inline N ## _t *N ## _clear(N ## _t *p) { return memset(p, 0, N ## __size()); }
315+
static inline N ## _t *N ## _clear(N ## _t *p) { return (N ## _t *)memset(p, 0, N ## __size()); }
283316

284317
/* Depends on generated copy/assign_to/from_pe functions, and the type. */
285318
#define __flatbuffers_build_struct(NS, N, S, A, FID, TFID)\
@@ -288,13 +321,16 @@ typedef NS ## ref_t N ## _ref_t;\
288321
static inline N ## _t *N ## _start(NS ## builder_t *B)\
289322
{ return (N ## _t *)flatcc_builder_start_struct(B, S, A); }\
290323
static inline N ## _ref_t N ## _end(NS ## builder_t *B)\
291-
{ if (!NS ## is_native_pe()) { N ## _to_pe(flatcc_builder_struct_edit(B)); }\
324+
{ if (!NS ## is_native_pe()) { N ## _to_pe((N ## _t *)flatcc_builder_struct_edit(B)); }\
292325
return flatcc_builder_end_struct(B); }\
293326
static inline N ## _ref_t N ## _end_pe(NS ## builder_t *B)\
294327
{ return flatcc_builder_end_struct(B); }\
295328
static inline N ## _ref_t N ## _create(NS ## builder_t *B __ ## N ## _formal_args)\
296329
{ N ## _t *_p = N ## _start(B); if (!_p) return 0; N ##_assign_to_pe(_p __ ## N ## _call_args);\
297330
return N ## _end_pe(B); }\
331+
static inline N ## _ref_t N ## _clone(NS ## builder_t *B, N ## _struct_t p)\
332+
{ N ## _t *_p = N ## _start(B); if (!_p) return 0;\
333+
N ## _copy(_p, p); return N ##_end_pe(B); }\
298334
__flatbuffers_build_vector(NS, N, N ## _t, S, A)\
299335
__flatbuffers_build_struct_root(NS, N, A, FID, TFID)
300336

@@ -321,24 +357,52 @@ static inline TN ## _ref_t N ## _create(NS ## builder_t *B __ ## TN ##_formal_ar
321357

322358
#define __flatbuffers_build_union_field(ID, NS, N, TN)\
323359
static inline int N ## _add(NS ## builder_t *B, TN ## _union_ref_t uref)\
324-
{ NS ## ref_t *_p; TN ## _union_type_t *_pt; if (uref.type == TN ## _NONE) return 0; if (uref._member == 0) return -1;\
325-
if (!(_pt = (TN ## _union_type_t *)flatcc_builder_table_add(B, ID - 1, sizeof(*_pt), sizeof(_pt))) ||\
326-
!(_p = flatcc_builder_table_add_offset(B, ID))) return -1; *_pt = uref.type; *_p = uref._member; return 0; }\
360+
{ NS ## ref_t *_p; TN ## _union_type_t *_pt; if (uref.type == TN ## _NONE) return 0; if (uref.member == 0) return -1;\
361+
if (!(_pt = (TN ## _union_type_t *)flatcc_builder_table_add(B, ID - 1, sizeof(*_pt), sizeof(*_pt))) ||\
362+
!(_p = flatcc_builder_table_add_offset(B, ID))) return -1; *_pt = uref.type; *_p = uref.member; return 0; }\
327363
static inline int N ## _add_type(NS ## builder_t *B, TN ## _union_type_t type)\
328364
{ TN ## _union_type_t *_pt; if (type == TN ## _NONE) return 0; return (_pt = (TN ## _union_type_t *)flatcc_builder_table_add(B, ID - 1,\
329365
sizeof(*_pt), sizeof(*_pt))) ? ((*_pt = type), 0) : -1; }\
330366
static inline int N ## _add_member(NS ## builder_t *B, TN ## _union_ref_t uref)\
331367
{ NS ## ref_t *p; if (uref.type == TN ## _NONE) return 0; return (p = flatcc_builder_table_add_offset(B, ID)) ?\
332-
((*p = uref._member), 0) : -1; }
368+
((*p = uref.member), 0) : -1; }
333369

334370
/* M is the union member name and T is its type, i.e. the qualified name. */
335-
#define __flatbuffers_build_union_member_field(NS, N, NU, M, T)\
371+
#define __flatbuffers_build_union_table_member_field(NS, N, NU, M, T)\
336372
static inline int N ## _ ## M ## _add(NS ## builder_t *B, T ## _ref_t ref)\
337373
{ return N ## _add(B, NU ## _as_ ## M (ref)); }\
338374
static inline int N ## _ ## M ## _start(NS ## builder_t *B)\
339375
{ return T ## _start(B); }\
340376
static inline int N ## _ ## M ## _end(NS ## builder_t *B)\
341-
{ return N ## _ ## M ## _add(B, T ## _end(B)); }
377+
{ T ## _ref_t ref = T ## _end(B);\
378+
return ref ? N ## _ ## M ## _add(B, ref) : -1; }\
379+
static inline int N ## _ ## M ## _create(NS ## builder_t *B __ ## T ##_formal_args)\
380+
{ T ## _ref_t ref = T ## _create(B __ ## T ## _call_args);\
381+
return ref ? N ## _add(B, NU ## _as_ ## M(ref)) : -1; }
382+
383+
/* M is the union member name and T is its type, i.e. the qualified name. */
384+
#define __flatbuffers_build_union_struct_member_field(NS, N, NU, M, T)\
385+
static inline int N ## _ ## M ## _add(NS ## builder_t *B, T ## _ref_t ref)\
386+
{ return N ## _add(B, NU ## _as_ ## M (ref)); }\
387+
static inline T ## _t *N ## _ ## M ## _start(NS ## builder_t *B)\
388+
{ return T ## _start(B); }\
389+
static inline int N ## _ ## M ## _end(NS ## builder_t *B)\
390+
{ T ## _ref_t ref = T ## _end(B);\
391+
return ref ? N ## _ ## M ## _add(B, ref) : -1; }\
392+
static inline int N ## _ ## M ## _create(NS ## builder_t *B __ ## T ##_formal_args)\
393+
{ T ## _ref_t ref = T ## _create(B __ ## T ## _call_args);\
394+
return ref ? N ## _add(B, NU ## _as_ ## M(ref)) : -1; }\
395+
static inline int N ## _ ## M ## _end_pe(NS ## builder_t *B)\
396+
{ T ## _ref_t ref = T ## _end_pe(B);\
397+
return ref ? N ## _add(B, NU ## _as_ ## M(ref)) : -1; }\
398+
static inline int N ## _ ## M ## _clone(NS ## builder_t *B, T ## _struct_t p)\
399+
{ T ## _ref_t ref = T ## _clone(B, p);\
400+
return ref ? N ## _add(B, NU ## _as_ ## M(ref)) : -1; }
401+
402+
#define __flatbuffers_build_union_string_member_field(NS, N, NU, M)\
403+
static inline int N ## _ ## M ## _add(NS ## builder_t *B, NS ## string_ref_t ref)\
404+
{ return N ## _add(B, NU ## _as_ ## M (ref)); }\
405+
__flatbuffers_build_string_field_ops(NS, N ## _ ## M)
342406

343407
/* NS: common namespace, ID: table field id (not offset), TN: name of type T,
344408
* S: sizeof of scalar type, A: alignment of type T, default value V of type T. */
@@ -348,13 +412,13 @@ static inline int N ## _add(NS ## builder_t *B, const T v)\
348412
TN ## _assign_to_pe(_p, v); return 0; }\
349413
static inline int N ## _force_add(NS ## builder_t *B, const T v)\
350414
{ T *_p; if (!(_p = (T *)flatcc_builder_table_add(B, ID, S, A))) return -1;\
351-
TN ## _assign_to_pe(_p, v); return 0; }\
415+
TN ## _assign_to_pe(_p, v); return 0; }
352416

353417
#define __flatbuffers_build_struct_field(ID, NS, N, TN, S, A)\
354418
static inline TN ## _t *N ## _start(NS ## builder_t *B)\
355419
{ return (TN ## _t *)flatcc_builder_table_add(B, ID, S, A); }\
356420
static inline int N ## _end(NS ## builder_t *B)\
357-
{ if (!NS ## is_native_pe()) { TN ## _to_pe(flatcc_builder_table_edit(B, S)); } return 0; }\
421+
{ if (!NS ## is_native_pe()) { TN ## _to_pe((TN ## _t *)flatcc_builder_table_edit(B, S)); } return 0; }\
358422
static inline int N ## _end_pe(NS ## builder_t *B) { return 0; }\
359423
static inline int N ## _create(NS ## builder_t *B __ ## TN ## _formal_args)\
360424
{ TN ## _t *_p = N ## _start(B); if (!_p) return 0; TN ##_assign_to_pe(_p __ ## TN ## _call_args);\
@@ -394,9 +458,7 @@ static inline int N ## _create(NS ## builder_t *B, const TN ## _ref_t *data, siz
394458
{ return N ## _add(B, flatcc_builder_create_offset_vector(B, data, len)); }\
395459
__flatbuffers_build_offset_vector_ops(NS, N, N, TN)
396460

397-
#define __flatbuffers_build_string_field(ID, NS, N)\
398-
static inline int N ## _add(NS ## builder_t *B, NS ## string_ref_t ref)\
399-
{ NS ## string_ref_t *_p; return (ref && (_p = flatcc_builder_table_add_offset(B, ID))) ? ((*_p = ref), 0) : -1; }\
461+
#define __flatbuffers_build_string_field_ops(NS, N)\
400462
static inline int N ## _start(NS ## builder_t *B)\
401463
{ return flatcc_builder_start_string(B); }\
402464
static inline int N ## _end(NS ## builder_t *B)\
@@ -413,10 +475,66 @@ static inline int N ## _slice(NS ## builder_t *B, NS ## string_t string, size_t
413475
{ return N ## _add(B, NS ## string_slice(B, string, index, len)); }\
414476
__flatbuffers_build_string_ops(NS, N)
415477

478+
#define __flatbuffers_build_string_field(ID, NS, N)\
479+
static inline int N ## _add(NS ## builder_t *B, NS ## string_ref_t ref)\
480+
{ NS ## string_ref_t *_p; return (ref && (_p = flatcc_builder_table_add_offset(B, ID))) ? ((*_p = ref), 0) : -1; }\
481+
__flatbuffers_build_string_field_ops(NS, N)
482+
416483
#define __flatbuffers_build_table_vector_field(ID, NS, N, TN)\
417484
__flatbuffers_build_offset_vector_field(ID, NS, N, TN)\
418485
__flatbuffers_build_table_vector_ops(NS, N, TN)
419486

487+
#define __flatbuffers_build_union_vector_field(ID, NS, N, TN)\
488+
static inline int N ## _add(NS ## builder_t *B, TN ## _union_vec_ref_t uvref)\
489+
{ NS ## vec_ref_t *_p; if (!uvref.types || !uvref.members) return uvref.types == uvref.members ? 0 : -1;\
490+
if (!(_p = flatcc_builder_table_add_offset(B, ID - 1))) return -1; *_p = uvref.types;\
491+
if (!(_p = flatcc_builder_table_add_offset(B, ID))) return -1; *_p = uvref.members; return 0; }\
492+
static inline int N ## _start(NS ## builder_t *B)\
493+
{ return flatcc_builder_start_union_vector(B); }\
494+
static inline int N ## _end(NS ## builder_t *B)\
495+
{ return N ## _add(B, flatcc_builder_end_union_vector(B)); }\
496+
static inline int N ## _create(NS ## builder_t *B, const TN ## _union_ref_t *data, size_t len)\
497+
{ return N ## _add(B, flatcc_builder_create_union_vector(B, data, len)); }\
498+
__flatbuffers_build_union_vector_ops(NS, N, N, TN)
499+
500+
#define __flatbuffers_build_union_table_vector_member_field(NS, N, NU, M, T)\
501+
static inline int N ## _ ## M ## _push_start(NS ## builder_t *B)\
502+
{ return T ## _start(B); }\
503+
static inline NU ## _union_ref_t *N ## _ ## M ## _push_end(NS ## builder_t *B)\
504+
{ return NU ## _vec_push(B, NU ## _as_ ## M (T ## _end(B))); }\
505+
static inline NU ## _union_ref_t *N ## _ ## M ## _push(NS ## builder_t *B, T ## _ref_t ref)\
506+
{ return NU ## _vec_push(B, NU ## _as_ ## M (ref)); }\
507+
static inline NU ## _union_ref_t *N ## _ ## M ## _push_create(NS ## builder_t *B __ ## T ##_formal_args)\
508+
{ return NU ## _vec_push(B, NU ## _as_ ## M(T ## _create(B __ ## T ## _call_args))); }
509+
510+
#define __flatbuffers_build_union_struct_vector_member_field(NS, N, NU, M, T)\
511+
static inline T ## _t *N ## _ ## M ## _push_start(NS ## builder_t *B)\
512+
{ return T ## _start(B); }\
513+
static inline NU ## _union_ref_t *N ## _ ## M ## _push_end(NS ## builder_t *B)\
514+
{ return NU ## _vec_push(B, NU ## _as_ ## M (T ## _end(B))); }\
515+
static inline NU ## _union_ref_t *N ## _ ## M ## _push(NS ## builder_t *B, T ## _ref_t ref)\
516+
{ return NU ## _vec_push(B, NU ## _as_ ## M (ref)); }\
517+
static inline NU ## _union_ref_t *N ## _ ## M ## _push_create(NS ## builder_t *B __ ## T ##_formal_args)\
518+
{ return NU ## _vec_push(B, NU ## _as_ ## M(T ## _create(B __ ## T ## _call_args))); }
519+
520+
#define __flatbuffers_build_union_string_vector_member_field(NS, N, NU, M)\
521+
static inline NU ## _union_ref_t *N ## _ ## M ## _push(NS ## builder_t *B, NS ## string_ref_t ref)\
522+
{ return NU ## _vec_push(B, NU ## _as_ ## M (ref)); }\
523+
static inline int N ## _ ## M ## _push_start(NS ## builder_t *B)\
524+
{ return NS ## string_start(B); }\
525+
static inline NU ## _union_ref_t *N ## _ ## M ## _push_end(NS ## builder_t *B)\
526+
{ return NU ## _vec_push(B, NU ## _as_ ## M(NS ## string_end(B))); }\
527+
static inline NU ## _union_ref_t *N ## _ ## M ## _push_create(NS ## builder_t *B, const char *s, size_t len)\
528+
{ return NU ## _vec_push(B, NU ## _as_ ## M(NS ## string_create(B, s, len))); }\
529+
static inline NU ## _union_ref_t *N ## _ ## M ## _push_create_str(NS ## builder_t *B, const char *s)\
530+
{ return NU ## _vec_push(B, NU ## _as_ ## M(NS ## string_create_str(B, s))); }\
531+
static inline NU ## _union_ref_t *N ## _ ## M ## _push_create_strn(NS ## builder_t *B, const char *s, size_t max_len)\
532+
{ return NU ## _vec_push(B, NU ## _as_ ## M(NS ## string_create_strn(B, s, max_len))); }\
533+
static inline NU ## _union_ref_t *N ## _ ## M ## _push_clone(NS ## builder_t *B, NS ## string_t string)\
534+
{ return NU ## _vec_push(B, NU ## _as_ ## M(NS ## string_clone(B, string))); }\
535+
static inline NU ## _union_ref_t *N ## _ ## M ## _push_slice(NS ## builder_t *B, NS ## string_t string, size_t index, size_t len)\
536+
{ return NU ## _vec_push(B, NU ## _as_ ## M(NS ## string_slice(B, string, index, len))); }
537+
420538
#define __flatbuffers_build_string_vector_field(ID, NS, N)\
421539
__flatbuffers_build_offset_vector_field(ID, NS, N, NS ## string)\
422540
__flatbuffers_build_string_vector_ops(NS, N)

0 commit comments

Comments
 (0)