Skip to content

Commit 33a563f

Browse files
Hide the API using FILE* from freestanding C implementations
Signed-off-by: Thiago Macieira <[email protected]>
1 parent d9a8d83 commit 33a563f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/cbor.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,9 @@ enum CborValidationFlags {
536536

537537
CBOR_API CborError cbor_value_validate(const CborValue *it, int flags);
538538

539+
/* The following API requires a hosted C implementation (uses FILE*) */
540+
#if !defined(__STDC_HOSTED__) || __STDC_HOSTED__-0 == 1
541+
539542
/* Human-readable (dump) API */
540543

541544
enum CborPrettyFlags {
@@ -559,6 +562,8 @@ CBOR_INLINE_API CborError cbor_value_to_pretty(FILE *out, const CborValue *value
559562
return cbor_value_to_pretty_advance_flags(out, &copy, CborPrettyDefaultFlags);
560563
}
561564

565+
#endif /* __STDC_HOSTED__ check */
566+
562567
#ifdef __cplusplus
563568
}
564569
#endif

0 commit comments

Comments
 (0)