From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) by sourceware.org (Postfix) with ESMTPS id EE3663AA9801 for ; Sat, 17 Dec 2022 16:52:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org EE3663AA9801 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-x62a.google.com with SMTP id 4so5212261plj.3 for ; Sat, 17 Dec 2022 08:52:47 -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=wpZvfhLZHnBw3IAGr8nVFlx71fXaU7y0FLfAxmaLQ/o=; b=p2Tuota/FKYAS5LxxtbSu3V8XSigdxMMXd8xCopQU4bZJEggX/2uG7CjTQf/1DOBaO +y4ax3SGaM2dEF2ykpVo3BqO7wAmQmh8j2IvIrf2ztoECkCBSXDYoZajVErspmj4jHPs OoHnYiVsxKuFUszRTnyfEkldSXkH9rfnsBe5ZN23M2HP54MxHiQh3WL5IWlekIENPj2b gVanHybXgvoMz5WPSfxdiHU42uc3qZ/om3D10W655Y31x0jbTJazMNM8AKw1OPJgnXKn uqO24gN2o2u+I4RKDerm5t0/2CJ3rWkT2QjTigjLL6SqJJ6qyYpR3YvfyULpkffT0R7T YaqQ== 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=wpZvfhLZHnBw3IAGr8nVFlx71fXaU7y0FLfAxmaLQ/o=; b=n8WuQP3sMJ6DrtEpxQcL2agusYKVkvgknfqt8fxGHWtLZGQ2wkRxcxqE0xiuvBbB0j dq34ZtKShCAqo3M6dDQmgBZ/M/zVTtrMkPrkDXZ9H5c/+ea34pQIp0DirgXAdTVxUC22 F6e6NKMUWFxL559nEBp7GcsK1cPPxXLSMFivO0j8yA+BWCCWPNwljcA2KBFH78z21ZNl ccwOqW2ZSxxmzWJwwoE0t+rFLZaabIkchutUzKET0Y6Lb2ophh1suFPfbDgMlATgO5qQ vhwPlzaEEp/phancW/0ba4eTsK1+CaDYmUAyIiwI+5hdhXMENMgbmZqwORIPzVdB6bc1 DcXA== X-Gm-Message-State: AFqh2kpP6qFcqDwVQj0yxm4g0+EjnRuvgpPZF8gIiif1FL0CDZ764B7X 06nUBMmVZo1NwbR5CcIpK+6dw2xNhrw= X-Google-Smtp-Source: AMrXdXv1JEIx6IKdeYmeVLs5iZkJbEf9r5InQxyhvldSApJHu3VTsvdn/xFU/8INZZSXcu/RvbcqKQ== X-Received: by 2002:a17:90a:8c01:b0:219:4b5:1775 with SMTP id a1-20020a17090a8c0100b0021904b51775mr2747691pjo.39.1671295966688; Sat, 17 Dec 2022 08:52:46 -0800 (PST) Received: from localhost.localdomain ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id s92-20020a17090a2f6500b002191873187dsm6643229pjd.33.2022.12.17.08.52.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Dec 2022 08:52:46 -0800 (PST) From: Yonggang Luo To: elfutils-devel@sourceware.org Cc: Yonggang Luo Subject: [PATCH v2 07/16] libdw: Fixes compile of dwarf_whatattr.c and dwarf_whatform.c Date: Sun, 18 Dec 2022 00:52:04 +0800 Message-Id: <20221217165213.152-8-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.2 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: If __OPTIMIZE__ is defined, then compile dwarf_whatattr.c and dwarf_whatform.c will cause symbol conflict between dwarf_whatattr.c and libdw.h, dwarf_whatform.c and libdw.h, So always undefined __OPTIMIZE__ when compiling these two files The error message is: dwarf_whatform.c [build] C:\work\xemu\elfutils\libdw\dwarf_whatform.c(39,1): error: redefinition of 'dwarf_whatform' [build] dwarf_whatform (Dwarf_Attribute *attr) [build] ^ [build] C:\work\xemu\elfutils\libdw/libdw.h(1110,1): note: previous definition is here [build] dwarf_whatform (Dwarf_Attribute *attr) [build] ^ [build] 1 error generated. Signed-off-by: Yonggang Luo --- libdw/dwarf_whatattr.c | 9 ++++----- libdw/dwarf_whatform.c | 9 ++++----- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/libdw/dwarf_whatattr.c b/libdw/dwarf_whatattr.c index d664b021..01d92307 100644 --- a/libdw/dwarf_whatattr.c +++ b/libdw/dwarf_whatattr.c @@ -30,13 +30,12 @@ #ifdef HAVE_CONFIG_H # include #endif - +#ifndef __OPTIMIZE__ +#define __OPTIMIZE__ +#endif #include #include "libdwP.h" unsigned int -dwarf_whatattr (Dwarf_Attribute *attr) -{ - return attr == NULL ? 0 : attr->code; -} +dwarf_whatattr (Dwarf_Attribute *attr); diff --git a/libdw/dwarf_whatform.c b/libdw/dwarf_whatform.c index dee29a9f..9b3e41e6 100644 --- a/libdw/dwarf_whatform.c +++ b/libdw/dwarf_whatform.c @@ -30,13 +30,12 @@ #ifdef HAVE_CONFIG_H # include #endif - +#ifndef __OPTIMIZE__ +#define __OPTIMIZE__ +#endif #include #include "libdwP.h" unsigned int -dwarf_whatform (Dwarf_Attribute *attr) -{ - return attr == NULL ? 0 : attr->form; -} +dwarf_whatform (Dwarf_Attribute *attr); \ No newline at end of file -- 2.36.1.windows.1