include/err: Enforce c linkage for err and warn functions.
This change ensures that xx_func names are not mangled by a c++ compiler and can be correctly resolved when loaded at runtime.
This commit is contained in:
parent
f7d64fec9f
commit
a9fc76c848
1 changed files with 13 additions and 0 deletions
|
|
@ -32,6 +32,14 @@
|
||||||
* Pre-processor Definitions
|
* 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 */
|
/* Append _func suffix to avoid the penitential symbol collision */
|
||||||
|
|
||||||
#define warn warn_func
|
#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 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);
|
void verrx(int status, FAR const char *fmt, va_list ap) printf_like(2, 0);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
#undef EXTERN
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* __INCLUDE_ERR_H */
|
#endif /* __INCLUDE_ERR_H */
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue