- 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.

svn path=/trunk/; revision=28957
This commit is contained in:
Colin Finck 2007-09-08 19:50:20 +00:00
parent 252118319f
commit 47eb99dcf6
8 changed files with 32 additions and 11 deletions

View file

@ -67,8 +67,8 @@ typedef int BOOL;
typedef long int W64 LONG_PTR, *PLONG_PTR; typedef long int W64 LONG_PTR, *PLONG_PTR;
typedef long unsigned int W64 ULONG_PTR, *PULONG_PTR; typedef long unsigned int W64 ULONG_PTR, *PULONG_PTR;
typedef ULONG_PTR SIZE_T, *PSIZE_T; typedef ULONG_PTR SIZE_T, *PSIZE_T;
typedef wchar_t WCHAR, *PWCHAR, *PWSTR, *LPWSTR; typedef unsigned short WCHAR, *PWCHAR, *PWSTR, *LPWSTR;
typedef const wchar_t *PCWSTR, *LPCWSTR; typedef const unsigned short *PCWSTR, *LPCWSTR;
typedef int NTSTATUS; typedef int NTSTATUS;
typedef int POOL_TYPE; typedef int POOL_TYPE;

View file

@ -18,9 +18,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "wine/unicode.h"
#include <stdlib.h> #include <stdlib.h>
#include "wine/unicode.h"
/* Everything below this line is generated automatically by cpmap.pl */ /* Everything below this line is generated automatically by cpmap.pl */
/* ### cpmap begin ### */ /* ### cpmap begin ### */
extern union cptable cptable_037; extern union cptable cptable_037;

View file

@ -18,9 +18,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "wine/unicode.h"
#include <string.h> #include <string.h>
#include "wine/unicode.h"
/* get the decomposition of a Unicode char */ /* get the decomposition of a Unicode char */
static int get_decomposition( WCHAR src, WCHAR *dst, unsigned int dstlen ) static int get_decomposition( WCHAR src, WCHAR *dst, unsigned int dstlen )
{ {

View file

@ -18,10 +18,12 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "wine/unicode.h" #include <ctype.h>
#include <limits.h> #include <limits.h>
#include <stdio.h> #include <stdio.h>
#include "wine/unicode.h"
extern const WCHAR wine_casemap_lower[]; extern const WCHAR wine_casemap_lower[];
extern const WCHAR wine_casemap_upper[]; extern const WCHAR wine_casemap_upper[];
extern const unsigned short wine_wctype_table[]; extern const unsigned short wine_wctype_table[];

View file

@ -96,7 +96,7 @@ UNICODE_OBJECTS = \
UNICODE_HOST_CFLAGS = \ UNICODE_HOST_CFLAGS = \
-D__USE_W32API -DWINVER=0x501 -DWINE_UNICODE_API= \ -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) $(TOOLS_CFLAGS)
.PHONY: unicode .PHONY: unicode

View file

@ -18,9 +18,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "wine/unicode.h"
#include <string.h> #include <string.h>
#include "wine/unicode.h"
/* number of following bytes in sequence based on first byte value (for bytes above 0x7f) */ /* number of following bytes in sequence based on first byte value (for bytes above 0x7f) */
static const char utf8_length[128] = static const char utf8_length[128] =
{ {

View file

@ -18,9 +18,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "wine/unicode.h"
#include <string.h> #include <string.h>
#include "wine/unicode.h"
/* search for a character in the unicode_compose_table; helper for compose() */ /* search for a character in the unicode_compose_table; helper for compose() */
static inline int binary_search( WCHAR ch, int low, int high ) static inline int binary_search( WCHAR ch, int low, int high )
{ {

View file

@ -22,10 +22,25 @@
#define __WINE_UNICODE_H #define __WINE_UNICODE_H
#include <stdarg.h> #include <stdarg.h>
#include <typedefs_host.h>
#include <windef.h> // Definitions copied from <winnls.h>
#include <winbase.h> // We only want to include host headers, so we define them manually
#include <winnls.h> #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 #ifndef WINE_UNICODE_API
#define WINE_UNICODE_API DECLSPEC_IMPORT #define WINE_UNICODE_API DECLSPEC_IMPORT