debuginfod: Make sure there is only one typedef for debuginfod_client
authorMark Wielaard <mark@klomp.org>
Mon, 6 Feb 2023 09:21:58 +0000 (10:21 +0100)
committerMark Wielaard <mark@klomp.org>
Mon, 6 Feb 2023 09:21:58 +0000 (10:21 +0100)
Both debuginfod.h and libdwfl.h have a simple typedef for struct
debuginfod_client. Some compilers pedantically warn when including
both headers that such typedefs are only officially supported in
C11. So guard them with _ELFUTILS_DEBUGINFOD_CLIENT_TYPEDEF to
make them happy.

https://sourceware.org/bugzilla/show_bug.cgi?id=30077

Signed-off-by: Mark Wielaard <mark@klomp.org>
debuginfod/ChangeLog
debuginfod/debuginfod.h.in
libdwfl/ChangeLog
libdwfl/libdwfl.h

index fc44e03..fe368c4 100644 (file)
@@ -1,3 +1,8 @@
+2023-02-06  Mark Wielaard  <mark@klomp.org>
+
+       * debuginfod.h.in: Guard debuginfod_client typedef with
+       _ELFUTILS_DEBUGINFOD_CLIENT_TYPEDEF.
+
 2023-01-10  Mark Wielaard  <mark@klomp.org>
 
        * debuginfod-client.c (debuginfod_query_server): Use
index 69c9efd..4a256ba 100644 (file)
 #define DEBUGINFOD_SONAME "@LIBDEBUGINFOD_SONAME@"
 
 /* Handle for debuginfod-client connection.  */
+#ifndef _ELFUTILS_DEBUGINFOD_CLIENT_TYPEDEF
 typedef struct debuginfod_client debuginfod_client;
+#define _ELFUTILS_DEBUGINFOD_CLIENT_TYPEDEF 1
+#endif
 
 #ifdef __cplusplus
 extern "C" {
index 9cd2f03..daef282 100644 (file)
@@ -1,3 +1,8 @@
+2023-02-06  Mark Wielaard  <mark@klomp.org>
+
+       * libdwfl.h: Guard debuginfod_client typedef with
+       _ELFUTILS_DEBUGINFOD_CLIENT_TYPEDEF.
+
 2022-12-21  Mark Wielaard  <mark@klomp.org>
 
        * core-file.c: Don't undef _.
index 9114f7f..49ad666 100644 (file)
@@ -50,7 +50,10 @@ typedef struct Dwfl_Thread Dwfl_Thread;
 typedef struct Dwfl_Frame Dwfl_Frame;
 
 /* Handle for debuginfod-client connection.  */
+#ifndef _ELFUTILS_DEBUGINFOD_CLIENT_TYPEDEF
 typedef struct debuginfod_client debuginfod_client;
+#define _ELFUTILS_DEBUGINFOD_CLIENT_TYPEDEF 1
+#endif
 
 /* Callbacks.  */
 typedef struct