diff --git a/include/err.h b/include/err.h index aa748183cd..fec7f2729f 100644 --- a/include/err.h +++ b/include/err.h @@ -32,6 +32,14 @@ * Pre-processor Definitions ****************************************************************************/ +#ifdef __cplusplus +#define EXTERN extern "C" +extern "C" +{ +#else +#define EXTERN extern +#endif + /* Append _func suffix to avoid the penitential symbol collision */ #define warn warn_func @@ -67,4 +75,9 @@ void verr(int status, FAR const char *fmt, va_list ap) printf_like(2, 0); void errx(int status, FAR const char *fmt, ...) printf_like(2, 3); void verrx(int status, FAR const char *fmt, va_list ap) printf_like(2, 0); +#ifdef __cplusplus +#undef EXTERN +} +#endif + #endif /* __INCLUDE_ERR_H */