include: data: add missing __cplusplus checks
This patch adds `extern "C"` linkage directives so the header files can be included by C++ source files. Signed-off-by: Markus Fuchs <markus.fuchs@de.sauter-bc.com>
This commit is contained in:
parent
f1afb4c24d
commit
779381b5fc
2 changed files with 19 additions and 5 deletions
|
@ -7,7 +7,14 @@
|
||||||
#ifndef ZEPHYR_INCLUDE_DATA_JSON_H_
|
#ifndef ZEPHYR_INCLUDE_DATA_JSON_H_
|
||||||
#define ZEPHYR_INCLUDE_DATA_JSON_H_
|
#define ZEPHYR_INCLUDE_DATA_JSON_H_
|
||||||
|
|
||||||
|
#include <sys/util.h>
|
||||||
|
#include <stddef.h>
|
||||||
|
#include <zephyr/types.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Structured Data
|
* @brief Structured Data
|
||||||
|
@ -21,11 +28,6 @@
|
||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/util.h>
|
|
||||||
#include <stddef.h>
|
|
||||||
#include <zephyr/types.h>
|
|
||||||
#include <sys/types.h>
|
|
||||||
|
|
||||||
enum json_tokens {
|
enum json_tokens {
|
||||||
/* Before changing this enum, ensure that its maximum
|
/* Before changing this enum, ensure that its maximum
|
||||||
* value is still within 7 bits. See comment next to the
|
* 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,
|
const void *val, json_append_bytes_t append_bytes,
|
||||||
void *data);
|
void *data);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @}
|
* @}
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -10,6 +10,10 @@
|
||||||
#include <zephyr/types.h>
|
#include <zephyr/types.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief JSON Web Token (JWT)
|
* @brief JSON Web Token (JWT)
|
||||||
* @defgroup jwt 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);
|
return (builder->buf - builder->base);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @}
|
* @}
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue