From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from re-prd-fep-048.btinternet.com (mailomta8-re.btinternet.com [213.120.69.101]) by sourceware.org (Postfix) with ESMTPS id 370C8385E451 for ; Fri, 8 Mar 2024 18:35:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 370C8385E451 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=dronecode.org.uk Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=dronecode.org.uk ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 370C8385E451 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=213.120.69.101 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709922957; cv=none; b=haZ0pMnmJyVgfr0D/UgEIJdK79Y/3/uOCiCmEDvTVI19L3YilNW78QoWYTsAEyhc32r5dkbgK1TvqXX7DKvho7Ca/e5UfwH5UJCojof5PIr42mJxALLwk1O1Bs1bv1x1C7stUkAlQN//NE0lm1ux1rZ9POOjFwBUxVEuYB9PjmM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709922957; c=relaxed/simple; bh=Eq0K4e2fSkMeXYxp5HQkW9YxowS/W10nAmLHQddelYE=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=OWPA4AvkRZ+b3b05E+iKlxlYLhiquLpSvyD0iOnLvX4xjQybv/hEGs6QkZFc4slrHvoRzWnarX8xuh0c8LGp3syuymQYsfv7RxSj2V/J/RosX2A8Aeou7uAYQMDHmkd5An8kiwfESCh7Wbn7w7odaWCxRT+0rAPjNWSq6O7r6lI= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from re-prd-rgout-004.btmx-prd.synchronoss.net ([10.2.54.7]) by re-prd-fep-048.btinternet.com with ESMTP id <20240308183554.DLGS17945.re-prd-fep-048.btinternet.com@re-prd-rgout-004.btmx-prd.synchronoss.net>; Fri, 8 Mar 2024 18:35:54 +0000 Authentication-Results: btinternet.com; none X-SNCR-Rigid: 6577B87C0AB06816 X-Originating-IP: [81.153.98.185] X-OWM-Source-IP: 81.153.98.185 X-OWM-Env-Sender: jon.turney@dronecode.org.uk X-VadeSecure-score: verdict=clean score=0/300, class=clean X-RazorGate-Vade: gggruggvucftvghtrhhoucdtuddrgedvledrieehgdduudegucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuueftkffvkffujffvgffngfevqffopdfqfgfvnecuuegrihhlohhuthemuceftddunecunecujfgurhephffvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomheplfhonhcuvfhurhhnvgihuceojhhonhdrthhurhhnvgihsegurhhonhgvtghouggvrdhorhhgrdhukheqnecuggftrfgrthhtvghrnhephffgkeefteehudelheejvdevuddvjeejfedtheeikefgledtffekteeiudeuieelnecuffhomhgrihhnpegthihgfihinhdrtghomhenucfkphepkedurdduheefrdelkedrudekheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhephhgvlhhopehlohgtrghlhhhoshhtrdhlohgtrghlughomhgrihhnpdhinhgvthepkedurdduheefrdelkedrudekhedpmhgrihhlfhhrohhmpehjohhnrdhtuhhrnhgvhiesughrohhnvggtohguvgdrohhrghdruhhkpdhnsggprhgtphhtthhopedvpdhrtghpthhtoheptgihghifihhnqdgrphhpshestgihghifihhnrdgtohhmpdhrtghpthhtohepjhhonhdrthhurhhnvgihsegurhhonhgvtghouggvrdhorhhgrdhukhdprhgvvhfkrfephhhoshhtkeduqdduheefqdelkedqudekhedrrhgrnhhgvgekuddqudehfedrsghttggvnhhtrhgrlhhplhhushdrtghomhdprghuthhhpghushgvrhepjhhonhhtuhhrnhgvhies sghtihhnthgvrhhnvghtrdgtohhmpdhgvghokffrpefiuedpoffvtefjohhstheprhgvqdhprhguqdhrghhouhhtqddttdeg X-RazorGate-Vade-Verdict: clean 0 X-RazorGate-Vade-Classification: clean Received: from localhost.localdomain (81.153.98.185) by re-prd-rgout-004.btmx-prd.synchronoss.net (authenticated as jonturney@btinternet.com) id 6577B87C0AB06816; Fri, 8 Mar 2024 18:35:54 +0000 From: Jon Turney To: cygwin-apps@cygwin.com Cc: Jon Turney Subject: [PATCH setup 09/16] Move is_64bit to state Date: Fri, 8 Mar 2024 18:34:28 +0000 Message-ID: <20240308183440.4263-10-jon.turney@dronecode.org.uk> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240308183440.4263-1-jon.turney@dronecode.org.uk> References: <20240308183440.4263-1-jon.turney@dronecode.org.uk> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-8.6 required=5.0 tests=BAYES_00,GIT_PATCH_0,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE 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: Note this controls what we will install, not indicating how we are built, so it's use in splash is questionable, and is downright wrong in the messages from IniDbBuilderPackage giving URLs for an updated version of setup. This controls stuff all over the place! --- ini.h | 1 - main.cc | 34 ++++++++++++++-------------------- splash.cc | 2 +- state.cc | 6 ++++++ state.h | 2 ++ 5 files changed, 23 insertions(+), 22 deletions(-) diff --git a/ini.h b/ini.h index f1788e2..2ca4f5b 100644 --- a/ini.h +++ b/ini.h @@ -23,7 +23,6 @@ typedef std::vector IniList; extern IniList found_ini_list, setup_ext_list; -extern bool is_64bit; extern bool is_new_install; extern std::string SetupArch; extern std::string SetupIniDir; diff --git a/main.cc b/main.cc index 2ce3b30..c359ba9 100644 --- a/main.cc +++ b/main.cc @@ -83,7 +83,6 @@ extern char **_argv; #endif -bool is_64bit; bool is_new_install = false; std::string SetupArch; std::string SetupIniDir; @@ -263,26 +262,21 @@ WinMain (HINSTANCE h, else if (HelpOption) help_option = true; - if (!((std::string) Arch).size ()) + if (((std::string) Arch).size ()) { -#ifdef __x86_64__ - is_64bit = true; -#else - is_64bit = false; -#endif - } - else if (((std::string) Arch).find ("64") != std::string::npos) - is_64bit = true; - else if (((std::string) Arch).find ("32") != std::string::npos - || ((std::string) Arch).find ("x86") != std::string::npos) - is_64bit = false; - else - { - char buff[80 + ((std::string) Arch).size ()]; - sprintf (buff, "Invalid option for --arch: \"%s\"", - ((std::string) Arch).c_str ()); - fprintf (stderr, "*** %s\n", buff); - exit (1); + if (((std::string) Arch).find ("64") != std::string::npos) + is_64bit = true; + else if (((std::string) Arch).find ("32") != std::string::npos + || ((std::string) Arch).find ("x86") != std::string::npos) + is_64bit = false; + else + { + char buff[80 + ((std::string) Arch).size ()]; + sprintf (buff, "Invalid option for --arch: \"%s\"", + ((std::string) Arch).c_str ()); + fprintf (stderr, "*** %s\n", buff); + exit (1); + } } if (GuiLangOption.isPresent()) diff --git a/splash.cc b/splash.cc index 40c1334..8b601db 100644 --- a/splash.cc +++ b/splash.cc @@ -19,7 +19,7 @@ #include "setup_version.h" #include "resource.h" #include "splash.h" -#include "ini.h" +#include "state.h" #define SPLASH_URL "https://cygwin.com" #define SPLASH_COPYRIGHT "Copyright 2000-2023" diff --git a/state.cc b/state.cc index 111b890..ef14116 100644 --- a/state.cc +++ b/state.cc @@ -29,3 +29,9 @@ int root_menu; int root_desktop; LANGID langid; + +#ifdef __x86_64__ +bool is_64bit = true; +#else +bool is_64bit = false; +#endif diff --git a/state.h b/state.h index b211de3..c4b88a4 100644 --- a/state.h +++ b/state.h @@ -48,4 +48,6 @@ extern int root_desktop; extern LANGID langid; +extern bool is_64bit; + #endif /* SETUP_STATE_H */ -- 2.43.0