From 3d4652613c6d2beea8e0dd90f12612fad8eec4d8 Mon Sep 17 00:00:00 2001 From: Nicolas Norvez Date: Thu, 15 Nov 2018 14:17:29 -0800 Subject: headers: make EC commands headers C++-friendly - wrap headers in 'extern "C"' - use relative path to #include BRANCH=None BUG=chromium:889250 TEST=make buildall -j TEST=emerge-nocturne ec-utils Change-Id: I67d8ba88edf77f72bd54500eff169537ffb6257f Signed-off-by: Nicolas Norvez Reviewed-on: https://chromium-review.googlesource.com/1338599 Reviewed-by: Randall Spangler Reviewed-by: Mike Frysinger --- include/ec_commands.h | 8 ++++++++ util/cros_ec_dev.h | 10 +++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/include/ec_commands.h b/include/ec_commands.h index 736b3bc805..d0b272e8a8 100644 --- a/include/ec_commands.h +++ b/include/ec_commands.h @@ -12,6 +12,10 @@ #include #endif +#ifdef __cplusplus +extern "C"{ +#endif + /* * Include common.h for CONFIG_HOSTCMD_ALIGNED, if it's defined. This * generates more efficient code for accessing request/response structures on @@ -5474,4 +5478,8 @@ struct ec_params_charger_control { #endif /* !__ACPI__ */ +#ifdef __cplusplus +} +#endif + #endif /* __CROS_EC_EC_COMMANDS_H */ diff --git a/util/cros_ec_dev.h b/util/cros_ec_dev.h index 7ff87aed9a..85132a8051 100644 --- a/util/cros_ec_dev.h +++ b/util/cros_ec_dev.h @@ -8,7 +8,11 @@ #include #include -#include "include/ec_commands.h" +#include "ec_commands.h" + +#ifdef __cplusplus +extern "C" { +#endif #define CROS_EC_DEV_NAME "cros_ec" #define CROS_EC_DEV_VERSION "1.0.0" @@ -87,4 +91,8 @@ struct cros_ec_readmem_v2 { struct cros_ec_readmem_v2) #define CROS_EC_DEV_IOCEVENTMASK_V2 _IO(CROS_EC_DEV_IOC_V2, 2) +#ifdef __cplusplus +} +#endif + #endif /* __UTIL_CROS_EC_DEV_H */ -- cgit v1.2.1