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:
Markus Fuchs 2019-07-18 19:12:01 +02:00 committed by Andrew Boie
commit 779381b5fc
2 changed files with 19 additions and 5 deletions

View file

@ -7,7 +7,14 @@
#ifndef 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
@ -21,11 +28,6 @@
* @{
*/
#include <sys/util.h>
#include <stddef.h>
#include <zephyr/types.h>
#include <sys/types.h>
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
/**
* @}
*/

View file

@ -10,6 +10,10 @@
#include <zephyr/types.h>
#include <stdbool.h>
#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
/**
* @}
*/