public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
From: Ulf Hermann <ulf.hermann@qt.io>
To: <elfutils-devel@sourceware.org>
Subject: [PATCH] Drop __BEGIN_DECLS and __END_DECLS from elf.h
Date: Wed, 03 May 2017 16:52:00 -0000	[thread overview]
Message-ID: <253cf7c9-2244-2b79-ba80-e90a6214e57d@qt.io> (raw)

We don't use those anywhere else and they are not guaranteed to be
defined. Also, put the 'extern "C"' after the included headers.

Signed-off-by: Ulf Hermann <ulf.hermann@qt.io>
---
 libelf/ChangeLog |  4 ++++
 libelf/elf.h     | 10 +++++++---
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/libelf/ChangeLog b/libelf/ChangeLog
index e947e19..40a2876 100644
--- a/libelf/ChangeLog
+++ b/libelf/ChangeLog
@@ -1,3 +1,7 @@
+2017-05-03  Ulf Hermann  <ulf.hermann@qt.io>
+
+	* elf.h: Replace __BEGIN_DECLS and __END_DECLS with extern "C".
+
 2017-02-28  Ulf Hermann  <ulf.hermann@qt.io>
 
 	* Makefile.am: Use the predefined common library names rather than
diff --git a/libelf/elf.h b/libelf/elf.h
index b6112d9..ba385d3 100644
--- a/libelf/elf.h
+++ b/libelf/elf.h
@@ -21,12 +21,14 @@
 
 #include <features.h>
 
-__BEGIN_DECLS
-
 /* Standard ELF types.  */
 
 #include <stdint.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /* Type for a 16-bit quantity.  */
 typedef uint16_t Elf32_Half;
 typedef uint16_t Elf64_Half;
@@ -3682,6 +3684,8 @@ enum
 #define R_BPF_NONE		0	/* No reloc */
 #define R_BPF_MAP_FD		1	/* Map fd to pointer */
 
-__END_DECLS
+#ifdef __cplusplus
+}
+#endif
 
 #endif	/* elf.h */
-- 
2.1.4

             reply	other threads:[~2017-05-03 16:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-03 16:52 Ulf Hermann [this message]
2017-05-05 13:16 ` 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=253cf7c9-2244-2b79-ba80-e90a6214e57d@qt.io \
    --to=ulf.hermann@qt.io \
    --cc=elfutils-devel@sourceware.org \
    /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).