From 4939acf0ace95e5c090e2c0b118c4c0ab9eb76f0 Mon Sep 17 00:00:00 2001
From: Alexandre Julliard <julliard@winehq.org>
Date: Mon, 28 Dec 2009 23:23:54 +0100
Subject: [PATCH] winebuild: Allow optional keywords to be in any order in a
 .def file.

---
 tools/winebuild/parser.c | 43 ++++++++++++++++++++--------------------
 1 file changed, 22 insertions(+), 21 deletions(-)

diff --git a/tools/winebuild/parser.c b/tools/winebuild/parser.c
index 642ccacb0ba..57807ed9407 100644
--- a/tools/winebuild/parser.c
+++ b/tools/winebuild/parser.c
@@ -945,33 +945,34 @@ static int parse_def_export( char *name, DLLSPEC *spec )
 
     /* check for other optional keywords */
 
-    if (token && !strcmp( token, "NONAME" ))
+    while (token)
     {
-        if (odp->ordinal == -1)
+        if (!strcmp( token, "NONAME" ))
         {
-            error( "NONAME requires an ordinal\n" );
+            if (odp->ordinal == -1)
+            {
+                error( "NONAME requires an ordinal\n" );
+                goto error;
+            }
+            odp->export_name = odp->name;
+            odp->name = NULL;
+            odp->flags |= FLAG_NONAME;
+        }
+        else if (!strcmp( token, "PRIVATE" ))
+        {
+            odp->flags |= FLAG_PRIVATE;
+        }
+        else if (!strcmp( token, "DATA" ))
+        {
+            odp->type = TYPE_EXTERN;
+        }
+        else
+        {
+            error( "Garbage text '%s' found at end of export declaration\n", token );
             goto error;
         }
-        odp->export_name = odp->name;
-        odp->name = NULL;
-        odp->flags |= FLAG_NONAME;
         token = GetToken(1);
     }
-    if (token && !strcmp( token, "PRIVATE" ))
-    {
-        odp->flags |= FLAG_PRIVATE;
-        token = GetToken(1);
-    }
-    if (token && !strcmp( token, "DATA" ))
-    {
-        odp->type = TYPE_EXTERN;
-        token = GetToken(1);
-    }
-    if (token)
-    {
-        error( "Garbage text '%s' found at end of export declaration\n", token );
-        goto error;
-    }
     return 1;
 
 error:
-- 
GitLab