diff options
author | Anthony G. Basile <blueness@gentoo.org> | 2014-10-21 09:31:07 -0400 |
---|---|---|
committer | Anthony G. Basile <blueness@gentoo.org> | 2014-10-21 09:39:34 -0400 |
commit | 4a08517cac3c68c232694db7288654b58b68b8ba (patch) | |
tree | 6300888d57d20204bea758bedcaf9e7130fb150a | |
parent | 9bf789f78890c8b5879d29acb9fb0e23285baee4 (diff) |
einfo.h, rc.h.in: ensure __BEGIN_DECLS is defined
Some Standard C Libraries, like musl, don't define __BEGIN_DECLS
or __END_DECLS. We add some ifdef magic to ensure these are
available.
-rw-r--r-- | src/libeinfo/einfo.h | 10 | ||||
-rw-r--r-- | src/librc/rc.h.in | 10 |
2 files changed, 20 insertions, 0 deletions
diff --git a/src/libeinfo/einfo.h b/src/libeinfo/einfo.h index 31a891f8..8fe56497 100644 --- a/src/libeinfo/einfo.h +++ b/src/libeinfo/einfo.h @@ -48,6 +48,16 @@ # endif #endif +#undef __BEGIN_DECLS +#undef __END_DECLS +#ifdef __cplusplus +# define __BEGIN_DECLS extern "C" { +# define __END_DECLS } +#else +# define __BEGIN_DECLS /* empty */ +# define __END_DECLS /* empty */ +#endif + __BEGIN_DECLS /*! @brief Color types to use */ diff --git a/src/librc/rc.h.in b/src/librc/rc.h.in index c2a919fc..5cd584f0 100644 --- a/src/librc/rc.h.in +++ b/src/librc/rc.h.in @@ -31,6 +31,16 @@ #include <stdbool.h> #include <stdio.h> +#undef __BEGIN_DECLS +#undef __END_DECLS +#ifdef __cplusplus +# define __BEGIN_DECLS extern "C" { +# define __END_DECLS } +#else +# define __BEGIN_DECLS /* empty */ +# define __END_DECLS /* empty */ +#endif + __BEGIN_DECLS #define RC_PREFIX "@PREFIX@" |