Skip to content
Permalink
Browse files

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>
  • Loading branch information...
mrfuchs authored and andrewboie committed Jul 18, 2019
1 parent f1afb4c commit 779381b5fc1152040ae0af25bb90505546941b34
Showing with 19 additions and 5 deletions.
  1. +11 −5 include/data/json.h
  2. +8 −0 include/data/jwt.h
@@ -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

/**
* @}
*/
@@ -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

/**
* @}
*/

0 comments on commit 779381b

Please sign in to comment.
You can’t perform that action at this time.