public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] libelf: remove usage of sys/cdefs
@ 2020-04-05 23:00 Rosen Penev
  2020-04-05 23:39 ` Mark Wielaard
  0 siblings, 1 reply; 3+ messages in thread
From: Rosen Penev @ 2020-04-05 23:00 UTC (permalink / raw)
  To: elfutils-devel

sys/cdefs is a deprecated glibc header that is unavailable with other
libc implementations such as musl.

features.h under glibc includes sys/cdefs whereas it does not under musl.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
 lib/fixedsizehash.h |  1 -
 libelf/elf.h        | 10 ++++++----
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/lib/fixedsizehash.h b/lib/fixedsizehash.h
index dac2a5f5..43016fc3 100644
--- a/lib/fixedsizehash.h
+++ b/lib/fixedsizehash.h
@@ -30,7 +30,6 @@
 #include <errno.h>
 #include <stdlib.h>
 #include <string.h>
-#include <sys/cdefs.h>
 
 #include <system.h>
 
diff --git a/libelf/elf.h b/libelf/elf.h
index 01648bdb..d36fb806 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.  */
 
@@ -4007,6 +4007,8 @@ enum
 #define R_NDS32_TLS_TPOFF	102
 #define R_NDS32_TLS_DESC	119
 
-__END_DECLS
+#ifdef __cplusplus
+}
+#endif
 
 #endif	/* elf.h */
-- 
2.25.1


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

* Re: [PATCH] libelf: remove usage of sys/cdefs
  2020-04-05 23:00 [PATCH] libelf: remove usage of sys/cdefs Rosen Penev
@ 2020-04-05 23:39 ` Mark Wielaard
  2020-04-05 23:43   ` Rosen Penev
  0 siblings, 1 reply; 3+ messages in thread
From: Mark Wielaard @ 2020-04-05 23:39 UTC (permalink / raw)
  To: Rosen Penev; +Cc: elfutils-devel

Hi,

Thanks for the patch, but elf.h comes from glibc.  So please get your
fix accepted upstream (sent it to libc-alpha@sourceware.org) and we'll
pick it up next time we sync with the glibc code.

Thanks,

Mark

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

* Re: [PATCH] libelf: remove usage of sys/cdefs
  2020-04-05 23:39 ` Mark Wielaard
@ 2020-04-05 23:43   ` Rosen Penev
  0 siblings, 0 replies; 3+ messages in thread
From: Rosen Penev @ 2020-04-05 23:43 UTC (permalink / raw)
  To: Mark Wielaard; +Cc: elfutils-devel

On Sun, Apr 5, 2020 at 4:39 PM Mark Wielaard <mark@klomp.org> wrote:
>
> Hi,
>
> Thanks for the patch, but elf.h comes from glibc.  So please get your
> fix accepted upstream (sent it to libc-alpha@sourceware.org) and we'll
> pick it up next time we sync with the glibc code.
Hrm OK.
>
> Thanks,
>
> Mark

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

end of thread, other threads:[~2020-04-05 23:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-05 23:00 [PATCH] libelf: remove usage of sys/cdefs Rosen Penev
2020-04-05 23:39 ` Mark Wielaard
2020-04-05 23:43   ` Rosen Penev

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).