Author: cfinck Date: Sat Sep 8 23:50:20 2007 New Revision: 28957
URL: http://svn.reactos.org/svn/reactos?rev=28957&view=rev Log: - Solve our wchar_t host problems the easy way by defining WCHAR to "unsigned short" (thx KJK for the hint) - Revert my changes to the "unicode" module in r28411 and r28423 - Include "typedefs_host.h" instead of the Windows headers in "wine/unicode.h", this component doesn't depend on target headers anymore. To get it to work completely without Windows headers, I also had to copy some definitions from <winnls.h> to the "wine/unicode.h" file.
Modified: trunk/reactos/include/reactos/typedefs_host.h trunk/reactos/tools/unicode/cptable.c trunk/reactos/tools/unicode/mbtowc.c trunk/reactos/tools/unicode/string.c trunk/reactos/tools/unicode/unicode.mak trunk/reactos/tools/unicode/utf8.c trunk/reactos/tools/unicode/wctomb.c trunk/reactos/tools/unicode/wine/unicode.h
Modified: trunk/reactos/include/reactos/typedefs_host.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/typedefs_ho... ============================================================================== --- trunk/reactos/include/reactos/typedefs_host.h (original) +++ trunk/reactos/include/reactos/typedefs_host.h Sat Sep 8 23:50:20 2007 @@ -67,8 +67,8 @@ typedef long int W64 LONG_PTR, *PLONG_PTR; typedef long unsigned int W64 ULONG_PTR, *PULONG_PTR; typedef ULONG_PTR SIZE_T, *PSIZE_T; -typedef wchar_t WCHAR, *PWCHAR, *PWSTR, *LPWSTR; -typedef const wchar_t *PCWSTR, *LPCWSTR; +typedef unsigned short WCHAR, *PWCHAR, *PWSTR, *LPWSTR; +typedef const unsigned short *PCWSTR, *LPCWSTR; typedef int NTSTATUS; typedef int POOL_TYPE;
Modified: trunk/reactos/tools/unicode/cptable.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/tools/unicode/cptable.c?rev... ============================================================================== --- trunk/reactos/tools/unicode/cptable.c (original) +++ trunk/reactos/tools/unicode/cptable.c Sat Sep 8 23:50:20 2007 @@ -18,8 +18,9 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
+#include <stdlib.h> + #include "wine/unicode.h" -#include <stdlib.h>
/* Everything below this line is generated automatically by cpmap.pl */ /* ### cpmap begin ### */
Modified: trunk/reactos/tools/unicode/mbtowc.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/tools/unicode/mbtowc.c?rev=... ============================================================================== --- trunk/reactos/tools/unicode/mbtowc.c (original) +++ trunk/reactos/tools/unicode/mbtowc.c Sat Sep 8 23:50:20 2007 @@ -18,8 +18,9 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
+#include <string.h> + #include "wine/unicode.h" -#include <string.h>
/* get the decomposition of a Unicode char */ static int get_decomposition( WCHAR src, WCHAR *dst, unsigned int dstlen )
Modified: trunk/reactos/tools/unicode/string.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/tools/unicode/string.c?rev=... ============================================================================== --- trunk/reactos/tools/unicode/string.c (original) +++ trunk/reactos/tools/unicode/string.c Sat Sep 8 23:50:20 2007 @@ -18,9 +18,11 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
-#include "wine/unicode.h" +#include <ctype.h> #include <limits.h> #include <stdio.h> + +#include "wine/unicode.h"
extern const WCHAR wine_casemap_lower[]; extern const WCHAR wine_casemap_upper[];
Modified: trunk/reactos/tools/unicode/unicode.mak URL: http://svn.reactos.org/svn/reactos/trunk/reactos/tools/unicode/unicode.mak?r... ============================================================================== --- trunk/reactos/tools/unicode/unicode.mak (original) +++ trunk/reactos/tools/unicode/unicode.mak Sat Sep 8 23:50:20 2007 @@ -96,7 +96,7 @@
UNICODE_HOST_CFLAGS = \ -D__USE_W32API -DWINVER=0x501 -DWINE_UNICODE_API= \ - -I$(UNICODE_BASE) -Iinclude/reactos/wine -Iinclude -Iinclude/psdk \ + -I$(UNICODE_BASE) -Iinclude/reactos/wine -Iinclude -Iinclude/psdk -Iinclude/reactos \ $(TOOLS_CFLAGS)
.PHONY: unicode
Modified: trunk/reactos/tools/unicode/utf8.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/tools/unicode/utf8.c?rev=28... ============================================================================== --- trunk/reactos/tools/unicode/utf8.c (original) +++ trunk/reactos/tools/unicode/utf8.c Sat Sep 8 23:50:20 2007 @@ -18,8 +18,9 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
+#include <string.h> + #include "wine/unicode.h" -#include <string.h>
/* number of following bytes in sequence based on first byte value (for bytes above 0x7f) */ static const char utf8_length[128] =
Modified: trunk/reactos/tools/unicode/wctomb.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/tools/unicode/wctomb.c?rev=... ============================================================================== --- trunk/reactos/tools/unicode/wctomb.c (original) +++ trunk/reactos/tools/unicode/wctomb.c Sat Sep 8 23:50:20 2007 @@ -18,8 +18,9 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
+#include <string.h> + #include "wine/unicode.h" -#include <string.h>
/* search for a character in the unicode_compose_table; helper for compose() */ static inline int binary_search( WCHAR ch, int low, int high )
Modified: trunk/reactos/tools/unicode/wine/unicode.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/tools/unicode/wine/unicode.... ============================================================================== --- trunk/reactos/tools/unicode/wine/unicode.h (original) +++ trunk/reactos/tools/unicode/wine/unicode.h Sat Sep 8 23:50:20 2007 @@ -22,10 +22,25 @@ #define __WINE_UNICODE_H
#include <stdarg.h> - -#include <windef.h> -#include <winbase.h> -#include <winnls.h> +#include <typedefs_host.h> + +// Definitions copied from <winnls.h> +// We only want to include host headers, so we define them manually +#define C1_UPPER 1 +#define C1_LOWER 2 +#define C1_DIGIT 4 +#define C1_SPACE 8 +#define C1_PUNCT 16 +#define C1_CNTRL 32 +#define C1_BLANK 64 +#define C1_XDIGIT 128 +#define C1_ALPHA 256 +#define MB_COMPOSITE 2 +#define MB_ERR_INVALID_CHARS 8 +#define WC_COMPOSITECHECK 512 +#define WC_DISCARDNS 16 +#define WC_DEFAULTCHAR 64 +#define WC_NO_BEST_FIT_CHARS 1024
#ifndef WINE_UNICODE_API #define WINE_UNICODE_API DECLSPEC_IMPORT