Skip to content

Commit 25ea8af

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

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
@@ -463,6 +463,9 @@ CBOR_INLINE_API CborError cbor_value_get_double(const CborValue *value, double *
463463
return CborNoError;
464464
}
465465

466+
/* The following API requires a hosted C implementation (uses FILE*) */
467+
#if !defined(__STDC_HOSTED__) || __STDC_HOSTED__-0 == 1
468+
466469
/* Human-readable (dump) API */
467470
CBOR_API CborError cbor_value_to_pretty_advance(FILE *out, CborValue *value);
468471
CBOR_INLINE_API CborError cbor_value_to_pretty(FILE *out, const CborValue *value)
@@ -471,6 +474,8 @@ CBOR_INLINE_API CborError cbor_value_to_pretty(FILE *out, const CborValue *value
471474
return cbor_value_to_pretty_advance(out, &copy);
472475
}
473476

477+
#endif /* __STDC_HOSTED__ check */
478+
474479
#ifdef __cplusplus
475480
}
476481
#endif

0 commit comments

Comments
 (0)