2013-03-03  Yaakov Selkowitz  <yselkowitz@...>

	* ini.h (is_legacy): Define outright on x86_64.
	(SETUP_INI_FILENAME): Define uniquely for x86_64.
	(SETUP_BZ2_FILENAME): Ditto.
	* win32.h (IsWindowsNT): Define outright on x86_64.
	* install.cc (FileInuseDlgProc): Fix return type.
	* main.cc (is_legacy): Define only for x86.
	(set_legacy): Compile only for x86.
	(main): Do not compile legacy detection code.
	* regex/regcomp.c (parse_dup_op): Fix invalid cast warning.
	(create_token_tree): Ditto.
	* setup.exe.manifest: Set processorArchitecture to "*".
	Add explicit requestedExecutionLevel for 64-bit compatibility.

Index: ini.h
===================================================================
RCS file: /cvs/cygwin-apps/setup/ini.h,v
retrieving revision 2.41
diff -u -p -r2.41 ini.h
--- ini.h	22 Dec 2009 17:12:46 -0000	2.41
+++ ini.h	3 Mar 2013 06:23:38 -0000
@@ -38,9 +38,16 @@ typedef enum
   EXCLUDE_NOT_FOUND
 } excludes;
 
+
+#ifdef __x86_64__
+#define is_legacy FALSE
+#define SETUP_INI_FILENAME "setup64.ini"
+#define SETUP_BZ2_FILENAME "setup64.bz2"
+#else
 extern bool is_legacy;
 #define SETUP_INI_FILENAME (is_legacy ? "setup-legacy.ini" : "setup.ini")
 #define SETUP_BZ2_FILENAME (is_legacy ? "setup-legacy.bz2" : "setup.bz2")
+#endif
 
 /* The following three vars are used to facilitate error handling between the
    parser/lexer and its callers, namely ini.cc:do_remote_ini() and
Index: install.cc
===================================================================
RCS file: /cvs/cygwin-apps/setup/install.cc,v
retrieving revision 2.103
diff -u -p -r2.103 install.cc
--- install.cc	8 Feb 2013 15:55:01 -0000	2.103
+++ install.cc	3 Mar 2013 06:23:38 -0000
@@ -197,7 +197,7 @@ typedef struct
   int iteration;
 } FileInuseDlgData;
 
-static BOOL CALLBACK
+static INT_PTR CALLBACK
 FileInuseDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 {
   switch (uMsg)
Index: main.cc
===================================================================
RCS file: /cvs/cygwin-apps/setup/main.cc,v
retrieving revision 2.69
diff -u -p -r2.69 main.cc
--- main.cc	4 Sep 2012 13:55:17 -0000	2.69
+++ main.cc	3 Mar 2013 06:23:38 -0000
@@ -86,7 +86,9 @@ extern char **_argv;
 using namespace std;
 
 HINSTANCE hinstance;
+#ifndef __x86_64__
 bool is_legacy;
+#endif
 
 static BoolOption UnattendedOption (false, 'q', "quiet-mode", "Unattended setup mode");
 static BoolOption PackageManagerOption (false, 'M', "package-manager", "Semi-attended chooser-only mode");
@@ -216,6 +218,7 @@ main_display ()
   CoUninitialize ();
 }
 
+#ifndef __x86_64__
 static void
 set_legacy (const char *command)
 {
@@ -229,6 +232,7 @@ set_legacy (const char *command)
   strlwr (buf);
   is_legacy = strstr (buf, "setup-legacy");
 }
+#endif
 
 int WINAPI
 WinMain (HINSTANCE h,
@@ -249,6 +253,7 @@ WinMain (HINSTANCE h,
     ++argc;
   _argv = __argv;
 
+#ifndef __x86_64__
   set_legacy (_argv[0]);
 
   if (is_legacy && IsWindowsNT ())
@@ -274,6 +279,7 @@ WinMain (HINSTANCE h,
 		  MB_OK | MB_ICONSTOP | MB_SETFOREGROUND | MB_TOPMOST);
       return 1;
     }
+#endif
 
   try {
     char cwd[MAX_PATH];
Index: setup.exe.manifest
===================================================================
RCS file: /cvs/cygwin-apps/setup/setup.exe.manifest,v
retrieving revision 2.3
diff -u -p -r2.3 setup.exe.manifest
--- setup.exe.manifest	21 Aug 2012 14:43:41 -0000	2.3
+++ setup.exe.manifest	3 Mar 2013 06:23:38 -0000
@@ -2,7 +2,7 @@
 <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
   <assemblyIdentity
       version="1.0.0.0"
-      processorArchitecture="X86"
+      processorArchitecture="*"
       name="RedHat.Cygwin.Setup"
       type="win32"
   />
@@ -13,12 +13,19 @@
 	      type="win32"
 	      name="Microsoft.Windows.Common-Controls"
 	      version="6.0.0.0"
-	      processorArchitecture="X86"
+	      processorArchitecture="*"
 	      publicKeyToken="6595b64144ccf1df"
 	      language="*"
 	  />
       </dependentAssembly>
   </dependency>
+  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
+    <security>
+      <requestedPrivileges>
+        <requestedExecutionLevel level="requireAdministrator" uiAccess="false"/>
+      </requestedPrivileges>
+    </security>
+  </trustInfo>
   <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
     <application>
       <!--The ID below indicates application support for Windows Vista -->
Index: win32.h
===================================================================
RCS file: /cvs/cygwin-apps/setup/win32.h,v
retrieving revision 2.28
diff -u -p -r2.28 win32.h
--- win32.h	4 Sep 2012 13:55:17 -0000	2.28
+++ win32.h	3 Mar 2013 06:23:38 -0000
@@ -173,7 +173,11 @@ class VersionInfo
 
 VersionInfo& GetVer ();
 
+#ifdef __x86_64__
+#define IsWindowsNT() (TRUE)
+#else
 #define IsWindowsNT() (GetVer ().isNT ())
+#endif
 #define OSMajorVersion() (GetVer ().major ())
 #define OSMinorVersion() (GetVer ().minor ())
 
Index: regex/regcomp.c
===================================================================
RCS file: /cvs/cygwin-apps/setup/regex/regcomp.c,v
retrieving revision 1.1
diff -u -p -r1.1 regcomp.c
--- regex/regcomp.c	17 Feb 2013 21:40:40 -0000	1.1
+++ regex/regcomp.c	3 Mar 2013 06:23:38 -0000
@@ -2510,7 +2510,7 @@ parse_dup_op (bin_tree_t *elem, re_strin
     old_tree = NULL;
 
   if (elem->token.type == SUBEXP)
-    postorder (elem, mark_opt_subexp, (void *) (long) elem->token.opr.idx);
+    postorder (elem, mark_opt_subexp, (void *) (intptr_t) elem->token.opr.idx);
 
   tree = create_tree (dfa, elem, NULL, (end == -1 ? OP_DUP_ASTERISK : OP_ALT));
   if (BE (tree == NULL, 0))
@@ -3723,7 +3723,7 @@ create_token_tree (re_dfa_t *dfa, bin_tr
 static reg_errcode_t
 mark_opt_subexp (void *extra, bin_tree_t *node)
 {
-  int idx = (int) (long) extra;
+  int idx = (int) (intptr_t) extra;
   if (node->token.type == SUBEXP && node->token.opr.idx == idx)
     node->token.opt_subexp = 1;
 
