From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by sourceware.org (Postfix) with ESMTPS id 60A583AA9803 for ; Sat, 17 Dec 2022 16:53:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 60A583AA9803 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pl1-x630.google.com with SMTP id t2so5221395ply.2 for ; Sat, 17 Dec 2022 08:53:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=QzqJjgq2Wg3PQFpPrTB068GWw+gudae3/+fzkmb9O20=; b=mlQ6tt2zjfgP9F7y2QRPdhWhGQ36aIMWq1rzByntxCSDa3DyApKS2SEOpd4hOlUebq 4JiZV9CCUd4uyUcST8gogfEFc0VsZVbQtvACH1RiDHhwJHVFdqx/bS6VCOgSpP7oWXUC VPGe0NVFvgHRE3JP/dlxt7j7+kEbET00Zh2Eq/bTB7kS7zk38CZOlQ2xjbFu5nTCde2m Gqk++HcM9H/Y4+mJrmVXk0L6TGHzR9sj39a82uzNcujV2VxbbPRPIKozStlA26gdQesI o1rfODoff/TutJX3uGqmx9kJXbSFqpihFvInqcG7EgZ+lrJ03ergMkn/YjME3L867eC+ yPEA== 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=QzqJjgq2Wg3PQFpPrTB068GWw+gudae3/+fzkmb9O20=; b=gxPej3mnRReYRRsb+ptVdOv1EPUlzyQZ1008GdOMkAHcDYRGg/6SMVeSWuyBUEujd5 qRxBxUg/7phjrSztFkC3Pnq6HOTPJH3Bc4l+3kAsHgUGdIlZVAMObyweEaRepZaO0wk+ sy/FWyQd1YVYkteoaTF/DCVSHxH8iF0Obnx5yiX+D5iJZWtQ9wKb073Mb72suv5zkJCS YnHtT2jXh0GzKmiyU0AQCbCCPKyvYZuwgdTodub33t8BSsgPrjkWNZxKj8n83s8I0Qmn KTVbnHXwnvP2scvcbR6lBhse0FjrNFeHGuXEp8xc6kKa7EsVKY+NPuZOWySpV2tnJbqd WgQw== X-Gm-Message-State: ANoB5plBMHz1oood8X+MnCxCs4zh+bwY8GAe5/5m6+5hqqA0SVjHG0yg udYyaWCyJxbUEAGaxPfL4NCzUlHQlKw= X-Google-Smtp-Source: AA0mqf5Y9xNleqli3icXlogopAMv7dJN6m60Hu0aPqp4YDRZbu0KSoCKPfQ/81v5E7dhm7aYUxYIoQ== X-Received: by 2002:a17:90a:3188:b0:219:3e5f:2a65 with SMTP id j8-20020a17090a318800b002193e5f2a65mr37873026pjb.36.1671295983092; Sat, 17 Dec 2022 08:53:03 -0800 (PST) Received: from localhost.localdomain ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id s92-20020a17090a2f6500b002191873187dsm6643229pjd.33.2022.12.17.08.53.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Dec 2022 08:53:02 -0800 (PST) From: Yonggang Luo To: elfutils-devel@sourceware.org Cc: Yonggang Luo Subject: [PATCH v2 16/16] lib: Use HAVE_LIBINTL_H to guard #include Date: Sun, 18 Dec 2022 00:52:13 +0800 Message-Id: <20221217165213.152-17-luoyonggang@gmail.com> X-Mailer: git-send-email 2.36.1.windows.1 In-Reply-To: <20221217165213.152-1-luoyonggang@gmail.com> References: <20221217165213.152-1-luoyonggang@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.4 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 List-Id: MSVC doesn't have libintl.h, so use macro to guard it. Signed-off-by: Yonggang Luo --- configure.ac | 2 ++ lib/eu-config.h | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/configure.ac b/configure.ac index b84623fe..aea12be3 100644 --- a/configure.ac +++ b/configure.ac @@ -441,6 +441,8 @@ AC_CHECK_FUNCS([process_vm_readv mremap]) AS_IF([test "x$ac_cv_func_mremap" = "xno"], [AC_MSG_WARN([elf_update needs mremap to support ELF_C_RDWR_MMAP])]) +AC_CHECK_HEADERS([libintl.h]) + AC_CHECK_HEADERS([error.h]) AC_CHECK_HEADERS([err.h]) diff --git a/lib/eu-config.h b/lib/eu-config.h index 78a5c4fe..72b7793e 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(HAVE_LIBINTL_H) #include +#endif + /* gettext helper macros. */ #define N_(Str) Str +#if defined(HAVE_LIBINTL_H) #define _(Str) dgettext ("elfutils", Str) +#else +#define _(Str) N_(Str) +#endif /* Compiler-specific definitions. */ #define strong_alias(name, aliasname) \ -- 2.36.1.windows.1