This is the mail archive of the
elfutils-devel@sourceware.org
mailing list for the elfutils project.
[PATCH] Drop __BEGIN_DECLS and __END_DECLS from elf.h
- From: Ulf Hermann <ulf dot hermann at qt dot io>
- To: <elfutils-devel at sourceware dot org>
- Date: Wed, 3 May 2017 18:03:53 +0200
- Subject: [PATCH] Drop __BEGIN_DECLS and __END_DECLS from elf.h
- Authentication-results: sourceware.org; auth=none
- Authentication-results: sourceware.org; dkim=none (message not signed) header.d=none;sourceware.org; dmarc=none action=none header.from=qt.io;
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qtcompany.onmicrosoft.com; s=selector1-qt-io; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=K0Wf9C9f9sFYPpmzy6Qf6phLGdQaXGgZsOXuibgpCmI=; b=jZGkzqgZl81MHI+z+qZ8MppLYwK/iBYcZl8ypk6LDN32hyeyuyxAugK9W2fnvMvaX9NeSWikx+CDKnjlkz6/itfiWqT4IiAXgflFT1EdJNx/7bBrmhMrMURcSn3gEUVow7fPb+fPYM2g0B7xNZH7upDoem3SwmwcRMtz81V3fR4=
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
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