Fix mkhive on unix.

svn path=/trunk/; revision=24242
This commit is contained in:
Art Yerkes 2006-09-24 02:58:31 +00:00
parent 939cbfc4c7
commit 5d46ef1a26
5 changed files with 26 additions and 4 deletions

View file

@ -152,11 +152,15 @@ ifeq ($(word 1,$(shell gcc -dumpmachine)),mingw32)
ifeq ($(findstring msys,$(shell sh --version 2>nul)),msys)
export OSTYPE = msys
HOST=mingw32-linux
CFLAGS+=-fshort-wchar
CPPFLAGS+=-fshort-wchar
else
HOST=mingw32-windows
endif
else
HOST=mingw32-linux
CFLAGS+=-fshort-wchar
CPPFLAGS+=-fshort-wchar
endif
endif

View file

@ -30,7 +30,7 @@ MKHIVE_SOURCES = $(addprefix $(MKHIVE_BASE_), \
MKHIVE_OBJECTS = \
$(addprefix $(INTERMEDIATE_), $(MKHIVE_SOURCES:.c=.o))
MKHIVE_HOST_CFLAGS = $(xTOOLS_CFLAGS) -I$(INFLIB_BASE) -I$(CMLIB_BASE) \
MKHIVE_HOST_CFLAGS = -fshort-wchar $(xTOOLS_CFLAGS) -I$(INFLIB_BASE) -I$(CMLIB_BASE) \
-D_NTOSKRNL_ \
-Iinclude/reactos -Iinclude/ddk -Iinclude/ndk -Iinclude/psdk -Iinclude -Iinclude/crt -g3

View file

@ -122,7 +122,7 @@ RegpOpenOrCreateKey(
LocalKeyName = (PWSTR)KeyName;
for (;;)
{
End = (PWSTR) wcschr(LocalKeyName, '\\');
End = (PWSTR) xwcschr(LocalKeyName, '\\');
if (End)
{
KeyString.Buffer = LocalKeyName;

View file

@ -11,6 +11,24 @@
#include <ntddk.h>
#include <bitmap.c>
SIZE_T xwcslen( PWSTR String ) {
SIZE_T i;
for( i = 0; String[i]; i++ );
return i;
}
PWSTR xwcschr( PWSTR String, WCHAR Char )
{
SIZE_T i;
for( i = 0; String[i] && String[i] != Char; i++ );
if( String[i] ) return &String[i];
else return NULL;
}
/*
* @implemented
*
@ -54,7 +72,7 @@ RtlInitUnicodeString(
if(SourceString)
{
DestSize = wcslen(SourceString) * sizeof(WCHAR);
DestSize = xwcslen(SourceString) * sizeof(WCHAR);
DestinationString->Length = (USHORT)DestSize;
DestinationString->MaximumLength = (USHORT)DestSize + sizeof(WCHAR);
}

View file

@ -55,7 +55,7 @@ WIDL_OBJECTS = \
$(addprefix $(INTERMEDIATE_), $(WIDL_SOURCES:.c=.o))
WIDL_HOST_CFLAGS = $(TOOLS_CFLAGS) \
-DINT16=SHORT -D__USE_W32API -DYYDEBUG=1 \
-DINT16=SHORT -D__USE_W32API -DYYDEBUG=1 -D__REACTOS__=1 \
-I$(WIDL_BASE) -I$(WPP_BASE) \
-Iinclude/reactos/wine -Iinclude/reactos -Iinclude -Iinclude/psdk