Alexandre Julliard : libport: Move the case mapping table back to libwine and stop updating it.

Alexandre Julliard julliard at winehq.org
Mon Nov 30 16:13:44 CST 2020


Module: wine
Branch: master
Commit: c7196dc945879e24e0f255c9e108fe116b3b11f2
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=c7196dc945879e24e0f255c9e108fe116b3b11f2

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Sun Nov 29 21:35:16 2020 +0100

libport: Move the case mapping table back to libwine and stop updating it.

Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/winex11.drv/window.c     |  2 ++
 include/wine/unicode.h        |  7 +++----
 libs/port/Makefile.in         |  1 -
 libs/wine/Makefile.in         |  1 +
 libs/{port => wine}/casemap.c |  6 ++++++
 libs/wine/wine.map            |  4 ++--
 tools/make_unicode            | 47 -------------------------------------------
 7 files changed, 14 insertions(+), 54 deletions(-)

diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c
index 457173964eb..ba722721ad2 100644
--- a/dlls/winex11.drv/window.c
+++ b/dlls/winex11.drv/window.c
@@ -37,6 +37,8 @@
 #include <X11/extensions/shape.h>
 #endif /* HAVE_LIBXSHAPE */
 
+/* avoid conflict with field names in included win32 headers */
+#undef Status
 #include "windef.h"
 #include "winbase.h"
 #include "wingdi.h"
diff --git a/include/wine/unicode.h b/include/wine/unicode.h
index a346f4cbecd..011aacf7386 100644
--- a/include/wine/unicode.h
+++ b/include/wine/unicode.h
@@ -26,6 +26,7 @@
 #include <windef.h>
 #include <winbase.h>
 #include <winnls.h>
+#include <winternl.h>
 
 #ifdef __WINE_WINE_TEST_H
 #error This file should not be used in Wine tests
@@ -45,14 +46,12 @@ extern "C" {
 
 WINE_UNICODE_INLINE WCHAR tolowerW( WCHAR ch )
 {
-    extern const WCHAR wine_casemap_lower[];
-    return ch + wine_casemap_lower[wine_casemap_lower[ch >> 8] + (ch & 0xff)];
+    return RtlDowncaseUnicodeChar( ch );
 }
 
 WINE_UNICODE_INLINE WCHAR toupperW( WCHAR ch )
 {
-    extern const WCHAR wine_casemap_upper[];
-    return ch + wine_casemap_upper[wine_casemap_upper[ch >> 8] + (ch & 0xff)];
+    return RtlUpcaseUnicodeChar( ch );
 }
 
 /* the character type contains the C1_* flags in the low 12 bits */
diff --git a/libs/port/Makefile.in b/libs/port/Makefile.in
index aabcc833ec6..5d1019aa801 100644
--- a/libs/port/Makefile.in
+++ b/libs/port/Makefile.in
@@ -1,7 +1,6 @@
 STATICLIB = libwine_port.a
 
 C_SRCS = \
-	casemap.c \
 	ffs.c \
 	fstatvfs.c \
 	getopt.c \
diff --git a/libs/wine/Makefile.in b/libs/wine/Makefile.in
index 74ffc0d5f83..f4086b1a763 100644
--- a/libs/wine/Makefile.in
+++ b/libs/wine/Makefile.in
@@ -66,6 +66,7 @@ C_SRCS = \
 	c_936.c \
 	c_949.c \
 	c_950.c \
+	casemap.c \
 	collation.c \
 	compose.c \
 	config.c \
diff --git a/libs/port/casemap.c b/libs/wine/casemap.c
similarity index 99%
rename from libs/port/casemap.c
rename to libs/wine/casemap.c
index 540f5ad653c..518575faad5 100644
--- a/libs/port/casemap.c
+++ b/libs/wine/casemap.c
@@ -2,6 +2,10 @@
 /* generated from https://www.unicode.org/Public/13.0.0/ucd/UCD.zip:UnicodeData.txt */
 /* DO NOT EDIT!! */
 
+#include "wine/asm.h"
+
+#ifdef __ASM_OBSOLETE
+
 #include "windef.h"
 
 const WCHAR wine_casemap_lower[4122] =
@@ -1101,3 +1105,5 @@ const WCHAR wine_casemap_upper[4557] =
     0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
     0x0000, 0x0000, 0x0000, 0x0000, 0x0000
 };
