diff --git a/include/data/json.h b/include/data/json.h index f810e2de6fa..6b57cb68c5f 100644 --- a/include/data/json.h +++ b/include/data/json.h @@ -7,7 +7,14 @@ #ifndef ZEPHYR_INCLUDE_DATA_JSON_H_ #define ZEPHYR_INCLUDE_DATA_JSON_H_ +#include +#include +#include +#include +#ifdef __cplusplus +extern "C" { +#endif /** * @brief Structured Data @@ -21,11 +28,6 @@ * @{ */ -#include -#include -#include -#include - enum json_tokens { /* Before changing this enum, ensure that its maximum * value is still within 7 bits. See comment next to the @@ -632,6 +634,10 @@ int json_obj_encode(const struct json_obj_descr *descr, size_t descr_len, const void *val, json_append_bytes_t append_bytes, void *data); +#ifdef __cplusplus +} +#endif + /** * @} */ diff --git a/include/data/jwt.h b/include/data/jwt.h index bb8901eaf4d..547e2f42fa4 100644 --- a/include/data/jwt.h +++ b/include/data/jwt.h @@ -10,6 +10,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + /** * @brief JSON Web Token (JWT) * @defgroup jwt JSON Web Token (JWT) @@ -89,6 +93,10 @@ static inline size_t jwt_payload_len(struct jwt_builder *builder) return (builder->buf - builder->base); } +#ifdef __cplusplus +} +#endif + /** * @} */