[ros-diffs] [tkreuzer] 49674: [SPEC2DEF] Add support for different architectures, handle win32/win64

tkreuzer at svn.reactos.org tkreuzer at svn.reactos.org
Sat Nov 20 20:20:27 UTC 2010


Author: tkreuzer
Date: Sat Nov 20 20:20:26 2010
New Revision: 49674

URL: http://svn.reactos.org/svn/reactos?rev=49674&view=rev
Log:
[SPEC2DEF]
Add support for different architectures, handle win32/win64

Modified:
    branches/cmake-bringup/tools/spec2def/spec2def.c

Modified: branches/cmake-bringup/tools/spec2def/spec2def.c
URL: http://svn.reactos.org/svn/reactos/branches/cmake-bringup/tools/spec2def/spec2def.c?rev=49674&r1=49673&r2=49674&view=diff
==============================================================================
--- branches/cmake-bringup/tools/spec2def/spec2def.c [iso-8859-1] (original)
+++ branches/cmake-bringup/tools/spec2def/spec2def.c [iso-8859-1] Sat Nov 20 20:20:26 2010
@@ -19,6 +19,7 @@
 int no_decoration = 0;
 int no_redirections = 0;
 char *pszArchString = "i386";
+char *pszArchString2;
 
 enum
 {
@@ -283,7 +284,8 @@
                 while (*pc == '=' || *pc == ',')
                 {
                     pc++;
-                    if (CompareToken(pc, pszArchString))
+                    if (CompareToken(pc, pszArchString) ||
+                        CompareToken(pc, pszArchString2))
                     {
                         included = 1;
                     }
@@ -397,7 +399,8 @@
            "  -d=<file> --dll=<file>   names the dll\n"
            "  -h --help   prints this screen\n"
            "  -s --stubs  generates an asm lib stub\n"
-           "  -n --no-decoration  removes @xx decorations from def file\n");
+           "  -n --no-decoration  removes @xx decorations from def file\n"
+           "  --arch <arch> Set architecture to <arch>. (i386, x86_64, arm)\n");
 }
 
 int main(int argc, char *argv[])
@@ -449,12 +452,25 @@
         {
             no_redirections = 1;
         }
+        else if ((_stricmp(argv[i], "--arch") == 0))
+        {
+            pszArchString = argv[i + 1];
+            i++;
+        }
         else
         {
             fprintf(stderr, "Unrecognized option: %s\n", argv[i]);
             return -1;
         }
     }
+
+    if ((_stricmp(pszArchString, "x86_64") == 0) ||
+        (_stricmp(pszArchString, "ia64") == 0))
+    {
+        pszArchString2 = "win64";
+    }
+    else
+        pszArchString2 = "win32";
 
     /* Set a default dll name */
     if (!pszDllName)




More information about the Ros-diffs mailing list