[v2,09/16] libelf: uid_t, gid_t and mode_t are not comes with msvcrt, so using long/unsigned long instead on win32
Message ID | 20221217165213.152-10-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 58D383AA9802 for <patchwork@sourceware.org>; Sat, 17 Dec 2022 16:54:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 58D383AA9802 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1671296059; bh=WkjdKgikM8lQqVvpoElm4Qa2mG6bPEzSvINd5U512O0=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Help:List-Subscribe:From: Reply-To:From; b=oSxg7iCbNJQinHXD1a7PwZqynnrSlBBG67OxlWC9HmaDHzLCQAhDMa8omHbHzerrH kprqe3OZvFpRXuXTKEOUoLfCuDrH0hit0LGoaURS3cD3girY4sf9oWqgtariBZ6adh eoU6YAlI+YjPuMfNQ1FEIylOzmJGqy9f9H8tpZXE= 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 0C2203AA9439 for <elfutils-devel@sourceware.org>; Sat, 17 Dec 2022 16:52:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0C2203AA9439 Received: by mail-pj1-x1032.google.com with SMTP id js9so5311398pjb.2 for <elfutils-devel@sourceware.org>; Sat, 17 Dec 2022 08:52:51 -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=WkjdKgikM8lQqVvpoElm4Qa2mG6bPEzSvINd5U512O0=; b=qrQ8HYrWo9J9jt1QhoWX84Vj3U3gBUIEBFAjFRKTTkEmgeccKQJo+8Vt+zrvQDcdG7 GtXvKRm2CFHH4Sy6159I+XItM9mxR9trnq8KqUXvBTidTdmM6TAbjZYyD2v4wkB0H7CV is3WsLe5sWkLlq09cK6CIlSkD4WAl7t0r6ugo8ISYsMCwJrToKD9cUWQmh3I/Uk4JRkb lF41uQ6sbhPDL6fSEq1Hnf56dGSLGT1H7TmiBnV461XsiEc47A9PoB658ZuqRUuoW/T9 cPW4YBxJoIsnmITJ0vvmIfVxI0srU9iLak3tu03Sc5pNf3ezjpEiGO8B38jyjfwdxEJt SLqQ== X-Gm-Message-State: ANoB5pmE9TspYi5rfYu/WFi9F310ufSCwPLU3Tiwp5B0Sntda5g0fbO6 VLtrFVuk9w8u5HrgOjeqEKjbkII8SQw= X-Google-Smtp-Source: AA0mqf4jX5y/GMiEJ+CZYhAGGYLnj2dGl9ipcxAoPDwfjkMtYzcqrbkwougz5yJRUOjTwpxBf+qi9Q== X-Received: by 2002:a17:90b:306:b0:219:463d:4ebc with SMTP id ay6-20020a17090b030600b00219463d4ebcmr37792937pjb.30.1671295970348; Sat, 17 Dec 2022 08:52:50 -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.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Dec 2022 08:52:49 -0800 (PST) To: elfutils-devel@sourceware.org Cc: Yonggang Luo <luoyonggang@gmail.com> Subject: [PATCH v2 09/16] libelf: uid_t, gid_t and mode_t are not comes with msvcrt, so using long/unsigned long instead on win32 Date: Sun, 18 Dec 2022 00:52:06 +0800 Message-Id: <20221217165213.152-10-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.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, KAM_NUMSUBJECT, 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>
---
libelf/libelf.h | 6 ++++++
1 file changed, 6 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> > --- > libelf/libelf.h | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/libelf/libelf.h b/libelf/libelf.h > index a139e733..2fa3838b 100644 > --- a/libelf/libelf.h > +++ b/libelf/libelf.h > @@ -195,9 +195,15 @@ typedef struct > { > char *ar_name; /* Name of archive member. */ > time_t ar_date; /* File date. */ > +#if defined(_WIN32) > + long ar_uid; > + long ar_gid; > + unsigned long ar_mode; > +#else > uid_t ar_uid; /* User ID. */ > gid_t ar_gid; /* Group ID. */ > mode_t ar_mode; /* File mode. */ > +#endif > int64_t ar_size; /* File size. */ > char *ar_rawname; /* Original name of archive member. */ > } Elf_Arhdr; uid_t, gid_t and mode_t are all defined by POSIX to be provided through sys/types.h. Except for defining them as integer types it doesn't really say how big they are. elf_begin has some macros to handle either int or long types generically. But ar.c also simply uses uid_t, gid_t and mode_t. So those should then also be adjusted. Can't we use some configure check instead? I am somewhat hesitant to change this because it is in a public header. Cheers, Mark
diff --git a/libelf/libelf.h b/libelf/libelf.h index a139e733..2fa3838b 100644 --- a/libelf/libelf.h +++ b/libelf/libelf.h @@ -195,9 +195,15 @@ typedef struct { char *ar_name; /* Name of archive member. */ time_t ar_date; /* File date. */ +#if defined(_WIN32) + long ar_uid; + long ar_gid; + unsigned long ar_mode; +#else uid_t ar_uid; /* User ID. */ gid_t ar_gid; /* Group ID. */ mode_t ar_mode; /* File mode. */ +#endif int64_t ar_size; /* File size. */ char *ar_rawname; /* Original name of archive member. */ } Elf_Arhdr;