From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gnu.wildebeest.org (gnu.wildebeest.org [45.83.234.184]) by sourceware.org (Postfix) with ESMTPS id 5A0D13858C54 for ; Thu, 2 Mar 2023 13:32:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5A0D13858C54 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=klomp.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=klomp.org Received: from r6.localdomain (82-217-174-174.cable.dynamic.v4.ziggo.nl [82.217.174.174]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by gnu.wildebeest.org (Postfix) with ESMTPSA id EDD2830067B2; Thu, 2 Mar 2023 14:32:20 +0100 (CET) Received: by r6.localdomain (Postfix, from userid 1000) id 7ED81340233; Thu, 2 Mar 2023 14:32:20 +0100 (CET) Message-ID: <1bd98474f7f7b55055019d0ebc311ca3ef325c45.camel@klomp.org> Subject: Re: [PATCH v2 11/16] libebl/libdwelf: define ssize_t and pid_t for MSVC within installed header libdwelf.h and libebl.h From: Mark Wielaard To: Yonggang Luo , elfutils-devel@sourceware.org Date: Thu, 02 Mar 2023 14:32:20 +0100 In-Reply-To: <20221217165213.152-12-luoyonggang@gmail.com> References: <20221217165213.152-1-luoyonggang@gmail.com> <20221217165213.152-12-luoyonggang@gmail.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.4 (3.46.4-1.fc37) MIME-Version: 1.0 X-Spam-Status: No, score=-3035.8 required=5.0 tests=BAYES_00,GIT_PATCH_0,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,RCVD_IN_BARRACUDACENTRAL,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: Hi, On Sun, 2022-12-18 at 00:52 +0800, Yonggang Luo via Elfutils-devel wrote: > Signed-off-by: Yonggang Luo > --- > libdwelf/libdwelf.h | 5 +++++ > libebl/libebl.h | 5 +++++ > 2 files changed, 10 insertions(+) >=20 > diff --git a/libdwelf/libdwelf.h b/libdwelf/libdwelf.h > index 263ca60e..167ac0dc 100644 > --- a/libdwelf/libdwelf.h > +++ b/libdwelf/libdwelf.h > @@ -31,6 +31,11 @@ > =20 > #include "libdw.h" > =20 > +#ifdef _MSC_VER > +#include > +typedef SSIZE_T ssize_t; > +#endif > + > #ifdef __cplusplus > extern "C" { > #endif > diff --git a/libebl/libebl.h b/libebl/libebl.h > index 731001d3..c568f623 100644 > --- a/libebl/libebl.h > +++ b/libebl/libebl.h > @@ -44,6 +44,11 @@ > =20 > #include "elf-knowledge.h" > =20 > +#ifdef _MSC_VER > +#include > +typedef SSIZE_T ssize_t; > +typedef int pid_t; > +#endif > =20 > /* Opaque type for the handle. libasm.h defined the same thing. */ > #ifndef _LIBASM_H Kind of the same comment as for the uid_t, gid_t and mode_t change. ssize_t and pid_t according to POSIX come from sys/types.h, both signed and no wider than a long. libdwelf.h is a public header. libebl.h isn't. But I am not sure these are the right places to add these typedefs. pid_t and ssize_t are used all over the place. Cheers, Mark=20