From patchwork Sat Oct 15 16:36:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yonggang Luo X-Patchwork-Id: 58903 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E216E3858428 for ; Sat, 15 Oct 2022 16:36:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E216E3858428 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1665851814; bh=XohT9P1/FWcihyDIDE+qKYsiL4d91Vs8P6APaSg90dw=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Help:List-Subscribe:From:Reply-To:From; b=UtLsjIM69zYOO2Y40xug7bupeUY5SlJ/T7tPoC11pxvRKv8rzojROeyYP8p5SSq92 2JFrmw7WLndA1N5DX/0bp/SieXclrJDY8MgiqxAx/W88mKzx4YiXhQRr2qdCXfKD4w YgatTODJ3ofCo+mht/Qo35h2byeSxPXYkpguGkB0= X-Original-To: elfutils-devel@sourceware.org Delivered-To: elfutils-devel@sourceware.org Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com [IPv6:2607:f8b0:4864:20::434]) by sourceware.org (Postfix) with ESMTPS id 790E63858D38 for ; Sat, 15 Oct 2022 16:36:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 790E63858D38 Received: by mail-pf1-x434.google.com with SMTP id y1so7557493pfr.3 for ; Sat, 15 Oct 2022 09:36:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XohT9P1/FWcihyDIDE+qKYsiL4d91Vs8P6APaSg90dw=; b=O3lEGErlsdrOoY6KgeXR8pJn6FP1KS/hJ7qsz+qR93+Zggr8GQwWTL/AacjknlIvKk upk43q1NxPtfQ+H1nWMvkVdeKncpo7+NvSPFIjpDImiqUH5nfProv13DfgnO84BDMN8b 6UABzd/BbVwjfKJUp1/ZcGIZ1BDRuarB6ZOGWODmyx/sjGB6INSDxq0UJc/jU5NB26NB fFyHFYHs7HndCFtig61ND2Ir3KEAxHTpGaja1ERx2bAyldGVgT5VAYu2wytemNNixAyJ IObvrj51SYkRJbLs5x41QBu7QcFODizvIq2HPGgedJhye5v6l03GiOtpwhs0Szh3MyVy HpaA== X-Gm-Message-State: ACrzQf21LdpXwIr6EEr8zlJjHNEIIj56S2JRJtsLL0prNht5KBl9mY4q GxJMET82bQihnIYQ4CVQjmz/gDzXZJ/68w== X-Google-Smtp-Source: AMsMyM5USN2qr2jmC8DPrTfK1OD7gWlXoc5yBeyXJ9r4c766JIp/g7B3XoiGfQutXNVTtAkDReo1dA== X-Received: by 2002:a63:4042:0:b0:43b:ddc8:235 with SMTP id n63-20020a634042000000b0043bddc80235mr3285180pga.498.1665851800263; Sat, 15 Oct 2022 09:36:40 -0700 (PDT) Received: from localhost.localdomain ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id b5-20020a62a105000000b0056299fd2ba2sm3760622pff.162.2022.10.15.09.36.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 15 Oct 2022 09:36:39 -0700 (PDT) To: elfutils-devel@sourceware.org Subject: [PATCH v2 2/7] move platform depended include into system.h of libelf Date: Sun, 16 Oct 2022 00:36:20 +0800 Message-Id: <20221015163622.129-2-luoyonggang@gmail.com> X-Mailer: git-send-email 2.36.1.windows.1 In-Reply-To: <20221015163622.129-1-luoyonggang@gmail.com> References: <20221015163622.129-1-luoyonggang@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-10.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: elfutils-devel@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Elfutils-devel mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-Patchwork-Original-From: Yonggang Luo via Elfutils-devel From: Yonggang Luo Reply-To: Yonggang Luo Errors-To: elfutils-devel-bounces+patchwork=sourceware.org@sourceware.org Sender: "Elfutils-devel" All of these files either #include directly or #include "libelfP.h" And now "libelfP.h also #include , so the platform depended include can be moved to system.h safely Signed-off-by: Yonggang Luo --- lib/system.h | 11 +++++++---- libelf/common.h | 3 --- libelf/elf32_checksum.c | 1 - libelf/elf32_getphdr.c | 2 -- libelf/elf32_getshdr.c | 2 -- libelf/elf32_updatefile.c | 3 --- libelf/elf32_updatenull.c | 2 -- libelf/elf32_xlatetof.c | 1 - libelf/elf32_xlatetom.c | 1 - libelf/elf_begin.c | 3 --- libelf/elf_cntl.c | 2 -- libelf/elf_compress.c | 2 -- libelf/elf_end.c | 1 - libelf/elf_getarsym.c | 4 ---- libelf/elf_getdata.c | 2 -- libelf/elf_getdata_rawchunk.c | 2 -- libelf/elf_getshdrstrndx.c | 2 -- libelf/elf_readall.c | 2 -- libelf/elf_update.c | 2 -- libelf/gelf_xlate.c | 1 - libelf/libelfP.h | 1 + libelf/nlist.c | 1 - 22 files changed, 8 insertions(+), 43 deletions(-) diff --git a/lib/system.h b/lib/system.h index d3f42c91..48004df1 100644 --- a/lib/system.h +++ b/lib/system.h @@ -35,14 +35,17 @@ #include #include #include -#include -#include -#include -#include #include #include #include +/* System dependend headers */ +#include +#include +#include +#include +#include + #if defined(HAVE_ERROR_H) #include #elif defined(HAVE_ERR_H) diff --git a/libelf/common.h b/libelf/common.h index 3718b3fd..4561854f 100644 --- a/libelf/common.h +++ b/libelf/common.h @@ -30,9 +30,6 @@ #ifndef _COMMON_H #define _COMMON_H 1 -#include -#include -#include #include #include diff --git a/libelf/elf32_checksum.c b/libelf/elf32_checksum.c index c5f27bbe..521668a7 100644 --- a/libelf/elf32_checksum.c +++ b/libelf/elf32_checksum.c @@ -32,7 +32,6 @@ #endif #include -#include #include #include #include diff --git a/libelf/elf32_getphdr.c b/libelf/elf32_getphdr.c index 99b4ac09..4bfca24b 100644 --- a/libelf/elf32_getphdr.c +++ b/libelf/elf32_getphdr.c @@ -34,10 +34,8 @@ #include #include #include -#include #include -#include #include "libelfP.h" #include "common.h" diff --git a/libelf/elf32_getshdr.c b/libelf/elf32_getshdr.c index 237d9122..fc696302 100644 --- a/libelf/elf32_getshdr.c +++ b/libelf/elf32_getshdr.c @@ -34,9 +34,7 @@ #include #include #include -#include -#include #include "libelfP.h" #include "common.h" diff --git a/libelf/elf32_updatefile.c b/libelf/elf32_updatefile.c index 1ff58900..46afa1f4 100644 --- a/libelf/elf32_updatefile.c +++ b/libelf/elf32_updatefile.c @@ -37,10 +37,7 @@ #include #include #include -#include -#include -#include #include "libelfP.h" diff --git a/libelf/elf32_updatenull.c b/libelf/elf32_updatenull.c index d0d4d1eb..6c06e5e4 100644 --- a/libelf/elf32_updatenull.c +++ b/libelf/elf32_updatenull.c @@ -32,12 +32,10 @@ #endif #include -#include #include #include #include -#include #include "libelfP.h" #include "elf-knowledge.h" diff --git a/libelf/elf32_xlatetof.c b/libelf/elf32_xlatetof.c index 082d833f..377659c8 100644 --- a/libelf/elf32_xlatetof.c +++ b/libelf/elf32_xlatetof.c @@ -32,7 +32,6 @@ #endif #include -#include #include #include "libelfP.h" diff --git a/libelf/elf32_xlatetom.c b/libelf/elf32_xlatetom.c index cb0bb8d5..fa3dc9a7 100644 --- a/libelf/elf32_xlatetom.c +++ b/libelf/elf32_xlatetom.c @@ -32,7 +32,6 @@ #endif #include -#include #include #include "libelfP.h" diff --git a/libelf/elf_begin.c b/libelf/elf_begin.c index 71eb3594..fe8c640a 100644 --- a/libelf/elf_begin.c +++ b/libelf/elf_begin.c @@ -39,11 +39,8 @@ #include #include #include -#include -#include #include -#include #include "libelfP.h" #include "common.h" diff --git a/libelf/elf_cntl.c b/libelf/elf_cntl.c index fd681789..04aa9132 100644 --- a/libelf/elf_cntl.c +++ b/libelf/elf_cntl.c @@ -31,8 +31,6 @@ # include #endif -#include - #include "libelfP.h" diff --git a/libelf/elf_compress.c b/libelf/elf_compress.c index df0144e8..d7f53af2 100644 --- a/libelf/elf_compress.c +++ b/libelf/elf_compress.c @@ -31,14 +31,12 @@ #endif #include -#include #include "libelfP.h" #include "common.h" #include #include #include -#include #include /* Cleanup and return result. Don't leak memory. */ diff --git a/libelf/elf_end.c b/libelf/elf_end.c index 160f0b88..5c451f36 100644 --- a/libelf/elf_end.c +++ b/libelf/elf_end.c @@ -34,7 +34,6 @@ #include #include #include -#include #include "libelfP.h" diff --git a/libelf/elf_getarsym.c b/libelf/elf_getarsym.c index 05ebf6a9..2203521f 100644 --- a/libelf/elf_getarsym.c +++ b/libelf/elf_getarsym.c @@ -32,16 +32,12 @@ #endif #include -#include -#include #include #include #include #include #include -#include -#include #include #include "libelfP.h" diff --git a/libelf/elf_getdata.c b/libelf/elf_getdata.c index a704aae3..5ebd270f 100644 --- a/libelf/elf_getdata.c +++ b/libelf/elf_getdata.c @@ -35,10 +35,8 @@ #include #include #include -#include #include "libelfP.h" -#include #include "common.h" #include "elf-knowledge.h" diff --git a/libelf/elf_getdata_rawchunk.c b/libelf/elf_getdata_rawchunk.c index 2f55cbb4..5a35ccdc 100644 --- a/libelf/elf_getdata_rawchunk.c +++ b/libelf/elf_getdata_rawchunk.c @@ -35,9 +35,7 @@ #include #include #include -#include -#include #include "libelfP.h" #include "common.h" diff --git a/libelf/elf_getshdrstrndx.c b/libelf/elf_getshdrstrndx.c index ad884fd3..2391317b 100644 --- a/libelf/elf_getshdrstrndx.c +++ b/libelf/elf_getshdrstrndx.c @@ -35,9 +35,7 @@ #include #include #include -#include -#include #include "libelfP.h" #include "common.h" diff --git a/libelf/elf_readall.c b/libelf/elf_readall.c index 0a3a233d..d0f9a28c 100644 --- a/libelf/elf_readall.c +++ b/libelf/elf_readall.c @@ -32,10 +32,8 @@ #endif #include -#include #include -#include #include "libelfP.h" #include "common.h" diff --git a/libelf/elf_update.c b/libelf/elf_update.c index 97ca9ca9..56af3a1c 100644 --- a/libelf/elf_update.c +++ b/libelf/elf_update.c @@ -33,8 +33,6 @@ #include #include -#include -#include #include #include "libelfP.h" diff --git a/libelf/gelf_xlate.c b/libelf/gelf_xlate.c index 6f8c57b7..d8ad0634 100644 --- a/libelf/gelf_xlate.c +++ b/libelf/gelf_xlate.c @@ -32,7 +32,6 @@ # include #endif -#include #include #include #include diff --git a/libelf/libelfP.h b/libelf/libelfP.h index 56331f45..d88a613c 100644 --- a/libelf/libelfP.h +++ b/libelf/libelfP.h @@ -39,6 +39,7 @@ #include #include +#include /* Helper Macros to write 32 bit and 64 bit functions. */ #define __elfw2_(Bits, Name) __elf##Bits##_##Name diff --git a/libelf/nlist.c b/libelf/nlist.c index 8593c1de..b3d60435 100644 --- a/libelf/nlist.c +++ b/libelf/nlist.c @@ -35,7 +35,6 @@ #include #include #include -#include #include "libelfP.h" From patchwork Sat Oct 15 16:36:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yonggang Luo X-Patchwork-Id: 58904 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CF7EB3858C33 for ; Sat, 15 Oct 2022 16:37:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CF7EB3858C33 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1665851826; bh=SrrW6kE7Ez2Dr55KBdekvkvKhRpQUsiLByNA5bvelO8=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Help:List-Subscribe:From:Reply-To:From; b=mvFnXwwWrsk2/rQxRXUmgGpWbr2qO3BftUvpz9ilaqjg2IHlOMssWU/IGyBDAt6ah 5zHQIMKUQb8uRClERNZondpRNv42acdy8NLDH31OAxoTl8s5wy7MSe9zj/984717Eu Tlo0aVsZxxK2S+ib+zQEPyqZxUeW2eJN9gsDyHW0= X-Original-To: elfutils-devel@sourceware.org Delivered-To: elfutils-devel@sourceware.org Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) by sourceware.org (Postfix) with ESMTPS id 652DC3858CDA for ; Sat, 15 Oct 2022 16:36:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 652DC3858CDA Received: by mail-pl1-x62f.google.com with SMTP id 10so7393043pli.0 for ; Sat, 15 Oct 2022 09:36:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SrrW6kE7Ez2Dr55KBdekvkvKhRpQUsiLByNA5bvelO8=; b=vvyjsLXPMD8KwIHPrEKqONHBHec6tNoTcZ2rgHMgqtUUeEPZGdtkjGiHiCdJdAmgW0 mAxnKBeSJ65O6aOMbp/iMgN8dgCx+9ZWpqeKhuDNI9ATNzIKPXQ4qPwIRVD7sAqLX6uF rkFRgZvJhBNfGlfatsQ46L3pARZCiWcP3qJe/tuSRIXtX98c3rao8W+07JpbnPFfQNtZ dxtK9oI3wViQrjUfd1OyT5nkaq57LTpaKqbhd521PCyOgDjuOk/oZjARRwHErJWk7kvJ ENjKf2cb7u/vmEaclG9P94vGZtynBHC8kb359GmpR7hRb11NwJgnGl+VqQhsCdI3ircz 6yQQ== X-Gm-Message-State: ACrzQf3VCoUDBX2cXZochEaY6LPkgXTQdW08ehsi9c3Jhk+U6HmqTBAV 6tRWn81oa/S+LzSUIvTAssRsrTqP4elV8A== X-Google-Smtp-Source: AMsMyM7KhZuSZRYuDOXohkJYtc/tkutZhM+8PlRI2xFJtXUvWDFH6MoIyvsTadJJH3xtVpe4zv+8nQ== X-Received: by 2002:a17:90b:1b42:b0:20d:6ddd:9ed2 with SMTP id nv2-20020a17090b1b4200b0020d6ddd9ed2mr24392884pjb.232.1665851802071; Sat, 15 Oct 2022 09:36:42 -0700 (PDT) Received: from localhost.localdomain ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id b5-20020a62a105000000b0056299fd2ba2sm3760622pff.162.2022.10.15.09.36.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 15 Oct 2022 09:36:41 -0700 (PDT) To: elfutils-devel@sourceware.org Subject: [PATCH v2 3/7] Move the #include into eu-config.h Date: Sun, 16 Oct 2022 00:36:21 +0800 Message-Id: <20221015163622.129-3-luoyonggang@gmail.com> X-Mailer: git-send-email 2.36.1.windows.1 In-Reply-To: <20221015163622.129-1-luoyonggang@gmail.com> References: <20221015163622.129-1-luoyonggang@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-10.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: elfutils-devel@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Elfutils-devel mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-Patchwork-Original-From: Yonggang Luo via Elfutils-devel From: Yonggang Luo Reply-To: Yonggang Luo Errors-To: elfutils-devel-bounces+patchwork=sourceware.org@sourceware.org Sender: "Elfutils-devel" So we do not need include in each file. And indeed the macro #define _(Str) dgettext ("elfutils", Str) access libintl function dgettext, so it's make more sense #include in file eu-config.h Signed-off-by: Yonggang Luo --- debuginfod/debuginfod.cxx | 1 - lib/color.c | 1 - lib/eu-config.h | 1 + lib/printversion.c | 1 - lib/xasprintf.c | 1 - lib/xmalloc.c | 1 - libasm/asm_end.c | 1 - libasm/asm_error.c | 1 - libasm/asm_newscn.c | 1 - libcpu/i386_lex.l | 1 - libcpu/i386_parse.y | 1 - libdw/libdwP.h | 1 - libdwfl/argp-std.c | 1 - libdwfl/dwfl_error.c | 1 - libebl/libeblP.h | 1 - libelf/elf_error.c | 1 - src/addr2line.c | 1 - src/ar.c | 1 - src/arlib-argp.c | 1 - src/arlib.c | 1 - src/arlib2.c | 1 - src/elfcmp.c | 1 - src/elflint.c | 1 - src/findtextrel.c | 1 - src/nm.c | 1 - src/objdump.c | 1 - src/ranlib.c | 1 - src/readelf.c | 1 - src/size.c | 1 - src/strings.c | 1 - src/strip.c | 1 - src/unstrip.c | 1 - 32 files changed, 1 insertion(+), 31 deletions(-) diff --git a/debuginfod/debuginfod.cxx b/debuginfod/debuginfod.cxx index 000a41c4..8e7ee499 100644 --- a/debuginfod/debuginfod.cxx +++ b/debuginfod/debuginfod.cxx @@ -47,7 +47,6 @@ extern "C" { #include #include -#include #include #include #include diff --git a/lib/color.c b/lib/color.c index e43b6143..bd105ec2 100644 --- a/lib/color.c +++ b/lib/color.c @@ -32,7 +32,6 @@ #endif #include -#include #include #include #include diff --git a/lib/eu-config.h b/lib/eu-config.h index c7d7cbb2..78a5c4fe 100644 --- a/lib/eu-config.h +++ b/lib/eu-config.h @@ -52,6 +52,7 @@ # define rwlock_unlock(lock) ((void) (lock)) #endif /* USE_LOCKS */ +#include /* gettext helper macros. */ #define N_(Str) Str #define _(Str) dgettext ("elfutils", Str) diff --git a/lib/printversion.c b/lib/printversion.c index f657329c..7d31fa83 100644 --- a/lib/printversion.c +++ b/lib/printversion.c @@ -30,7 +30,6 @@ # include #endif -#include #include "printversion.h" void diff --git a/lib/xasprintf.c b/lib/xasprintf.c index 179ea2e8..d61fad90 100644 --- a/lib/xasprintf.c +++ b/lib/xasprintf.c @@ -33,7 +33,6 @@ #include #include #include -#include #include "libeu.h" #include "system.h" diff --git a/lib/xmalloc.c b/lib/xmalloc.c index 7c094985..de7211f1 100644 --- a/lib/xmalloc.c +++ b/lib/xmalloc.c @@ -30,7 +30,6 @@ # include #endif -#include #include #include #include diff --git a/libasm/asm_end.c b/libasm/asm_end.c index 077d2aa5..a26120f2 100644 --- a/libasm/asm_end.c +++ b/libasm/asm_end.c @@ -32,7 +32,6 @@ #endif #include -#include #include #include #include diff --git a/libasm/asm_error.c b/libasm/asm_error.c index cc3e660b..2b769395 100644 --- a/libasm/asm_error.c +++ b/libasm/asm_error.c @@ -31,7 +31,6 @@ # include #endif -#include #include #include diff --git a/libasm/asm_newscn.c b/libasm/asm_newscn.c index 1150015f..d258d969 100644 --- a/libasm/asm_newscn.c +++ b/libasm/asm_newscn.c @@ -32,7 +32,6 @@ #endif #include -#include #include #include diff --git a/libcpu/i386_lex.l b/libcpu/i386_lex.l index b6ec0f87..9b33ed95 100644 --- a/libcpu/i386_lex.l +++ b/libcpu/i386_lex.l @@ -31,7 +31,6 @@ #endif #include -#include #include #include "system.h" diff --git a/libcpu/i386_parse.y b/libcpu/i386_parse.y index 9a92c2e0..d2236d59 100644 --- a/libcpu/i386_parse.y +++ b/libcpu/i386_parse.y @@ -35,7 +35,6 @@ #include #include #include -#include #include #include #include diff --git a/libdw/libdwP.h b/libdw/libdwP.h index 56b388c1..961fa4e7 100644 --- a/libdw/libdwP.h +++ b/libdw/libdwP.h @@ -29,7 +29,6 @@ #ifndef _LIBDWP_H #define _LIBDWP_H 1 -#include #include #include diff --git a/libdwfl/argp-std.c b/libdwfl/argp-std.c index 01ec18e2..bc013aa0 100644 --- a/libdwfl/argp-std.c +++ b/libdwfl/argp-std.c @@ -34,7 +34,6 @@ #include #include #include -#include #include #include diff --git a/libdwfl/dwfl_error.c b/libdwfl/dwfl_error.c index a5c683a9..43fa1dcc 100644 --- a/libdwfl/dwfl_error.c +++ b/libdwfl/dwfl_error.c @@ -31,7 +31,6 @@ #endif #include -#include #include #include #include diff --git a/libebl/libeblP.h b/libebl/libeblP.h index fa1c2c9f..c408ed97 100644 --- a/libebl/libeblP.h +++ b/libebl/libeblP.h @@ -32,7 +32,6 @@ #include #include #include -#include /* Backend handle. */ diff --git a/libelf/elf_error.c b/libelf/elf_error.c index 5364e685..e596108d 100644 --- a/libelf/elf_error.c +++ b/libelf/elf_error.c @@ -32,7 +32,6 @@ #endif #include -#include #include #include #include diff --git a/src/addr2line.c b/src/addr2line.c index 25db2926..7768b266 100644 --- a/src/addr2line.c +++ b/src/addr2line.c @@ -28,7 +28,6 @@ #include #include #include -#include #include #include #include diff --git a/src/ar.c b/src/ar.c index 04456c18..3bcb18fe 100644 --- a/src/ar.c +++ b/src/ar.c @@ -24,7 +24,6 @@ #include #include #include -#include #include #include #include diff --git a/src/arlib-argp.c b/src/arlib-argp.c index a3c12e4d..115b9d76 100644 --- a/src/arlib-argp.c +++ b/src/arlib-argp.c @@ -20,7 +20,6 @@ #endif #include -#include #include "arlib.h" diff --git a/src/arlib.c b/src/arlib.c index c09fc3c6..b8f89ba7 100644 --- a/src/arlib.c +++ b/src/arlib.c @@ -23,7 +23,6 @@ #include #include #include -#include #include #include #include diff --git a/src/arlib2.c b/src/arlib2.c index 11f44e5d..9ae6662c 100644 --- a/src/arlib2.c +++ b/src/arlib2.c @@ -20,7 +20,6 @@ # include #endif -#include #include #include diff --git a/src/elfcmp.c b/src/elfcmp.c index 21d8d9dc..fba67e02 100644 --- a/src/elfcmp.c +++ b/src/elfcmp.c @@ -25,7 +25,6 @@ #include #include #include -#include #include #include #include diff --git a/src/elflint.c b/src/elflint.c index b0e5415e..565cffdc 100644 --- a/src/elflint.c +++ b/src/elflint.c @@ -27,7 +27,6 @@ #include #include #include -#include #include #include #include diff --git a/src/findtextrel.c b/src/findtextrel.c index ecb1d118..d3021a3a 100644 --- a/src/findtextrel.c +++ b/src/findtextrel.c @@ -26,7 +26,6 @@ #include #include #include -#include #include #include #include diff --git a/src/nm.c b/src/nm.c index 16647589..b46c1fd7 100644 --- a/src/nm.c +++ b/src/nm.c @@ -30,7 +30,6 @@ #include #include #include -#include #include #include #include diff --git a/src/objdump.c b/src/objdump.c index b32de17d..d43c1dd6 100644 --- a/src/objdump.c +++ b/src/objdump.c @@ -23,7 +23,6 @@ #include #include #include -#include #include #include #include diff --git a/src/ranlib.c b/src/ranlib.c index bd7e1d8a..7838d69e 100644 --- a/src/ranlib.c +++ b/src/ranlib.c @@ -26,7 +26,6 @@ #include #include #include -#include #include #include #include diff --git a/src/readelf.c b/src/readelf.c index 1a10fd01..a206e60e 100644 --- a/src/readelf.c +++ b/src/readelf.c @@ -30,7 +30,6 @@ #include #include #include -#include #include #include #include diff --git a/src/size.c b/src/size.c index 8f203167..ff8ca075 100644 --- a/src/size.c +++ b/src/size.c @@ -25,7 +25,6 @@ #include #include #include -#include #include #include #include diff --git a/src/strings.c b/src/strings.c index 04aac3b6..55b047be 100644 --- a/src/strings.c +++ b/src/strings.c @@ -28,7 +28,6 @@ #include #include #include -#include #include #include #include diff --git a/src/strip.c b/src/strip.c index 452b1279..2a2cc801 100644 --- a/src/strip.c +++ b/src/strip.c @@ -28,7 +28,6 @@ #include #include #include -#include #include #include #include diff --git a/src/unstrip.c b/src/unstrip.c index 3472637a..d5bd1821 100644 --- a/src/unstrip.c +++ b/src/unstrip.c @@ -33,7 +33,6 @@ #include #include #include -#include #include #include #include From patchwork Sat Oct 15 16:36:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yonggang Luo X-Patchwork-Id: 58905 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0553E385840A for ; Sat, 15 Oct 2022 16:37:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0553E385840A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1665851838; bh=ojn/+pmqFRX7B+bb4fOR9k/GKPxCgUnLphVeLloo544=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Help:List-Subscribe:From:Reply-To:From; b=fMjh2z1/qGUe2xd+Up8/ll+R0C7QKtrp4ZoXiq31q3R6BAMJBzJUMhrYgplB6Vbb/ J3tWuumNDUR9Z/yiU8v1jPEiBx8ntqiOuXNKcG49/l1Adin9FtZovPHO2ewOup0Vr0 03zKJ48g2JwITJrg94FgTiBFpf/R8pz1TDx4Ok3E= X-Original-To: elfutils-devel@sourceware.org Delivered-To: elfutils-devel@sourceware.org Received: from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com [IPv6:2607:f8b0:4864:20::1032]) by sourceware.org (Postfix) with ESMTPS id 318653858412 for ; Sat, 15 Oct 2022 16:36:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 318653858412 Received: by mail-pj1-x1032.google.com with SMTP id t10-20020a17090a4e4a00b0020af4bcae10so7403650pjl.3 for ; Sat, 15 Oct 2022 09:36:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ojn/+pmqFRX7B+bb4fOR9k/GKPxCgUnLphVeLloo544=; b=YLMAGdbOVqkI6M1Rnb4857RbE5UHoH/QBvTw7/nOOdbtUPHnaESwhw++DTIXFW2P2C IJWMpIzNoMm+SmFMElABkVMzlujS5Gh9dZyXeqWkzGWpIG0C8YWIbPAGrFSl3ze8896u cM9lrX1RSjEfFDVJO7+WgK5y7FZ/VRunUwP08AaJu1jTBoaiK2qUQzwJkGxqA53fB7yp bwvB19TTlklrTpzKduUdDHgAsMcOl3Nw6WkrUQ6/z7IrhvCscV3wGNBmXU8lBwLu1T+n ElGMbOLUmao1SglHmRjstdAB60jlU4evKgducsY0XiRqyP2vYp+E1+aW76F9ypAA7n6H vaHQ== X-Gm-Message-State: ACrzQf1dtOkuHGtAxhYZAymTeZHjt5uQxHT4xbpmKuvZELXJa3ijydy0 AWcVTTWPywskDb0NICy2UBODNd6YGHPfTA== X-Google-Smtp-Source: AMsMyM52TXqk1r0gmpSOO2wZtGJL/nRderxsGoxcgPVZreKmwGokmtz6LLt1FNHWOpa83h62xfNvxQ== X-Received: by 2002:a17:902:ab89:b0:17a:67c:b9e9 with SMTP id f9-20020a170902ab8900b0017a067cb9e9mr3417535plr.55.1665851803996; Sat, 15 Oct 2022 09:36:43 -0700 (PDT) Received: from localhost.localdomain ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id b5-20020a62a105000000b0056299fd2ba2sm3760622pff.162.2022.10.15.09.36.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 15 Oct 2022 09:36:43 -0700 (PDT) To: elfutils-devel@sourceware.org Subject: [PATCH v2 4/7] lib: Use NOT_HAVE_LIBINTL to guard #include Date: Sun, 16 Oct 2022 00:36:22 +0800 Message-Id: <20221015163622.129-4-luoyonggang@gmail.com> X-Mailer: git-send-email 2.36.1.windows.1 In-Reply-To: <20221015163622.129-1-luoyonggang@gmail.com> References: <20221015163622.129-1-luoyonggang@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-10.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: elfutils-devel@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Elfutils-devel mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-Patchwork-Original-From: Yonggang Luo via Elfutils-devel From: Yonggang Luo Reply-To: Yonggang Luo Errors-To: elfutils-devel-bounces+patchwork=sourceware.org@sourceware.org Sender: "Elfutils-devel" Add NOT_HAVE_LIBINTL macro to disable internationalization, sometimes we have don't want access internationalization such as MSVC, so the macro NOT_HAVE_LIBINTL can help that. Signed-off-by: Yonggang Luo --- lib/eu-config.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/eu-config.h b/lib/eu-config.h index 78a5c4fe..5e6c3c72 100644 --- a/lib/eu-config.h +++ b/lib/eu-config.h @@ -52,10 +52,17 @@ # define rwlock_unlock(lock) ((void) (lock)) #endif /* USE_LOCKS */ +#if !defined(NOT_HAVE_LIBINTL) #include +#endif + /* gettext helper macros. */ #define N_(Str) Str +#if !defined(NOT_HAVE_LIBINTL) #define _(Str) dgettext ("elfutils", Str) +#else +#define _(Str) N_(Str) +#endif /* Compiler-specific definitions. */ #define strong_alias(name, aliasname) \