From 0c2c71bcaec386d7f2ab93d5acee6cce76ba517d Mon Sep 17 00:00:00 2001
From: Alexandre Julliard <julliard@winehq.org>
Date: Mon, 21 Apr 2003 23:27:21 +0000
Subject: [PATCH] Resource names don't need a case-sensitive comparison; this
 avoids depending on libwine_unicode.

---
 tools/winebuild/Makefile.in |  2 +-
 tools/winebuild/res32.c     | 16 ++++++++++++++--
 2 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/tools/winebuild/Makefile.in b/tools/winebuild/Makefile.in
index 24322d2d7a0..8b97e80c9a7 100644
--- a/tools/winebuild/Makefile.in
+++ b/tools/winebuild/Makefile.in
@@ -23,7 +23,7 @@ all: $(PROGRAMS) winebuild.man
 @MAKE_RULES@
 
 winebuild$(EXEEXT): $(OBJS)
-	$(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBUNICODE) $(LIBPORT) $(LDFLAGS)
+	$(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBPORT) $(LDFLAGS)
 
 winebuild.man: winebuild.man.in
 	sed -e 's,@PACKAGE_STRING\@,@PACKAGE_STRING@,g' $(SRCDIR)/winebuild.man.in >$@ || $(RM) $@
diff --git a/tools/winebuild/res32.c b/tools/winebuild/res32.c
index 53095f5d6a9..15635a9d53d 100644
--- a/tools/winebuild/res32.c
+++ b/tools/winebuild/res32.c
@@ -37,7 +37,6 @@
 #endif
 
 #include "winbase.h"
-#include "wine/unicode.h"
 #include "build.h"
 
 /* Unicode string or integer id */
@@ -92,6 +91,19 @@ inline static struct resource *add_resource(void)
     return &resources[nb_resources++];
 }
 
+static inline unsigned int strlenW( const WCHAR *str )
+{
+    const WCHAR *s = str;
+    while (*s) s++;
+    return s - str;
+}
+
+static inline int strcmpW( const WCHAR *str1, const WCHAR *str2 )
+{
+    while (*str1 && (*str1 == *str2)) { str1++; str2++; }
+    return *str1 - *str2;
+}
+
 static struct res_name *add_name( struct res_type *type, const struct resource *res )
 {
     struct res_name *name;
@@ -232,7 +244,7 @@ static int cmp_string( const struct string_id *str1, const struct string_id *str
         return 1;  /* an id compares larger than a string */
     }
     if (!str2->str) return -1;
-    return strcmpiW( str1->str, str2->str );
+    return strcmpW( str1->str, str2->str );
 }
 
 /* compare two resources for sorting the resource directory */
-- 
GitLab