diff mbox series

debuginfod: fix compilation on platforms without <error.h>

Message ID 20211111001748.4977-1-ericonr@disroot.org
State Committed
Headers show
Series debuginfod: fix compilation on platforms without <error.h> | expand

Commit Message

Érico Nogueira Nov. 11, 2021, 12:17 a.m. UTC
From: Érico Nogueira <erico.erc@gmail.com>

"system.h" only declares the error() function, so it needs to be in an
'extern "C"' block, otherwise linking fails.

Since we are here, use quotes for "system.h" header, since it's a local
header, not a system one.

Signed-off-by: Érico Nogueira <erico.erc@gmail.com>
---
 debuginfod/ChangeLog      | 4 ++++
 debuginfod/debuginfod.cxx | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

Comments

Mark Wielaard Nov. 11, 2021, 8:20 a.m. UTC | #1
Hi Érico,

On Wed, Nov 10, 2021 at 09:17:48PM -0300, Érico Nogueira via Elfutils-devel wrote:
> "system.h" only declares the error() function, so it needs to be in an
> 'extern "C"' block, otherwise linking fails.
> 
> Since we are here, use quotes for "system.h" header, since it's a local
> header, not a system one.

Thanks, applied.

Cheers,

Mark
diff mbox series

Patch

diff --git a/debuginfod/ChangeLog b/debuginfod/ChangeLog
index f06d3ee3..822bd637 100644
--- a/debuginfod/ChangeLog
+++ b/debuginfod/ChangeLog
@@ -1,3 +1,7 @@ 
+2021-11-10  Érico N. Rolim  <erico.erc@gmail.com>
+
+	* debuginfod.cxx: include "system.h" under 'extern "C"' block.
+
 2021-11-05  Frank Ch. Eigler  <fche@redhat.com>
 
 	PR28430
diff --git a/debuginfod/debuginfod.cxx b/debuginfod/debuginfod.cxx
index 521cb529..764e7b94 100644
--- a/debuginfod/debuginfod.cxx
+++ b/debuginfod/debuginfod.cxx
@@ -33,11 +33,11 @@ 
 
 extern "C" {
 #include "printversion.h"
+#include "system.h"
 }
 
 #include "debuginfod.h"
 #include <dwarf.h>
-#include <system.h>
 
 #include <argp.h>
 #ifdef __GNUC__