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.herm...@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.herm...@qt.io> + + * elf.h: Replace __BEGIN_DECLS and __END_DECLS with extern "C". + 2017-02-28 Ulf Hermann <ulf.herm...@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