Author: cfinck
Date: Wed Jun 15 18:20:05 2011
New Revision: 52248
URL:
http://svn.reactos.org/svn/reactos?rev=52248&view=rev
Log:
[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.
Removed:
trunk/reactos/include/reactos/wcsfuncs.h
trunk/reactos/tools/unicode/wine/
Modified:
trunk/reactos/include/host/wine/unicode.h
trunk/reactos/include/psdk/windows.h
trunk/reactos/include/psdk/winnetwk.h
trunk/reactos/include/psdk/winnls.h
trunk/reactos/include/psdk/winreg.h
trunk/reactos/include/psdk/winsvc.h
trunk/reactos/include/psdk/winver.h
trunk/reactos/include/reactos/wine/unicode.h
trunk/reactos/lib/cmlib/CMakeLists.txt
trunk/reactos/lib/cmlib/cmlib.h
trunk/reactos/lib/cmlib/cmlib.rbuild
trunk/reactos/lib/inflib/inflib.rbuild
trunk/reactos/lib/newinflib/CMakeLists.txt
trunk/reactos/lib/newinflib/builddep.h
trunk/reactos/lib/newinflib/inflib.rbuild
trunk/reactos/tools/mkhive/CMakeLists.txt
trunk/reactos/tools/mkhive/mkhive.rbuild
trunk/reactos/tools/unicode/CMakeLists.txt
trunk/reactos/tools/unicode/unicode.rbuild
trunk/reactos/tools/wmc/CMakeLists.txt
trunk/reactos/tools/wmc/wmc.rbuild
trunk/reactos/tools/wrc/CMakeLists.txt
trunk/reactos/tools/wrc/wrc.rbuild
Modified: trunk/reactos/include/host/wine/unicode.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/host/wine/unicode.…
==============================================================================
--- trunk/reactos/include/host/wine/unicode.h [iso-8859-1] (original)
+++ trunk/reactos/include/host/wine/unicode.h [iso-8859-1] Wed Jun 15 18:20:05 2011
@@ -54,11 +54,7 @@
#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
Modified: trunk/reactos/include/psdk/windows.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/windows.h?rev…
==============================================================================
--- trunk/reactos/include/psdk/windows.h [iso-8859-1] (original)
+++ trunk/reactos/include/psdk/windows.h [iso-8859-1] Wed Jun 15 18:20:05 2011
@@ -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>
Modified: trunk/reactos/include/psdk/winnetwk.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/winnetwk.h?re…
==============================================================================
--- trunk/reactos/include/psdk/winnetwk.h [iso-8859-1] (original)
+++ trunk/reactos/include/psdk/winnetwk.h [iso-8859-1] Wed Jun 15 18:20:05 2011
@@ -1,5 +1,5 @@
-#ifndef _WINNETWK_H
-#define _WINNETWK_H
+#ifndef _WINNETWK_
+#define _WINNETWK_
#ifdef __cplusplus
extern "C" {
Modified: trunk/reactos/include/psdk/winnls.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/winnls.h?rev=…
==============================================================================
--- trunk/reactos/include/psdk/winnls.h [iso-8859-1] (original)
+++ trunk/reactos/include/psdk/winnls.h [iso-8859-1] Wed Jun 15 18:20:05 2011
@@ -1,5 +1,5 @@
-#ifndef _WINNLS_H
-#define _WINNLS_H
+#ifndef _WINNLS_
+#define _WINNLS_
#ifdef __cplusplus
extern "C" {
Modified: trunk/reactos/include/psdk/winreg.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/winreg.h?rev=…
==============================================================================
--- trunk/reactos/include/psdk/winreg.h [iso-8859-1] (original)
+++ trunk/reactos/include/psdk/winreg.h [iso-8859-1] Wed Jun 15 18:20:05 2011
@@ -1,5 +1,5 @@
-#ifndef _WINREG_H
-#define _WINREG_H
+#ifndef _WINREG_
+#define _WINREG_
#ifdef __cplusplus
extern "C" {
Modified: trunk/reactos/include/psdk/winsvc.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/winsvc.h?rev=…
==============================================================================
--- trunk/reactos/include/psdk/winsvc.h [iso-8859-1] (original)
+++ trunk/reactos/include/psdk/winsvc.h [iso-8859-1] Wed Jun 15 18:20:05 2011
@@ -1,5 +1,5 @@
-#ifndef _WINSVC_H
-#define _WINSVC_H
+#ifndef _WINSVC_
+#define _WINSVC_
#ifdef __cplusplus
extern "C" {
Modified: trunk/reactos/include/psdk/winver.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/winver.h?rev=…
==============================================================================
--- trunk/reactos/include/psdk/winver.h [iso-8859-1] (original)
+++ trunk/reactos/include/psdk/winver.h [iso-8859-1] Wed Jun 15 18:20:05 2011
@@ -1,5 +1,5 @@
-#ifndef _WINVER_H
-#define _WINVER_H
+#ifndef VER_H
+#define VER_H
#ifdef __cplusplus
extern "C" {
Removed: trunk/reactos/include/reactos/wcsfuncs.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/wcsfuncs.h…
==============================================================================
--- trunk/reactos/include/reactos/wcsfuncs.h [iso-8859-1] (original)
+++ trunk/reactos/include/reactos/wcsfuncs.h (removed)
@@ -1,23 +1,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(a)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
Modified: trunk/reactos/include/reactos/wine/unicode.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/wine/unico…
==============================================================================
--- trunk/reactos/include/reactos/wine/unicode.h [iso-8859-1] (original)
+++ trunk/reactos/include/reactos/wine/unicode.h [iso-8859-1] Wed Jun 15 18:20:05 2011
@@ -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>
@@ -8,6 +15,14 @@
#include <windef.h>
#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))
@@ -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;
Modified: trunk/reactos/lib/cmlib/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/cmlib/CMakeLists.txt?r…
==============================================================================
--- trunk/reactos/lib/cmlib/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/lib/cmlib/CMakeLists.txt [iso-8859-1] Wed Jun 15 18:20:05 2011
@@ -17,7 +17,6 @@
add_dependencies(cmlib bugcodes)
else()
add_definitions(
- -DWINE_UNICODE_API=
-D__NO_CTYPE_INLINES
-DCMLIB_HOST)
add_library(cmlibhost ${SOURCE})
Modified: trunk/reactos/lib/cmlib/cmlib.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/cmlib/cmlib.h?rev=5224…
==============================================================================
--- trunk/reactos/lib/cmlib/cmlib.h [iso-8859-1] (original)
+++ trunk/reactos/lib/cmlib/cmlib.h [iso-8859-1] Wed Jun 15 18:20:05 2011
@@ -13,7 +13,6 @@
#define _CMLIB_DEBUG_ 1
#ifdef CMLIB_HOST
- #include <wine/unicode.h>
#include <typedefs.h>
#include <stdio.h>
#include <string.h>
@@ -68,9 +67,6 @@
#define PKEVENT PVOID
#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"
Modified: trunk/reactos/lib/cmlib/cmlib.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/cmlib/cmlib.rbuild?rev…
==============================================================================
--- trunk/reactos/lib/cmlib/cmlib.rbuild [iso-8859-1] (original)
+++ trunk/reactos/lib/cmlib/cmlib.rbuild [iso-8859-1] Wed Jun 15 18:20:05 2011
@@ -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_" />
Modified: trunk/reactos/lib/inflib/inflib.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/inflib/inflib.rbuild?r…
==============================================================================
--- trunk/reactos/lib/inflib/inflib.rbuild [iso-8859-1] (original)
+++ trunk/reactos/lib/inflib/inflib.rbuild [iso-8859-1] Wed Jun 15 18:20:05 2011
@@ -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">
Modified: trunk/reactos/lib/newinflib/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/newinflib/CMakeLists.t…
==============================================================================
--- trunk/reactos/lib/newinflib/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/lib/newinflib/CMakeLists.txt [iso-8859-1] Wed Jun 15 18:20:05 2011
@@ -19,7 +19,7 @@
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()
Modified: trunk/reactos/lib/newinflib/builddep.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/newinflib/builddep.h?r…
==============================================================================
--- trunk/reactos/lib/newinflib/builddep.h [iso-8859-1] (original)
+++ trunk/reactos/lib/newinflib/builddep.h [iso-8859-1] Wed Jun 15 18:20:05 2011
@@ -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 @@
#include <windows.h>
#define NTOS_MODE_USER
#include <ndk/ntndk.h>
-#include <wcsfuncs.h>
extern PVOID InfpHeap;
@@ -83,4 +81,6 @@
#endif /* INFLIB_HOST */
+#include <wine/unicode.h>
+
/* EOF */
Modified: trunk/reactos/lib/newinflib/inflib.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/newinflib/inflib.rbuil…
==============================================================================
--- trunk/reactos/lib/newinflib/inflib.rbuild [iso-8859-1] (original)
+++ trunk/reactos/lib/newinflib/inflib.rbuild [iso-8859-1] Wed Jun 15 18:20:05 2011
@@ -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>
Modified: trunk/reactos/tools/mkhive/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/mkhive/CMakeLists.tx…
==============================================================================
--- trunk/reactos/tools/mkhive/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/tools/mkhive/CMakeLists.txt [iso-8859-1] Wed Jun 15 18:20:05 2011
@@ -1,7 +1,5 @@
-add_definitions(
- -DMKHIVE_HOST
- -DWINE_UNICODE_API= )
+add_definitions(-DMKHIVE_HOST)
include_directories(
${REACTOS_SOURCE_DIR}/lib/newinflib
Modified: trunk/reactos/tools/mkhive/mkhive.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/mkhive/mkhive.rbuild…
==============================================================================
--- trunk/reactos/tools/mkhive/mkhive.rbuild [iso-8859-1] (original)
+++ trunk/reactos/tools/mkhive/mkhive.rbuild [iso-8859-1] Wed Jun 15 18:20:05 2011
@@ -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>
Modified: trunk/reactos/tools/unicode/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/unicode/CMakeLists.t…
==============================================================================
--- trunk/reactos/tools/unicode/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/tools/unicode/CMakeLists.txt [iso-8859-1] Wed Jun 15 18:20:05 2011
@@ -1,6 +1,3 @@
-
-add_definitions(-DWINE_UNICODE_API= )
-
list(APPEND SOURCE
casemap.c
compose.c
Modified: trunk/reactos/tools/unicode/unicode.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/unicode/unicode.rbui…
==============================================================================
--- trunk/reactos/tools/unicode/unicode.rbuild [iso-8859-1] (original)
+++ trunk/reactos/tools/unicode/unicode.rbuild [iso-8859-1] Wed Jun 15 18:20:05 2011
@@ -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>
Modified: trunk/reactos/tools/wmc/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/wmc/CMakeLists.txt?r…
==============================================================================
--- trunk/reactos/tools/wmc/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/tools/wmc/CMakeLists.txt [iso-8859-1] Wed Jun 15 18:20:05 2011
@@ -9,6 +9,4 @@
add_executable(wmc ${SOURCE})
-add_definitions(-DWINE_UNICODE_API= )
-
target_link_libraries(wmc unicode)
Modified: trunk/reactos/tools/wmc/wmc.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/wmc/wmc.rbuild?rev=5…
==============================================================================
--- trunk/reactos/tools/wmc/wmc.rbuild [iso-8859-1] (original)
+++ trunk/reactos/tools/wmc/wmc.rbuild [iso-8859-1] Wed Jun 15 18:20:05 2011
@@ -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>
Modified: trunk/reactos/tools/wrc/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/wrc/CMakeLists.txt?r…
==============================================================================
--- trunk/reactos/tools/wrc/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/tools/wrc/CMakeLists.txt [iso-8859-1] Wed Jun 15 18:20:05 2011
@@ -14,6 +14,4 @@
add_executable(wrc ${SOURCE})
-add_definitions(-DWINE_UNICODE_API= )
-
target_link_libraries(wrc wpp unicode)
Modified: trunk/reactos/tools/wrc/wrc.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/wrc/wrc.rbuild?rev=5…
==============================================================================
--- trunk/reactos/tools/wrc/wrc.rbuild [iso-8859-1] (original)
+++ trunk/reactos/tools/wrc/wrc.rbuild [iso-8859-1] Wed Jun 15 18:20:05 2011
@@ -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>