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 <std::string> 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

Reply via email to