[ros-diffs] [tkreuzer] 49602: [SPEC2PDEF] - Add support for architecture specific exports, currently i386 is hardcoded

tkreuzer at svn.reactos.org tkreuzer at svn.reactos.org
Mon Nov 15 22:07:29 UTC 2010


Author: tkreuzer
Date: Mon Nov 15 22:07:28 2010
New Revision: 49602

URL: http://svn.reactos.org/svn/reactos?rev=49602&view=rev
Log:
[SPEC2PDEF]
- Add support for architecture specific exports, currently i386 is hardcoded

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

Modified: branches/cmake-bringup/tools/spec2pdef/spec2pdef.c
URL: http://svn.reactos.org/svn/reactos/branches/cmake-bringup/tools/spec2pdef/spec2pdef.c?rev=49602&r1=49601&r2=49602&view=diff
==============================================================================
--- branches/cmake-bringup/tools/spec2pdef/spec2pdef.c [iso-8859-1] (original)
+++ branches/cmake-bringup/tools/spec2pdef/spec2pdef.c [iso-8859-1] Mon Nov 15 22:07:28 2010
@@ -18,6 +18,7 @@
 void (*OutputHeader)(FILE *, char *);
 int no_decoration = 0;
 int no_redirections = 0;
+char *pszArchString = "i386";
 
 enum
 {
@@ -39,7 +40,8 @@
 int
 IsSeparator(char chr)
 {
-    return ((chr <= '*' && chr != '$') || chr == ';');
+    return ((chr <= '*' && chr != '$') ||
+            (chr >= ':' && chr <= '?') );
 }
 
 int
@@ -248,6 +250,7 @@
     char *pc, *pcLine;
     int nLine;
     EXPORT exp;
+    int included;
 
     //fprintf(stderr, "info: line %d, pcStart:'%.30s'\n", nLine, pcStart);
     
@@ -320,16 +323,42 @@
         }
 
         /* Handle options */
+        included = 1;
         while (*pc == '-')
         {
-            fprintf(stderr, "info: got option: '%.10s'\n", pc);
-            // FIXME: handle options
+            if (CompareToken(pc, "-arch"))
+            {
+                /* Default to not included */
+                included = 0;
+                pc += 5;
+
+                /* Look if we are included */
+                while (*pc == '=' || *pc == ',')
+                {
+                    pc++;
+                    if (CompareToken(pc, pszArchString))
+                    {
+                        included = 1;
+                        break;
+                    }
+                    
+                    /* Skip to next arch or end */
+                    while (*pc > ',') pc++;
+                }
+            }
+            else
+            {
+                fprintf(stderr, "info: ignored option: '%.10s'\n", pc);
+            }
 
             /* Go to next token */
             pc = NextToken(pc);
         }
 
         //fprintf(stderr, "info: Name:'%.10s'\n", pc);
+        
+        /* If arch didn't match ours, skip this entry */
+        if (!included) continue;
 
         /* Get name */
         exp.pcName = pc;




More information about the Ros-diffs mailing list