summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
Diffstat (limited to 'builtin')
-rw-r--r--builtin/assert.h8
-rw-r--r--builtin/endian.h7
-rw-r--r--builtin/string.h8
3 files changed, 23 insertions, 0 deletions
diff --git a/builtin/assert.h b/builtin/assert.h
index 6ee2ac1b20..a2a5dd0228 100644
--- a/builtin/assert.h
+++ b/builtin/assert.h
@@ -11,6 +11,10 @@
#include "common.h"
#endif
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#ifdef CONFIG_DEBUG_ASSERT
#ifdef CONFIG_DEBUG_ASSERT_REBOOTS
@@ -46,4 +50,8 @@ extern void panic_assert_fail(const char *msg, const char *func,
#define assert(x...) ASSERT(x)
#endif
+#ifdef __cplusplus
+}
+#endif
+
#endif /* __CROS_EC_ASSERT_H__ */
diff --git a/builtin/endian.h b/builtin/endian.h
index b27b7cd496..8a50cb4815 100644
--- a/builtin/endian.h
+++ b/builtin/endian.h
@@ -8,6 +8,10 @@
#include <stdint.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/*
* Functions to convert byte order in various sized big endian integers to
* host byte order. Note that the code currently does not require functions
@@ -34,5 +38,8 @@ static inline uint64_t be64toh(uint64_t in)
#endif /* __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ */
+#ifdef __cplusplus
+}
+#endif
#endif /* __EC_BUILTIN_ENDIAN_H */
diff --git a/builtin/string.h b/builtin/string.h
index 21159a5eef..8c9a71bd75 100644
--- a/builtin/string.h
+++ b/builtin/string.h
@@ -10,6 +10,10 @@
#include <stddef.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
int memcmp(const void *s1, const void *s2, size_t len);
void *memcpy(void *dest, const void *src, size_t len);
void *memmove(void *dest, const void *src, size_t n);
@@ -20,4 +24,8 @@ size_t strnlen(const char *s, size_t maxlen);
char *strncpy(char *dest, const char *src, size_t n);
int strncmp(const char *s1, const char *s2, size_t n);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* __CROS_EC_STRINGS_H__ */