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

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2020-11-29 21:35:16 +01:00
parent 00d067769e
commit c7196dc945
7 changed files with 14 additions and 54 deletions

View File

@ -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"

View File

@ -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 */

View File

@ -1,7 +1,6 @@
STATICLIB = libwine_port.a
C_SRCS = \
casemap.c \
ffs.c \
fstatvfs.c \
getopt.c \

View File

@ -66,6 +66,7 @@ C_SRCS = \
c_936.c \
c_949.c \
c_950.c \
casemap.c \
collation.c \
compose.c \
config.c \

View File

@ -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 */

View File

@ -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;

View File

@ -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,@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" );