public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
From: "Érico Nogueira" <ericonr@disroot.org>
To: elfutils-devel@sourceware.org
Cc: "Érico Rolim" <erico.erc@gmail.com>
Subject: [PATCH] Don't use __BEGIN_DECLS macros from glibc.
Date: Mon, 26 Oct 2020 17:44:24 -0300	[thread overview]
Message-ID: <20201026204424.5648-1-ericonr@disroot.org> (raw)

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


             reply	other threads:[~2020-10-26 20:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-26 20:44 Érico Nogueira [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201026204424.5648-1-ericonr@disroot.org \
    --to=ericonr@disroot.org \
    --cc=elfutils-devel@sourceware.org \
    --cc=erico.erc@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).