[UNICODE]

- Finally say goodbye to my "wcsfuncs" experiment started in 2008.
  We have (and always had) Wine's "unicode" library for this, which does the same and is more complete.
  Now that host tools only use include/host, we only need to include <wine/unicode.h> and it will choose the right file in either include/host or include/reactos.
- Fix some include guards in PSDK headers to match the MS ones.
- Always define WINE_UNICODE_API to an empty string instead of doing this separately for every module.
- Cleanup some empty directories or non-existing include pathes.

svn path=/trunk/; revision=52248
This commit is contained in:
Colin Finck 2011-06-15 18:20:05 +00:00
parent 96ba16073d
commit 413867145e
24 changed files with 40 additions and 108 deletions

View file

@ -54,11 +54,7 @@ extern "C" {
#endif
#ifndef WINE_UNICODE_API
# if defined(_MSC_VER) || defined(__MINGW32__)
# define WINE_UNICODE_API DECLSPEC_IMPORT
# else
# define WINE_UNICODE_API
# endif
#define WINE_UNICODE_API
#endif
#ifndef WINE_UNICODE_INLINE

View file

@ -52,21 +52,11 @@
#include <wingdi.h>
#include <winuser.h>
#include <wincon.h>
#ifndef _WINNLS_H
#include <winnls.h>
#endif
#ifndef _WINVER_H
#include <winver.h>
#endif
#ifndef _WINNETWK_H
#include <winnetwk.h>
#endif
#ifndef _WINREG_H
#include <winreg.h>
#endif
#ifndef _WINSVC_H
#include <winsvc.h>
#endif
#ifndef WIN32_LEAN_AND_MEAN
#include <cderr.h>

View file

@ -1,5 +1,5 @@
#ifndef _WINNETWK_H
#define _WINNETWK_H
#ifndef _WINNETWK_
#define _WINNETWK_
#ifdef __cplusplus
extern "C" {

View file

@ -1,5 +1,5 @@
#ifndef _WINNLS_H
#define _WINNLS_H
#ifndef _WINNLS_
#define _WINNLS_
#ifdef __cplusplus
extern "C" {

View file

@ -1,5 +1,5 @@
#ifndef _WINREG_H
#define _WINREG_H
#ifndef _WINREG_
#define _WINREG_
#ifdef __cplusplus
extern "C" {

View file

@ -1,5 +1,5 @@
#ifndef _WINSVC_H
#define _WINSVC_H
#ifndef _WINSVC_
#define _WINSVC_
#ifdef __cplusplus
extern "C" {

View file

@ -1,5 +1,5 @@
#ifndef _WINVER_H
#define _WINVER_H
#ifndef VER_H
#define VER_H
#ifdef __cplusplus
extern "C" {

View file

@ -1,23 +0,0 @@
/*
PROJECT: ReactOS
LICENSE: GPL v2 or any later version
FILE: include/host/wcsfuncs.h
PURPOSE: Header for the "host_wcsfuncs" static library
COPYRIGHT: Copyright 2008 Colin Finck <mail@colinfinck.de>
*/
#ifndef _HOST_WCSFUNCS_H
#define _HOST_WCSFUNCS_H
/* Map str*W functions to wcs* function */
#define isspaceW iswspace
#define strchrW wcschr
#define strcmpiW _wcsicmp
#define strcpyW wcscpy
#define strlenW wcslen
#define strncmpW wcsncmp
#define strtolW wcstol
#define strtoulW wcstoul
#endif

View file

@ -1,5 +1,12 @@
#ifndef _WINE_UNICODE_H
#define _WINE_UNICODE_H
/*
* PROJECT: ReactOS
* LICENSE: LGPL v2.1 or any later version
* PURPOSE: Map Wine's Unicode functions to native wcs* functions wherever possible
* AUTHORS: ?
*/
#ifndef __WINE_WINE_UNICODE_H
#define __WINE_WINE_UNICODE_H
#include <stdarg.h>
#include <stdlib.h>
@ -9,6 +16,14 @@
#include <winbase.h>
#include <winnls.h>
#ifndef WINE_UNICODE_API
#define WINE_UNICODE_API
#endif
#ifndef WINE_UNICODE_INLINE
#define WINE_UNICODE_INLINE static inline
#endif
#define memicmpW(s1,s2,n) _wcsnicmp((const wchar_t *)(s1),(const wchar_t *)(s2),(n))
#define strlenW(s) wcslen((const wchar_t *)(s))
#define strcpyW(d,s) wcscpy((wchar_t *)(d),(const wchar_t *)(s))
@ -25,6 +40,7 @@
#define strncmpiW(s1,s2,n) _wcsnicmp((const wchar_t *)(s1),(const wchar_t *)(s2),(n))
#define strtoulW(s1,s2,b) wcstoul((const wchar_t *)(s1),(wchar_t **)(s2),(b))
#define strspnW(str, accept) wcsspn((const wchar_t *)(str), (const wchar_t *)(accept))
#define strpbrkW(str, accept) wcspbrk((const wchar_t *)(str), (const wchar_t *)(accept))
#define tolowerW(n) towlower((n))
#define toupperW(n) towupper((n))
#define islowerW(n) iswlower((n))
@ -45,28 +61,6 @@
#define vsnprintfW _vsnwprintf
#define isprintW iswprint
#ifndef WINE_UNICODE_API
# if defined(_MSC_VER)
# define WINE_UNICODE_API __declspec(dllimport)
# else
# define WINE_UNICODE_API __attribute__((dllimport))
# endif
#endif
#ifndef __VALIST
#ifdef __GNUC__
#define __VALIST __gnuc_va_list
#else
#define __VALIST char*
#endif
#endif /* defined __VALIST */
static __inline WCHAR *strpbrkW( const WCHAR *str, const WCHAR *accept )
{
for ( ; *str; str++) if (strchrW( accept, *str )) return (WCHAR *)str;
return NULL;
}
static __inline WCHAR *memchrW( const WCHAR *ptr, WCHAR ch, size_t n )
{
const WCHAR *end;

View file

@ -17,7 +17,6 @@ if(CMAKE_CROSSCOMPILING)
add_dependencies(cmlib bugcodes)
else()
add_definitions(
-DWINE_UNICODE_API=
-D__NO_CTYPE_INLINES
-DCMLIB_HOST)
add_library(cmlibhost ${SOURCE})

View file

@ -13,7 +13,6 @@
#define _CMLIB_DEBUG_ 1
#ifdef CMLIB_HOST
#include <wine/unicode.h>
#include <typedefs.h>
#include <stdio.h>
#include <string.h>
@ -69,9 +68,6 @@
#define PWORK_QUEUE_ITEM PVOID
#define EX_PUSH_LOCK PULONG_PTR
/* For <host/wcsfuncs.h> */
#define USE_HOST_WCSFUNCS
#define CMLTRACE(x, ...)
#else
//
@ -89,10 +85,12 @@
#endif
#include <ntdef.h>
#undef DECLSPEC_IMPORT
#define DECLSPEC_IMPORT
#include <ntddk.h>
#include <wcsfuncs.h>
/* Prevent inclusion of Windows headers through <wine/unicode.h> */
#define _WINDEF_
#define _WINBASE_
#define _WINNLS_
#endif
@ -121,6 +119,7 @@
#define CMAPI NTAPI
#include <wine/unicode.h>
#include <wchar.h>
#include "hivedata.h"
#include "cmdata.h"

View file

@ -14,8 +14,6 @@
<file>hivewrt.c</file>
</module>
<module name="cmlibhost" type="hoststaticlibrary">
<define name="WINE_UNICODE_API">" "</define>
<include base="unicode" />
<include base="cmlibhost">.</include>
<define name="__NO_CTYPE_INLINES" />
<define name="_NTOSKRNL_" />

View file

@ -11,7 +11,6 @@
<file>infrosput.c</file>
</module>
<module name="inflibhost" type="hoststaticlibrary" allowwarnings="true">
<include base="ReactOS">include/host</include>
<include base="inflibhost">.</include>
<define name="__NO_CTYPE_INLINES" />
<group compilerset="gcc">

View file

@ -19,7 +19,7 @@ else()
infhostput.c
infhostrtl.c)
add_definitions(-DWINE_UNICODE_API= -D__NO_CTYPE_INLINES -DINFLIB_HOST -DUSE_HOST_WCSFUNCS)
add_definitions(-D__NO_CTYPE_INLINES -DINFLIB_HOST)
if(NOT MSVC)
add_compiler_flags(-Wpointer-arith -Wwrite-strings)
endif()

View file

@ -8,7 +8,6 @@
/* Definitions native to the host on which we're building */
#include <wine/unicode.h>
#include <typedefs.h>
#include <stdarg.h>
@ -63,7 +62,6 @@ BOOLEAN NTAPI RtlIsTextUnicode( PVOID buf, INT len, INT *pf );
#include <windows.h>
#define NTOS_MODE_USER
#include <ndk/ntndk.h>
#include <wcsfuncs.h>
extern PVOID InfpHeap;
@ -83,4 +81,6 @@ extern PVOID InfpHeap;
#endif /* INFLIB_HOST */
#include <wine/unicode.h>
/* EOF */

View file

@ -11,11 +11,8 @@
<file>infrosput.c</file>
</module>
<module name="newinflibhost" type="hoststaticlibrary" allowwarnings="true">
<define name="WINE_UNICODE_API">" "</define>
<include base="unicode" />
<include base="newinflibhost">.</include>
<define name="__NO_CTYPE_INLINES" />
<define name="USE_HOST_WCSFUNCS" />
<group compilerset="gcc">
<compilerflag>-Wwrite-strings</compilerflag>
<compilerflag>-Wpointer-arith</compilerflag>

View file

@ -1,7 +1,5 @@
add_definitions(
-DMKHIVE_HOST
-DWINE_UNICODE_API= )
add_definitions(-DMKHIVE_HOST)
include_directories(
${REACTOS_SOURCE_DIR}/lib/newinflib

View file

@ -1,8 +1,6 @@
<?xml version="1.0"?>
<!DOCTYPE module SYSTEM "../../tools/rbuild/project.dtd">
<module name="mkhive" type="buildtool">
<define name="WINE_UNICODE_API">" "</define>
<include base="unicode" />
<include base="newinflibhost">.</include>
<include base="cmlibhost">.</include>
<include base="zlibhost">.</include>

View file

@ -1,6 +1,3 @@
add_definitions(-DWINE_UNICODE_API= )
list(APPEND SOURCE
casemap.c
compose.c

View file

@ -1,7 +1,6 @@
<?xml version="1.0"?>
<!DOCTYPE module SYSTEM "../../tools/rbuild/project.dtd">
<module name="unicode" type="hoststaticlibrary">
<define name="WINE_UNICODE_API">" "</define>
<file>casemap.c</file>
<file>compose.c</file>
<file>cptable.c</file>
@ -72,4 +71,4 @@
<file>c_28604.c</file>
<file>c_28605.c</file>
<file>c_28606.c</file>
</module>
</module>

View file

@ -9,6 +9,4 @@ list(APPEND SOURCE
add_executable(wmc ${SOURCE})
add_definitions(-DWINE_UNICODE_API= )
target_link_libraries(wmc unicode)

View file

@ -1,8 +1,6 @@
<?xml version="1.0"?>
<!DOCTYPE module SYSTEM "../../tools/rbuild/project.dtd">
<module name="wmc" type="buildtool" allowwarnings="true">
<define name="WINE_UNICODE_API">" "</define>
<include base="unicode">.</include>
<library>unicode</library>
<file>lang.c</file>
<file>mcl.c</file>

View file

@ -14,6 +14,4 @@ list(APPEND SOURCE
add_executable(wrc ${SOURCE})
add_definitions(-DWINE_UNICODE_API= )
target_link_libraries(wrc wpp unicode)

View file

@ -1,9 +1,6 @@
<?xml version="1.0"?>
<!DOCTYPE module SYSTEM "../../tools/rbuild/project.dtd">
<module name="wrc" type="buildtool" allowwarnings="true">
<define name="WINE_UNICODE_API">" "</define>
<include base="unicode" />
<include base="wpp" />
<library>unicode</library>
<library>wpp</library>
<file>dumpres.c</file>