From patchwork Sat Jan 21 20:32:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Eric Biggers X-Patchwork-Id: 1730061 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=ozlabs.org (client-ip=2404:9400:2221:ea00::3; helo=gandalf.ozlabs.org; envelope-from=srs0=gbep=5s=vger.kernel.org=linux-ext4-owner@ozlabs.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=qqTxfQxM; dkim-atps=neutral Received: from gandalf.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Nzp7f0WGWz23gY for ; Sun, 22 Jan 2023 07:37:02 +1100 (AEDT) Received: from gandalf.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by gandalf.ozlabs.org (Postfix) with ESMTP id 4Nzp7f05y7z4xN1 for ; Sun, 22 Jan 2023 07:37:02 +1100 (AEDT) Received: by gandalf.ozlabs.org (Postfix) id 4Nzp7f03Lbz4y03; Sun, 22 Jan 2023 07:37:02 +1100 (AEDT) Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: gandalf.ozlabs.org; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: gandalf.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2620:137:e000::1:20; helo=out1.vger.email; envelope-from=linux-ext4-owner@vger.kernel.org; receiver=) Authentication-Results: gandalf.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=qqTxfQxM; dkim-atps=neutral Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by gandalf.ozlabs.org (Postfix) with ESMTP id 4Nzp7d6zJrz4xN1 for ; Sun, 22 Jan 2023 07:37:01 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229938AbjAUUhB (ORCPT ); Sat, 21 Jan 2023 15:37:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52596 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229954AbjAUUgs (ORCPT ); Sat, 21 Jan 2023 15:36:48 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E9CDA2915C for ; Sat, 21 Jan 2023 12:36:43 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 31E6360B6C for ; Sat, 21 Jan 2023 20:36:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8684DC433EF; Sat, 21 Jan 2023 20:36:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1674333402; bh=XVz2+p5U48l2k+zbRqxcCF7PmaY2bieBDbEEFlMUd+8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qqTxfQxMMiLZl7xWOdb+S+fRpvkyEIMqmEqFgMZTp0g/Ed0Dv8qeL15aqz/wvRMXc 8Kfi1zeMoDnCAiKHs/FR7xrv000OIj+la7ZrvwaZigx2KXnvUh6oBLdNzq5rfZjWOa kss1rRD/nniI/grvz7BdXWV8ihQhKPXvA5V2VLGcC1O8fwe00irzGHW96V4vYD43R5 tvr5H5WvYm8dBVfCK0FqCGGLubB0yw6M4sFkI3hyXNA80dM/z6Zvc1Hrp38x4KS+EN ROo7s+K/mao6ONL+PbFy/7208GKjRpf6XfCjK3gvQJLtOgBk7vk99Tt6feXb3X3jWa 9ijXYKDXIxt5A== From: Eric Biggers To: linux-ext4@vger.kernel.org Cc: Paulo Antonio Alvarez Subject: [PATCH 21/38] lib/{ext2fs,support}: fix 32-bit Windows build Date: Sat, 21 Jan 2023 12:32:13 -0800 Message-Id: <20230121203230.27624-22-ebiggers@kernel.org> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230121203230.27624-1-ebiggers@kernel.org> References: <20230121203230.27624-1-ebiggers@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org From: Eric Biggers _WIN32 is the standard macro to detect (native) Windows, regardless of 32-bit or 64-bit. _WIN64 is for 64-bit Windows only. Use _WIN32 where _WIN64 was incorrectly being used. This fixes several 32-bit Windows build errors, for example this one: plausible.c: In function ‘print_ext2_info’: plausible.c:109:31: error: ‘unix_io_manager’ undeclared (first use in this function); did you mean ‘undo_io_manager’? 109 | unix_io_manager, | ^~~~~~~~~~~~~~~ | undo_io_manager Fixes: 86b6db9f5a43 ("libext2fs: code adaptation to use the Windows IO manager") Cc: Paulo Antonio Alvarez Signed-off-by: Eric Biggers --- lib/ext2fs/getsectsize.c | 12 ++++++------ lib/support/plausible.c | 2 +- util/subst.c | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/ext2fs/getsectsize.c b/lib/ext2fs/getsectsize.c index 3a461eb9c..bd978c530 100644 --- a/lib/ext2fs/getsectsize.c +++ b/lib/ext2fs/getsectsize.c @@ -51,10 +51,10 @@ */ errcode_t ext2fs_get_device_sectsize(const char *file, int *sectsize) { -#ifdef _WIN64 +#ifdef _WIN32 *sectsize = 512; // just guessing return 0; -#else // not _WIN64 +#else // not _WIN32 int fd; @@ -78,7 +78,7 @@ errcode_t ext2fs_get_device_sectsize(const char *file, int *sectsize) close(fd); return 0; -#endif // ifdef _WIN64 +#endif // ifdef _WIN32 } /* @@ -117,11 +117,11 @@ int ext2fs_get_dio_alignment(int fd) */ errcode_t ext2fs_get_device_phys_sectsize(const char *file, int *sectsize) { -#ifdef _WIN64 +#ifdef _WIN32 return ext2fs_get_device_sectsize(file, sectsize); -#else // not _WIN64 +#else // not _WIN32 int fd; @@ -147,5 +147,5 @@ errcode_t ext2fs_get_device_phys_sectsize(const char *file, int *sectsize) close(fd); return 0; -#endif // ifdef _WIN64 +#endif // ifdef _WIN32 } diff --git a/lib/support/plausible.c b/lib/support/plausible.c index bbed2a70a..349aa2c4f 100644 --- a/lib/support/plausible.c +++ b/lib/support/plausible.c @@ -103,7 +103,7 @@ static void print_ext2_info(const char *device) time_t tm; retval = ext2fs_open2(device, 0, EXT2_FLAG_64BITS, 0, 0, -#ifdef _WIN64 +#ifdef _WIN32 windows_io_manager, #else unix_io_manager, diff --git a/util/subst.c b/util/subst.c index c0eda5cf8..be2a0dda4 100644 --- a/util/subst.c +++ b/util/subst.c @@ -434,7 +434,7 @@ int main(int argc, char **argv) printf("Using original atime\n"); set_utimes(outfn, fileno(old), tv); } -#ifndef _WIN64 +#ifndef _WIN32 if (ofd >= 0) (void) fchmod(ofd, 0444); #endif @@ -444,7 +444,7 @@ int main(int argc, char **argv) } else { if (verbose) printf("Creating or replacing %s.\n", outfn); -#ifndef _WIN64 +#ifndef _WIN32 if (ofd >= 0) (void) fchmod(ofd, 0444); #endif