diff options
| author | ShengYi Hung <aokblast@FreeBSD.org> | 2025-09-07 18:33:01 +0000 |
|---|---|---|
| committer | Ka Ho Ng <khng@FreeBSD.org> | 2025-09-07 18:33:01 +0000 |
| commit | 11ace56fa030185025936c795d5cf7c57b266835 (patch) | |
| tree | c088bb48f7b8c5683ed1bd93cf298bcf33f52d5d | |
| parent | 6d624634ac1d28e89568e7f2be0df08ea7c7471c (diff) | |
contrib/libxo: fix API header files inclusions in C++ source files
C++ source files need `extern "C"` to disable C++ name mangling.
MFC after: 1 week
Reviewed by: aokblast (previous version), phil, imp (previous version)
Differential Revision: https://reviews.freebsd.org/D47930
| -rw-r--r-- | contrib/libxo/libxo/xo.h | 8 | ||||
| -rw-r--r-- | contrib/libxo/libxo/xo_encoder.h | 8 |
2 files changed, 16 insertions, 0 deletions
diff --git a/contrib/libxo/libxo/xo.h b/contrib/libxo/libxo/xo.h index 6a61a16c7cae..7f37b469b54e 100644 --- a/contrib/libxo/libxo/xo.h +++ b/contrib/libxo/libxo/xo.h @@ -27,6 +27,10 @@ #include <stdlib.h> #include <errno.h> +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + #ifdef __dead2 #define NORETURN __dead2 #else @@ -699,4 +703,8 @@ xo_retain_clear_all (void); void xo_retain_clear (const char *fmt); +#ifdef __cplusplus +} +#endif /* __cplusplus */ + #endif /* INCLUDE_XO_H */ diff --git a/contrib/libxo/libxo/xo_encoder.h b/contrib/libxo/libxo/xo_encoder.h index 099248ae13a6..bb57194ab030 100644 --- a/contrib/libxo/libxo/xo_encoder.h +++ b/contrib/libxo/libxo/xo_encoder.h @@ -20,6 +20,10 @@ #include <string.h> +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + /* * Expose libxo's memory allocation functions */ @@ -167,4 +171,8 @@ xo_encoder_op_name (xo_encoder_op_t op); void xo_failure (xo_handle_t *xop, const char *fmt, ...); +#ifdef __cplusplus +} +#endif /* __cplusplus */ + #endif /* XO_ENCODER_H */ |
