public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Don't use __BEGIN_DECLS macros from glibc.
@ 2020-10-26 20:44 Érico Nogueira
  2020-10-26 20:58 ` Dmitry V. Levin
  0 siblings, 1 reply; 5+ messages in thread
From: Érico Nogueira @ 2020-10-26 20:44 UTC (permalink / raw)
  To: elfutils-devel; +Cc: Érico Rolim

From: Érico Rolim <erico.erc@gmail.com>

These macros are mostly internal to glibc and require the inclusion of
<sys/cdefs.h> (here included indirectly via <features.h>), which isn't a
standard header.

Since they are only required once, replacing them with their definition
is simple.

Signed-off-by: Érico Rolim <erico.erc@gmail.com>
---
 libelf/elf.h | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/libelf/elf.h b/libelf/elf.h
index ff9f1dad..38391392 100644
--- a/libelf/elf.h
+++ b/libelf/elf.h
@@ -19,9 +19,9 @@
 #ifndef _ELF_H
 #define	_ELF_H 1
 
-#include <features.h>
-
-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
 
 /* Standard ELF types.  */
 
@@ -4105,6 +4105,8 @@ enum
 #define R_ARC_TLS_LE_S9		0x4a
 #define R_ARC_TLS_LE_32		0x4b
 
-__END_DECLS
+#ifdef __cplusplus
+}
+#endif
 
 #endif	/* elf.h */
-- 
2.29.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-10-28 11:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-26 20:44 [PATCH] Don't use __BEGIN_DECLS macros from glibc Érico Nogueira
2020-10-26 20:58 ` Dmitry V. Levin
2020-10-26 21:34   ` Érico Nogueira
2020-10-26 22:24     ` Mark Wielaard
2020-10-28 11:46       ` Mark Wielaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).