+
+#endif /* __ASM_OBSOLETE */
diff --git a/libs/wine/wine.map b/libs/wine/wine.map
index 192bf4bd46f..6147dccc77e 100644
--- a/libs/wine/wine.map
+++ b/libs/wine/wine.map
@@ -7,8 +7,6 @@ WINE_1.0
     __wine_main_environ;
     __wine_main_wargv;
     wine_anon_mmap;
-    wine_casemap_lower;
-    wine_casemap_upper;
     wine_dll_set_callback;
     wine_init;
     wine_init_argv0_path;
@@ -64,6 +62,8 @@ WINE_1.0
     vsnprintfW;
     vsprintfW;
     wine_call_on_stack;
+    wine_casemap_lower;
+    wine_casemap_upper;
     wine_compare_string;
     wine_cp_enum_table;
     wine_cp_get_table;
diff --git a/tools/make_unicode b/tools/make_unicode
index 8d5747ce253..c454c74440f 100755
--- a/tools/make_unicode
+++ b/tools/make_unicode
@@ -1716,52 +1716,6 @@ sub dump_digit_folding($)
 }
 
 
-################################################################
-# dump the case mapping tables
-sub dump_case_mappings($)
-{
-    my $filename = shift;
-    open OUTPUT,">$filename.new" or die "Cannot create $filename";
-    print "Building $filename\n";
-    print OUTPUT "/* Unicode case mappings */\n";
-    print OUTPUT "/* generated from $UNIDATA:UnicodeData.txt */\n";
-    print OUTPUT "/* DO NOT EDIT!! */\n\n";
-    print OUTPUT "#include \"windef.h\"\n\n";
-
-    my @upper = @toupper_table;
-    my @lower = @tolower_table;
-    remove_linguistic_mappings( \@upper, \@lower );
-
-    dump_case_table( "wine_casemap_lower", @lower );
-    print OUTPUT "\n";
-    dump_case_table( "wine_casemap_upper", @upper );
-    close OUTPUT;
-    save_file($filename);
-}
-
-
-################################################################
-# dump a case mapping table
-sub dump_case_table($@)
-{
-    my ($name, at table) = @_;
-
-    for (my $i = 0; $i < 65536; $i++)
-    {
-        next unless defined $table[$i];
-        $table[$i] = ($table[$i] - $i) & 0xffff;
-    }
-
-    my @array = compress_array( 256, 0, @table[0..65535] );
-
-    printf OUTPUT "const WCHAR %s[%d] =\n", $name, scalar @array;
-    printf OUTPUT "{\n    /* index */\n";
-    printf OUTPUT "%s,\n", dump_array( 16, 0, @array[0..255] );
-    printf OUTPUT "    /* data */\n";
-    printf OUTPUT "%s", dump_array( 16, 0, @array[256..$#array] );
-    printf OUTPUT "\n};\n";
-}
-
 ################################################################
 # compress a mapping table by removing identical rows
 sub compress_array($$@)
@@ -2784,7 +2738,6 @@ sub save_file($)
 
 chdir ".." if -f "./make_unicode";
 load_data();
-dump_case_mappings( "libs/port/casemap.c" );
 dump_sortkeys( "dlls/kernelbase/collation.c" );
 dump_ctype_tables( "libs/port/wctype.c" );
 dump_bidi_dir_table( "dlls/gdi32/uniscribe/direction.c" );




More information about the wine-cvs mailing list