[04/25] libelf/libdwfl: Remove "#define LIB_SYSTEM_H 1" in libelf_crc32.c and libdwfl_crc32.c

Message ID 20221020182603.815-5-luoyonggang@gmail.com
State Committed
Headers
Series Patches for building with mingw/gcc msvc/clang-cl |

Commit Message

Yonggang Luo Oct. 20, 2022, 6:25 p.m. UTC
  rationale: https://sourceware.org/bugzilla/show_bug.cgi?id=21001

If we don't remove this macro, when try #include <system.h> in libdw/memory-access.h
wont' take effect because "#define LIB_SYSTEM_H	1"
The compile error:
./../libdw/memory-access.h:390:12: error: implicit declaration of function ‘bswap_32’ [-Werror=implicit-function-declaration]

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
---
 libdwfl/libdwfl_crc32.c | 1 -
 libelf/libelf_crc32.c   | 1 -
 2 files changed, 2 deletions(-)
  

Comments

Mark Wielaard Oct. 27, 2022, 1:20 p.m. UTC | #1
On Fri, 2022-10-21 at 02:25 +0800, Yonggang Luo via Elfutils-devel
wrote:
> rationale: https://sourceware.org/bugzilla/show_bug.cgi?id=21001
> 
> If we don't remove this macro, when try #include <system.h> in
> libdw/memory-access.h
> wont' take effect because "#define LIB_SYSTEM_H	1"
> The compile error:
> ./../libdw/memory-access.h:390:12: error: implicit declaration of
> function ‘bswap_32’ [-Werror=implicit-function-declaration]

Thanks, makes sense.
Added ChangeLog entries and tweaked the commit message a bit to not
exceed 72 chars lines.

Pushed,

Mark
  

Patch

diff --git a/libdwfl/libdwfl_crc32.c b/libdwfl/libdwfl_crc32.c
index b89d0d36..5bc7a4ad 100644
--- a/libdwfl/libdwfl_crc32.c
+++ b/libdwfl/libdwfl_crc32.c
@@ -30,6 +30,5 @@ 
 #endif
 
 #define crc32 attribute_hidden __libdwfl_crc32
-#define LIB_SYSTEM_H	1
 #include <libdwflP.h>
 #include "../lib/crc32.c"
diff --git a/libelf/libelf_crc32.c b/libelf/libelf_crc32.c
index 1426faf1..f1cf4868 100644
--- a/libelf/libelf_crc32.c
+++ b/libelf/libelf_crc32.c
@@ -30,6 +30,5 @@ 
 #endif
 
 #define crc32 attribute_hidden __libelf_crc32
-#define LIB_SYSTEM_H	1
 #include <libelf.h>
 #include "../lib/crc32.c"