[v2,11/16] libebl/libdwelf: define ssize_t and pid_t for MSVC within installed header libdwelf.h and libebl.h
Message ID | 20221217165213.152-12-luoyonggang@gmail.com |
---|---|
State | Dropped |
Headers |
Return-Path: <elfutils-devel-bounces+patchwork=sourceware.org@sourceware.org> 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 580BA3AA943E for <patchwork@sourceware.org>; Sat, 17 Dec 2022 16:54:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 580BA3AA943E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1671296042; bh=ibL7++OQoM7EyE+9/5O+zpaNaDuYIfoMk/NzQWLSBuw=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Help:List-Subscribe:From: Reply-To:From; b=L9fwUHtXnKCxuZxmD4BioRpM+4NNnAINPvfrOBOjpzqDsfxP7gN0glzCry+oLMQd6 4M3gjLYSwijZGvhXJC3YibqKyYDFNkuXxCQOiAtRiu29fJCq7JpAWpE03z/asf5uL1 CVBJfN1OYj0XZQe1tI3kDCCFRDBZTirS9tKbrsQI= X-Original-To: elfutils-devel@sourceware.org Delivered-To: elfutils-devel@sourceware.org Received: from mail-pj1-x1030.google.com (mail-pj1-x1030.google.com [IPv6:2607:f8b0:4864:20::1030]) by sourceware.org (Postfix) with ESMTPS id 33CDD3AA9430 for <elfutils-devel@sourceware.org>; Sat, 17 Dec 2022 16:52:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 33CDD3AA9430 Received: by mail-pj1-x1030.google.com with SMTP id o12so5285782pjo.4 for <elfutils-devel@sourceware.org>; Sat, 17 Dec 2022 08:52:55 -0800 (PST) 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=ibL7++OQoM7EyE+9/5O+zpaNaDuYIfoMk/NzQWLSBuw=; b=KCrqycuehdk+IBZFLlIkyWHDyyxkq9f2+zdbZSnd61Hwb8Zm4QRECtEdUv/J+yKD0S fiEc+tq5yF/0InzM4074nkOcP9CdDow1pKpHU0x8J814TBb/zYAV9IIQv8hXGxXavptG XBu1Zx2fSO3u3S0jf/SpRy/bSI80kqynFIE2UTO44/G3XdAD92YthKFX+pIcvFQpik15 baqhB5FI0ihrSo8lprnKj+0+TAkabOkbuJnpsrgsjrwk0YWYUa2aE5ddpqszpReOxRk+ LwrEs4zAAvQToVDtncN/MtNeL2nfmBHqzGccbBB9MZUCugT5bazvSCOpdJkbzU/O80lb xMHw== X-Gm-Message-State: ANoB5pm+RzDg35x+pM1mJgQXEZb5A2Sn43RrG7ZGpNMydvCDAy8WRtzc VGgGXBbhXLR1nECA1sgWRf0CjM2780s= X-Google-Smtp-Source: AA0mqf4aP9vo11522G5aclKJoOzeifEMiY4WgJ2BIprLGyzqM8n+ToPVWOXRw2tRL3okxwWo9dm7TA== X-Received: by 2002:a17:90b:310f:b0:219:d84:4446 with SMTP id gc15-20020a17090b310f00b002190d844446mr36772795pjb.26.1671295973982; Sat, 17 Dec 2022 08:52:53 -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.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Dec 2022 08:52:53 -0800 (PST) To: elfutils-devel@sourceware.org Cc: Yonggang Luo <luoyonggang@gmail.com> Subject: [PATCH v2 11/16] libebl/libdwelf: define ssize_t and pid_t for MSVC within installed header libdwelf.h and libebl.h Date: Sun, 18 Dec 2022 00:52:08 +0800 Message-Id: <20221217165213.152-12-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.3 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 <elfutils-devel.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/elfutils-devel>, <mailto:elfutils-devel-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/elfutils-devel/> List-Help: <mailto:elfutils-devel-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/elfutils-devel>, <mailto:elfutils-devel-request@sourceware.org?subject=subscribe> From: Yonggang Luo via Elfutils-devel <elfutils-devel@sourceware.org> Reply-To: Yonggang Luo <luoyonggang@gmail.com> Errors-To: elfutils-devel-bounces+patchwork=sourceware.org@sourceware.org Sender: "Elfutils-devel" <elfutils-devel-bounces+patchwork=sourceware.org@sourceware.org> |
Series |
Patches for building with mingw/gcc msvc/clang-cl
|
|
Commit Message
Yonggang Luo
Dec. 17, 2022, 4:52 p.m. UTC
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
---
libdwelf/libdwelf.h | 5 +++++
libebl/libebl.h | 5 +++++
2 files changed, 10 insertions(+)
Comments
Hi, On Sun, 2022-12-18 at 00:52 +0800, Yonggang Luo via Elfutils-devel wrote: > Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> > --- > libdwelf/libdwelf.h | 5 +++++ > libebl/libebl.h | 5 +++++ > 2 files changed, 10 insertions(+) > > 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 @@ > > #include "libdw.h" > > +#ifdef _MSC_VER > +#include <BaseTsd.h> > +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 @@ > > #include "elf-knowledge.h" > > +#ifdef _MSC_VER > +#include <BaseTsd.h> > +typedef SSIZE_T ssize_t; > +typedef int pid_t; > +#endif > > /* 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
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 @@ #include "libdw.h" +#ifdef _MSC_VER +#include <BaseTsd.h> +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 @@ #include "elf-knowledge.h" +#ifdef _MSC_VER +#include <BaseTsd.h> +typedef SSIZE_T ssize_t; +typedef int pid_t; +#endif /* Opaque type for the handle. libasm.h defined the same thing. */ #ifndef _LIBASM_H