Author: hpoussin Date: Mon Aug 27 16:47:56 2007 New Revision: 28599
URL: http://svn.reactos.org/svn/reactos?rev=28599&view=rev Log: Do not include <ntddk.h> when compiling cmlib_host. This file defines too much things.
Modified: trunk/reactos/include/reactos/typedefs_host.h trunk/reactos/lib/cmlib/cmlib.h trunk/reactos/lib/cmlib/cmlib.mak trunk/reactos/tools/mkhive/mkhive.h trunk/reactos/tools/mkhive/rtl.c
Modified: trunk/reactos/include/reactos/typedefs_host.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/typedefs_ho... ============================================================================== --- trunk/reactos/include/reactos/typedefs_host.h (original) +++ trunk/reactos/include/reactos/typedefs_host.h Mon Aug 27 16:47:56 2007 @@ -9,10 +9,13 @@ #ifndef _TYPEDEFS_HOST_H #define _TYPEDEFS_HOST_H
+#include <stdlib.h> #include <limits.h>
#define UNIMPLEMENTED { printf("%s unimplemented\n", __FUNCTION__); exit(1); } -#define ASSERT(x) { if (!(x)) { printf("ASSERT at %s:%d failed\n", __FILE__, __LINE__); exit(1); } } +#define ASSERT(x) { if (!(x)) { printf("Assertion " #x " at %s:%d failed\n", __FILE__, __LINE__); exit(1); } } +#define DPRINT if (0) printf +#define DPRINT1 printf
#define NTAPI __stdcall #define WINAPI __stdcall @@ -24,9 +27,13 @@ #define FALSE 0 #define TRUE (!(FALSE))
+/* FIXME: this value is target specific, host tools MUST not use it + * and this line has to be removed */ +#define PAGE_SIZE 4096 + typedef void VOID, *PVOID, *HANDLE; typedef HANDLE HKEY, *PHKEY; -typedef size_t SIZE_T, *PSIZE_T; +typedef long unsigned int SIZE_T, *PSIZE_T; typedef unsigned char UCHAR, *PUCHAR, BYTE, *LPBYTE; typedef char CHAR, *PCHAR, *PSTR; typedef const char CCHAR; @@ -48,6 +55,7 @@
#define MAXUSHORT USHRT_MAX
+#include <pshpack4.h> typedef struct _RTL_BITMAP { ULONG SizeOfBitMap; @@ -89,9 +97,12 @@ USHORT MaximumLength; PWSTR Buffer; } UNICODE_STRING, *PUNICODE_STRING; +#include <poppack.h> + typedef const UNICODE_STRING *PCUNICODE_STRING;
#define NT_SUCCESS(x) ((x)>=0) +#define FIELD_OFFSET(t,f) ((LONG_PTR)&(((t*)0)->f)) #define RTL_CONSTANT_STRING(s) { sizeof(s)-sizeof((s)[0]), sizeof(s), s } #define RtlZeroMemory(Destination, Length) memset(Destination, 0, Length) #define RtlCopyMemory(Destination, Source, Length) memcpy(Destination, Source, Length)
Modified: trunk/reactos/lib/cmlib/cmlib.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/cmlib/cmlib.h?rev=28599... ============================================================================== --- trunk/reactos/lib/cmlib/cmlib.h (original) +++ trunk/reactos/lib/cmlib/cmlib.h Mon Aug 27 16:47:56 2007 @@ -8,15 +8,48 @@ #ifndef CMLIB_H #define CMLIB_H
-#ifdef _TYPEDEFS_HOST_H -#define REG_OPTION_VOLATILE 1 -#define OBJ_CASE_INSENSITIVE 0x00000040L -#define USHORT_MAX USHRT_MAX +#ifdef CMLIB_HOST +#include <typedefs_host.h> +#include <stdio.h> +#include <string.h> +#include <ntstatus.h> +#endif + +#ifndef _TYPEDEFS_HOST_H + #include <ntddk.h> #else - #ifdef CMLIB_HOST - #include <typedefs64.h> - #endif - #include <ntddk.h> + #define REG_OPTION_VOLATILE 1 + #define OBJ_CASE_INSENSITIVE 0x00000040L + #define USHORT_MAX USHRT_MAX + +VOID NTAPI +KeQuerySystemTime( + OUT PLARGE_INTEGER CurrentTime); + +VOID NTAPI +RtlInitializeBitMap( + IN PRTL_BITMAP BitMapHeader, + IN PULONG BitMapBuffer, + IN ULONG SizeOfBitMap); + +ULONG NTAPI +RtlFindSetBits( + IN PRTL_BITMAP BitMapHeader, + IN ULONG NumberToFind, + IN ULONG HintIndex); + +VOID NTAPI +RtlSetBits( + IN PRTL_BITMAP BitMapHeader, + IN ULONG StartingIndex, + IN ULONG NumberToSet); + +VOID NTAPI +RtlClearAllBits( + IN PRTL_BITMAP BitMapHeader); + +#define RtlCheckBit(BMH,BP) (((((PLONG)(BMH)->Buffer)[(BP) / 32]) >> ((BP) % 32)) & 0x1) + #endif
#include <wchar.h>
Modified: trunk/reactos/lib/cmlib/cmlib.mak URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/cmlib/cmlib.mak?rev=285... ============================================================================== --- trunk/reactos/lib/cmlib/cmlib.mak (original) +++ trunk/reactos/lib/cmlib/cmlib.mak Mon Aug 27 16:47:56 2007 @@ -31,9 +31,8 @@ $(subst $(CMLIB_BASE), $(CMLIB_INT), $(CMLIB_HOST_SOURCES:.c=.o))
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 + -I$(CMLIB_BASE) -Iinclude/reactos -Iinclude/psdk \ + -DCMLIB_HOST
$(CMLIB_HOST_TARGET): $(CMLIB_HOST_OBJECTS) | $(CMLIB_OUT) $(ECHO_AR)
Modified: trunk/reactos/tools/mkhive/mkhive.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/tools/mkhive/mkhive.h?rev=2... ============================================================================== --- trunk/reactos/tools/mkhive/mkhive.h (original) +++ trunk/reactos/tools/mkhive/mkhive.h Mon Aug 27 16:47:56 2007 @@ -33,9 +33,6 @@ #include <typedefs_host.h> #include <ntstatus.h>
-VOID NTAPI -KeQuerySystemTime( - OUT PLARGE_INTEGER CurrentTime); NTSTATUS NTAPI RtlAnsiStringToUnicodeString( IN OUT PUNICODE_STRING UniDest, @@ -74,31 +71,7 @@ #define min(a, b) (((a) < (b)) ? (a) : (b)) #endif
- -/* Debugging macros */ - -#ifdef _MSC_VER -#include <stdio.h> -#include <stdarg.h> -static void DPRINT1(const char* fmt, ... ) -{ - va_list args; - va_start ( args, fmt ); - vprintf ( fmt, args ); - va_end ( args ); -} -static void DPRINT ( const char* fmt, ... ) -{ -} -#else -#define DPRINT1(args...) do { printf("(%s:%d) ",__FILE__,__LINE__); printf(args); } while(0); -#define DPRINT(args...) -#endif//_MSC_VER -#define CHECKPOINT1 do { printf("%s:%d\n",__FILE__,__LINE__); } while(0); - -#define CHECKPOINT - -#ifdef WINDOWS_HOST +#ifdef _WIN32 #define strncasecmp _strnicmp #define strcasecmp _stricmp #else
Modified: trunk/reactos/tools/mkhive/rtl.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/tools/mkhive/rtl.c?rev=2859... ============================================================================== --- trunk/reactos/tools/mkhive/rtl.c (original) +++ trunk/reactos/tools/mkhive/rtl.c Mon Aug 27 16:47:56 2007 @@ -139,7 +139,6 @@ KeQuerySystemTime( OUT PLARGE_INTEGER CurrentTime) { - DPRINT1("KeQuerySystemTime() unimplemented\n"); CurrentTime->QuadPart = 0; }