From fa63b1102e0195c7169030237cfbb5d55e596424 Mon Sep 17 00:00:00 2001 From: Colin Finck Date: Fri, 17 Aug 2007 23:08:12 +0000 Subject: [PATCH] Revert r28389 as it causes a build break, when you perform a full clean build I'll commit a correct fix later svn path=/trunk/; revision=28391 --- reactos/include/psdk/basetsd.h | 16 ++----- reactos/include/psdk/basetyps.h | 2 +- reactos/include/psdk/winnt.h | 4 +- reactos/include/reactos/typedefs64.h | 39 ---------------- reactos/lib/cmlib/cmlib.h | 4 -- reactos/lib/cmlib/cmlib.mak | 2 +- reactos/lib/inflib/builddep.h | 6 +-- reactos/lib/inflib/infhost.h | 68 ++++++++++++++-------------- reactos/lib/inflib/infhostgen.c | 20 ++++---- reactos/lib/inflib/infhostget.c | 48 ++++++++++---------- reactos/lib/inflib/infhostglue.c | 2 +- reactos/lib/inflib/infhostput.c | 14 +++--- reactos/tools/mkhive/mkhive.h | 5 -- reactos/tools/mkhive/mkhive.mak | 2 +- 14 files changed, 87 insertions(+), 145 deletions(-) delete mode 100644 reactos/include/reactos/typedefs64.h diff --git a/reactos/include/psdk/basetsd.h b/reactos/include/psdk/basetsd.h index f7519a61590..16428fdbf34 100644 --- a/reactos/include/psdk/basetsd.h +++ b/reactos/include/psdk/basetsd.h @@ -107,21 +107,11 @@ inline void* ULongToPtr( const unsigned long ul ) #else /* !_WIN64 */ typedef _W64 int INT_PTR, *PINT_PTR; typedef _W64 unsigned int UINT_PTR, *PUINT_PTR; - -#ifndef LONG_PTR_DEFINED -#define LONG_PTR_DEFINED - typedef _W64 long LONG_PTR, *PLONG_PTR; - typedef _W64 unsigned long ULONG_PTR, *PULONG_PTR; -#endif - +typedef _W64 long LONG_PTR, *PLONG_PTR; +typedef _W64 unsigned long ULONG_PTR, *PULONG_PTR; typedef unsigned short UHALF_PTR, *PUHALF_PTR; typedef short HALF_PTR, *PHALF_PTR; - -#ifndef HANDLE_PTR_DEFINED -#define HANDLE_PTR_DEFINED - typedef _W64 unsigned long HANDLE_PTR; -#endif - +typedef _W64 unsigned long HANDLE_PTR; #endif /* !_WIN64 */ typedef _W64 ULONG_PTR SIZE_T, *PSIZE_T; diff --git a/reactos/include/psdk/basetyps.h b/reactos/include/psdk/basetyps.h index 8cb5df9cc38..f3dd56105e4 100644 --- a/reactos/include/psdk/basetyps.h +++ b/reactos/include/psdk/basetyps.h @@ -77,8 +77,8 @@ #include #ifndef _ERROR_STATUS_T_DEFINED +typedef unsigned long error_status_t; #define _ERROR_STATUS_T_DEFINED - typedef unsigned long error_status_t; #endif #ifndef _WCHAR_T_DEFINED diff --git a/reactos/include/psdk/winnt.h b/reactos/include/psdk/winnt.h index 3c0c9a02679..437a06bc418 100644 --- a/reactos/include/psdk/winnt.h +++ b/reactos/include/psdk/winnt.h @@ -102,8 +102,8 @@ typedef char CHAR; typedef short SHORT; #ifndef LONG_DEFINED #define LONG_DEFINED - typedef long LONG; - typedef unsigned long ULONG,*PULONG; + typedef long LONG; + typedef unsigned long ULONG,*PULONG; #endif//LONG_DEFINED typedef char CCHAR, *PCCHAR; typedef unsigned char UCHAR,*PUCHAR; diff --git a/reactos/include/reactos/typedefs64.h b/reactos/include/reactos/typedefs64.h deleted file mode 100644 index 1d5339a9b80..00000000000 --- a/reactos/include/reactos/typedefs64.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - PROJECT: ReactOS - LICENSE: GPL v2 or any later version - FILE: include/reactos/typedefs64.h - PURPOSE: Type definitions for host tools, which are built on 64-bit systems - COPYRIGHT: Copyright 2007 Colin Finck -*/ - -#ifndef _TYPEDEFS64_H -#define _TYPEDEFS64_H - -#ifndef DWORD_DEFINED -#define DWORD_DEFINED - typedef unsigned int DWORD; -#endif - -#ifndef LONG_DEFINED -#define LONG_DEFINED - typedef int LONG; - typedef unsigned int ULONG,*PULONG; -#endif - -#ifndef LONG_PTR_DEFINED -#define LONG_PTR_DEFINED - typedef int LONG_PTR, *PLONG_PTR; - typedef unsigned int ULONG_PTR, *PULONG_PTR; -#endif - -#ifndef HANDLE_PTR_DEFINED -#define HANDLE_PTR_DEFINED - typedef unsigned int HANDLE_PTR; -#endif - -#ifndef _ERROR_STATUS_T_DEFINED -#define _ERROR_STATUS_T_DEFINED - typedef unsigned int error_status_t; -#endif - -#endif diff --git a/reactos/lib/cmlib/cmlib.h b/reactos/lib/cmlib/cmlib.h index 1482bc05bc8..8e5ff1bcfbd 100644 --- a/reactos/lib/cmlib/cmlib.h +++ b/reactos/lib/cmlib/cmlib.h @@ -9,10 +9,6 @@ #define CMLIB_H //#define WIN32_NO_STATUS -#ifdef CMLIB_HOST -#include -#endif - #include #include "hivedata.h" #include "cmdata.h" diff --git a/reactos/lib/cmlib/cmlib.mak b/reactos/lib/cmlib/cmlib.mak index 57b06e0358d..c947a310c95 100644 --- a/reactos/lib/cmlib/cmlib.mak +++ b/reactos/lib/cmlib/cmlib.mak @@ -33,7 +33,7 @@ CMLIB_HOST_OBJECTS = \ CMLIB_HOST_CFLAGS = -O3 -Wall -Wwrite-strings -Wpointer-arith \ -D_X86_ -D__i386__ -D_REACTOS_ -D_NTOSKRNL_ -D_NTSYSTEM_ \ -DCMLIB_HOST -D_M_IX86 -I$(CMLIB_BASE) -Iinclude/reactos -Iinclude/psdk -Iinclude/ddk -Iinclude/crt \ - -D__NO_CTYPE_INLINES -DCMLIB_HOST + -D__NO_CTYPE_INLINES $(CMLIB_HOST_TARGET): $(CMLIB_HOST_OBJECTS) | $(CMLIB_OUT) $(ECHO_AR) diff --git a/reactos/lib/inflib/builddep.h b/reactos/lib/inflib/builddep.h index 9aa8423e508..d4c9005ac05 100644 --- a/reactos/lib/inflib/builddep.h +++ b/reactos/lib/inflib/builddep.h @@ -30,10 +30,10 @@ typedef char CHAR, *PCHAR; typedef unsigned char UCHAR, *PUCHAR; +typedef long LONG, *PLONG; +typedef unsigned long ULONG, *PULONG; typedef void VOID, *PVOID; typedef UCHAR BOOLEAN, *PBOOLEAN; -#include -typedef LONG *PLONG; typedef char TCHAR, *PTCHAR, *PTSTR; #define _T(x) x @@ -48,7 +48,7 @@ typedef char TCHAR, *PTCHAR, *PTSTR; #define strcasecmp stricmp #endif -extern ULONG DbgPrint(char *Fmt, ...); +extern unsigned long DbgPrint(char *Fmt, ...); #else /* ! defined(INFLIB_HOST) */ diff --git a/reactos/lib/inflib/infhost.h b/reactos/lib/inflib/infhost.h index 64b4db78340..1e5a83ca59d 100644 --- a/reactos/lib/inflib/infhost.h +++ b/reactos/lib/inflib/infhost.h @@ -17,59 +17,59 @@ extern "C" { extern int InfHostOpenBufferedFile(PHINF InfHandle, void *Buffer, - ULONG BufferSize, - ULONG *ErrorLine); + unsigned long BufferSize, + unsigned long *ErrorLine); extern int InfHostOpenFile(PHINF InfHandle, - const CHAR *FileName, - ULONG *ErrorLine); + const char *FileName, + unsigned long *ErrorLine); extern int InfHostWriteFile(HINF InfHandle, - const CHAR *FileName, - const CHAR *HeaderComment); + const char *FileName, + const char *HeaderComment); extern void InfHostCloseFile(HINF InfHandle); extern int InfHostFindFirstLine(HINF InfHandle, - const CHAR *Section, - const CHAR *Key, + const char *Section, + const char *Key, PINFCONTEXT *Context); extern int InfHostFindNextLine(PINFCONTEXT ContextIn, PINFCONTEXT ContextOut); extern int InfHostFindFirstMatchLine(PINFCONTEXT ContextIn, - const CHAR *Key, + const char *Key, PINFCONTEXT ContextOut); extern int InfHostFindNextMatchLine(PINFCONTEXT ContextIn, - const CHAR *Key, + const char *Key, PINFCONTEXT ContextOut); -extern LONG InfHostGetLineCount(HINF InfHandle, - const CHAR *Section); -extern LONG InfHostGetFieldCount(PINFCONTEXT Context); +extern long InfHostGetLineCount(HINF InfHandle, + const char *Section); +extern long InfHostGetFieldCount(PINFCONTEXT Context); extern int InfHostGetBinaryField(PINFCONTEXT Context, - ULONG FieldIndex, - UCHAR *ReturnBuffer, - ULONG ReturnBufferSize, - ULONG *RequiredSize); + unsigned long FieldIndex, + unsigned char *ReturnBuffer, + unsigned long ReturnBufferSize, + unsigned long *RequiredSize); extern int InfHostGetIntField(PINFCONTEXT Context, - ULONG FieldIndex, - ULONG *IntegerValue); + unsigned long FieldIndex, + unsigned long *IntegerValue); extern int InfHostGetMultiSzField(PINFCONTEXT Context, - ULONG FieldIndex, - CHAR *ReturnBuffer, - ULONG ReturnBufferSize, - ULONG *RequiredSize); + unsigned long FieldIndex, + char *ReturnBuffer, + unsigned long ReturnBufferSize, + unsigned long *RequiredSize); extern int InfHostGetStringField(PINFCONTEXT Context, - ULONG FieldIndex, - CHAR *ReturnBuffer, - ULONG ReturnBufferSize, - ULONG *RequiredSize); + unsigned long FieldIndex, + char *ReturnBuffer, + unsigned long ReturnBufferSize, + unsigned long *RequiredSize); extern int InfHostGetData(PINFCONTEXT Context, - CHAR **Key, - CHAR **Data); + char **Key, + char **Data); extern int InfHostGetDataField(PINFCONTEXT Context, - ULONG FieldIndex, - CHAR **Data); + unsigned long FieldIndex, + char **Data); extern int InfHostFindOrAddSection(HINF InfHandle, - const CHAR *Section, + const char *Section, PINFCONTEXT *Context); -extern int InfHostAddLine(PINFCONTEXT Context, const CHAR *Key); -extern int InfHostAddField(PINFCONTEXT Context, const CHAR *Data); +extern int InfHostAddLine(PINFCONTEXT Context, const char *Key); +extern int InfHostAddField(PINFCONTEXT Context, const char *Data); extern void InfHostFreeContext(PINFCONTEXT Context); #ifdef __cplusplus diff --git a/reactos/lib/inflib/infhostgen.c b/reactos/lib/inflib/infhostgen.c index 2777e22e603..0c0ca473c88 100644 --- a/reactos/lib/inflib/infhostgen.c +++ b/reactos/lib/inflib/infhostgen.c @@ -19,15 +19,15 @@ int InfHostOpenBufferedFile(PHINF InfHandle, void *Buffer, - ULONG BufferSize, - ULONG *ErrorLine) + unsigned long BufferSize, + unsigned long *ErrorLine) { INFSTATUS Status; PINFCACHE Cache; - CHAR *FileBuffer; + char *FileBuffer; *InfHandle = NULL; - *ErrorLine = (ULONG)-1; + *ErrorLine = (unsigned long)-1; /* Allocate file buffer */ FileBuffer = MALLOC(BufferSize + 1); @@ -77,17 +77,17 @@ InfHostOpenBufferedFile(PHINF InfHandle, int InfHostOpenFile(PHINF InfHandle, - const CHAR *FileName, - ULONG *ErrorLine) + const char *FileName, + unsigned long *ErrorLine) { FILE *File; - CHAR *FileBuffer; - ULONG FileLength; + char *FileBuffer; + unsigned long FileLength; PINFCACHE Cache; INFSTATUS Status; *InfHandle = NULL; - *ErrorLine = (ULONG)-1; + *ErrorLine = (unsigned long)-1; /* Open the inf file */ File = fopen(FileName, "rb"); @@ -108,7 +108,7 @@ InfHostOpenFile(PHINF InfHandle, } FileLength = ftell(File); - if ((ULONG) -1 == FileLength) + if ((unsigned long) -1 == FileLength) { DPRINT1("ftell() failed (errno %d)\n", errno); fclose(File); diff --git a/reactos/lib/inflib/infhostget.c b/reactos/lib/inflib/infhostget.c index 806ecdc7464..775773d548b 100644 --- a/reactos/lib/inflib/infhostget.c +++ b/reactos/lib/inflib/infhostget.c @@ -16,8 +16,8 @@ int InfHostFindFirstLine(HINF InfHandle, - const CHAR *Section, - const CHAR *Key, + const char *Section, + const char *Key, PINFCONTEXT *Context) { INFSTATUS Status; @@ -56,7 +56,7 @@ InfHostFindNextLine(PINFCONTEXT ContextIn, int InfHostFindFirstMatchLine(PINFCONTEXT ContextIn, - const CHAR *Key, + const char *Key, PINFCONTEXT ContextOut) { INFSTATUS Status; @@ -76,7 +76,7 @@ InfHostFindFirstMatchLine(PINFCONTEXT ContextIn, int InfHostFindNextMatchLine(PINFCONTEXT ContextIn, - const CHAR *Key, + const char *Key, PINFCONTEXT ContextOut) { INFSTATUS Status; @@ -94,7 +94,7 @@ InfHostFindNextMatchLine(PINFCONTEXT ContextIn, } -LONG +long InfHostGetLineCount(HINF InfHandle, PCTSTR Section) { @@ -105,7 +105,7 @@ InfHostGetLineCount(HINF InfHandle, /* InfGetLineText */ -LONG +long InfHostGetFieldCount(PINFCONTEXT Context) { return InfpGetFieldCount(Context); @@ -114,10 +114,10 @@ InfHostGetFieldCount(PINFCONTEXT Context) int InfHostGetBinaryField(PINFCONTEXT Context, - ULONG FieldIndex, - UCHAR *ReturnBuffer, - ULONG ReturnBufferSize, - ULONG *RequiredSize) + unsigned long FieldIndex, + unsigned char *ReturnBuffer, + unsigned long ReturnBufferSize, + unsigned long *RequiredSize) { INFSTATUS Status; @@ -137,8 +137,8 @@ InfHostGetBinaryField(PINFCONTEXT Context, int InfHostGetIntField(PINFCONTEXT Context, - ULONG FieldIndex, - ULONG *IntegerValue) + unsigned long FieldIndex, + unsigned long *IntegerValue) { INFSTATUS Status; @@ -157,10 +157,10 @@ InfHostGetIntField(PINFCONTEXT Context, int InfHostGetMultiSzField(PINFCONTEXT Context, - ULONG FieldIndex, - CHAR * ReturnBuffer, - ULONG ReturnBufferSize, - ULONG *RequiredSize) + unsigned long FieldIndex, + char * ReturnBuffer, + unsigned long ReturnBufferSize, + unsigned long *RequiredSize) { INFSTATUS Status; @@ -180,10 +180,10 @@ InfHostGetMultiSzField(PINFCONTEXT Context, int InfHostGetStringField(PINFCONTEXT Context, - ULONG FieldIndex, - CHAR *ReturnBuffer, - ULONG ReturnBufferSize, - ULONG *RequiredSize) + unsigned long FieldIndex, + char *ReturnBuffer, + unsigned long ReturnBufferSize, + unsigned long *RequiredSize) { INFSTATUS Status; @@ -203,8 +203,8 @@ InfHostGetStringField(PINFCONTEXT Context, int InfHostGetData(PINFCONTEXT Context, - CHAR **Key, - CHAR **Data) + char **Key, + char **Data) { INFSTATUS Status; @@ -223,8 +223,8 @@ InfHostGetData(PINFCONTEXT Context, int InfHostGetDataField(PINFCONTEXT Context, - ULONG FieldIndex, - CHAR **Data) + unsigned long FieldIndex, + char **Data) { INFSTATUS Status; diff --git a/reactos/lib/inflib/infhostglue.c b/reactos/lib/inflib/infhostglue.c index d889c28a168..6db00e4ae27 100644 --- a/reactos/lib/inflib/infhostglue.c +++ b/reactos/lib/inflib/infhostglue.c @@ -11,7 +11,7 @@ #define NDEBUG #include -ULONG +unsigned long DbgPrint(char *Fmt, ...) { va_list Args; diff --git a/reactos/lib/inflib/infhostput.c b/reactos/lib/inflib/infhostput.c index 55ced937bb6..85c73a933af 100644 --- a/reactos/lib/inflib/infhostput.c +++ b/reactos/lib/inflib/infhostput.c @@ -13,11 +13,11 @@ #include int -InfHostWriteFile(HINF InfHandle, const CHAR *FileName, - const CHAR *HeaderComment) +InfHostWriteFile(HINF InfHandle, const char *FileName, + const char *HeaderComment) { - CHAR *Buffer; - ULONG BufferSize; + char *Buffer; + unsigned long BufferSize; INFSTATUS Status; FILE *File; @@ -60,7 +60,7 @@ InfHostWriteFile(HINF InfHandle, const CHAR *FileName, int InfHostFindOrAddSection(HINF InfHandle, - const CHAR *Section, + const char *Section, PINFCONTEXT *Context) { INFSTATUS Status; @@ -78,7 +78,7 @@ InfHostFindOrAddSection(HINF InfHandle, } int -InfHostAddLine(PINFCONTEXT Context, const CHAR *Key) +InfHostAddLine(PINFCONTEXT Context, const char *Key) { INFSTATUS Status; @@ -95,7 +95,7 @@ InfHostAddLine(PINFCONTEXT Context, const CHAR *Key) } int -InfHostAddField(PINFCONTEXT Context, const CHAR *Data) +InfHostAddField(PINFCONTEXT Context, const char *Data) { INFSTATUS Status; diff --git a/reactos/tools/mkhive/mkhive.h b/reactos/tools/mkhive/mkhive.h index c2efa96aa92..6a1aaff68f6 100644 --- a/reactos/tools/mkhive/mkhive.h +++ b/reactos/tools/mkhive/mkhive.h @@ -37,11 +37,6 @@ #define NTOS_MODE_USER #define WIN32_NO_STATUS - -#ifdef MKHIVE_HOST -#include -#endif - #include #include #include diff --git a/reactos/tools/mkhive/mkhive.mak b/reactos/tools/mkhive/mkhive.mak index 01a5089d3ab..4cbc4d11645 100644 --- a/reactos/tools/mkhive/mkhive.mak +++ b/reactos/tools/mkhive/mkhive.mak @@ -31,7 +31,7 @@ MKHIVE_OBJECTS = \ $(addprefix $(INTERMEDIATE_), $(MKHIVE_SOURCES:.c=.o)) MKHIVE_HOST_CFLAGS = -fshort-wchar $(xTOOLS_CFLAGS) -I$(INFLIB_BASE) -I$(CMLIB_BASE) \ - -D_NTOSKRNL_ -D_NTSYSTEM_ -DMKHIVE_HOST \ + -D_NTOSKRNL_ -D_NTSYSTEM_ \ -Iinclude/reactos -Iinclude/ddk -Iinclude/ndk -Iinclude/psdk -Iinclude -Iinclude/crt -g3 MKHIVE_HOST_LFLAGS = $(xTOOLS_LFLAGS) -g3