commit:     a634534167f4fb66464568a837ba22a5e0c97410
Author:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
AuthorDate: Wed Oct 22 11:46:49 2014 +0000
Commit:     William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Fri Oct 24 15:59:15 2014 +0000
URL:        
http://sources.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=a6345341

einfo.h, rc.h.in: simplify __BEGIN_DECLS logic

There is no need to redefine __BEGIN_DECLS and __END_DECLS.
We simplify the logic here and avoid undefining these macros.

---
 src/libeinfo/einfo.h | 17 +++++++----------
 src/librc/rc.h.in    | 17 +++++++----------
 2 files changed, 14 insertions(+), 20 deletions(-)

diff --git a/src/libeinfo/einfo.h b/src/libeinfo/einfo.h
index 8fe5649..c0325c2 100644
--- a/src/libeinfo/einfo.h
+++ b/src/libeinfo/einfo.h
@@ -48,18 +48,11 @@
 # endif
 #endif
 
-#undef __BEGIN_DECLS
-#undef __END_DECLS
+/* __BEGIN_DECLS */
 #ifdef __cplusplus
-# define __BEGIN_DECLS extern "C" {
-# define __END_DECLS }
-#else
-# define __BEGIN_DECLS /* empty */
-# define __END_DECLS /* empty */
+extern "C" {
 #endif
 
-__BEGIN_DECLS
-
 /*! @brief Color types to use */
 typedef enum
 {
@@ -150,5 +143,9 @@ void eoutdentv(void);
 /*! @brief Prefix each einfo line with something */
 void eprefix(const char * EINFO_RESTRICT);
 
-__END_DECLS
+/* __END_DECLS */
+#ifdef __cplusplus
+}
+#endif
+
 #endif

diff --git a/src/librc/rc.h.in b/src/librc/rc.h.in
index 5cd584f..5ef8d7f 100644
--- a/src/librc/rc.h.in
+++ b/src/librc/rc.h.in
@@ -31,18 +31,11 @@
 #include <stdbool.h>
 #include <stdio.h>
 
-#undef __BEGIN_DECLS
-#undef __END_DECLS
+/* __BEGIN_DECLS */
 #ifdef __cplusplus
-# define __BEGIN_DECLS extern "C" {
-# define __END_DECLS }
-#else
-# define __BEGIN_DECLS /* empty */
-# define __END_DECLS /* empty */
+extern "C" {
 #endif
 
-__BEGIN_DECLS
-
 #define RC_PREFIX "@PREFIX@"
 #define RC_SYSCONFDIR          "@SYSCONFDIR@"
 #define RC_LIBDIR               "@PREFIX@/@LIB@/rc"
@@ -573,5 +566,9 @@ bool rc_getfile(const char *, char **, size_t *);
  * we have our own */
 ssize_t rc_getline(char **, size_t *, FILE *);
 
-__END_DECLS
+/* __END_DECLS */
+#ifdef __cplusplus
+}
+#endif
+
 #endif

Reply via email to