fix some MSVC compile problems Modified: trunk/reactos/lib/crt/include/internal/debug.h Modified: trunk/reactos/lib/crt/precomp.h Modified: trunk/reactos/lib/crt/process/_cwait.c Modified: trunk/reactos/lib/crt/process/dll.c _____
Modified: trunk/reactos/lib/crt/include/internal/debug.h --- trunk/reactos/lib/crt/include/internal/debug.h 2005-11-15 09:47:31 UTC (rev 19244) +++ trunk/reactos/lib/crt/include/internal/debug.h 2005-11-15 14:26:06 UTC (rev 19245) @@ -30,9 +30,10 @@
unsigned long DbgPrint(char *Format,...);
-#define TRACE(...) +#ifdef __GNUC__ + #define TRACE(...) +#endif
- #ifdef DBG #ifdef __GNUC__ #define DPRINT1(args...) do { DbgPrint("(MSVCRT:%s:%d) ",__FILE__,__LINE__); DbgPrint(args); } while(0); @@ -50,7 +51,9 @@ #endif
#if !defined(NDEBUG) && defined(DBG) - #define DPRINT(args...) do { DbgPrint("(MSVCRT:%s:%d) ",__FILE__,__LINE__); DbgPrint(args); } while(0); + #ifdef __GNUC__ + #define DPRINT(args...) do { DbgPrint("(MSVCRT:%s:%d) ",__FILE__,__LINE__); DbgPrint(args); } while(0); + #endif #define CHECKPOINT do { DbgPrint("MSVCRT:%s:%d\n",__FILE__,__LINE__); } while(0); #else #ifdef __GNUC__ _____
Modified: trunk/reactos/lib/crt/precomp.h --- trunk/reactos/lib/crt/precomp.h 2005-11-15 09:47:31 UTC (rev 19244) +++ trunk/reactos/lib/crt/precomp.h 2005-11-15 14:26:06 UTC (rev 19245) @@ -1,3 +1,7 @@
#define CRT_SECURE_NO_DEPRECATE
#include <windows.h> + +#if !defined(_MSC_VER) + #include <stdint.h> +#endif _____
Modified: trunk/reactos/lib/crt/process/_cwait.c --- trunk/reactos/lib/crt/process/_cwait.c 2005-11-15 09:47:31 UTC (rev 19244) +++ trunk/reactos/lib/crt/process/_cwait.c 2005-11-15 14:26:06 UTC (rev 19245) @@ -22,15 +22,15 @@
DWORD ExitCode;
nAction = 0; - if (WaitForSingleObject((void*)hProc, INFINITE) != WAIT_OBJECT_0) { + if (WaitForSingleObject((void*)ULongToPtr(hProc), INFINITE) != WAIT_OBJECT_0) { __set_errno(ECHILD); return -1; }
- if (!GetExitCodeProcess((void*)hProc, &ExitCode)) + if (!GetExitCodeProcess((void*)ULongToPtr(hProc), &ExitCode)) return -1; if (pnStatus != NULL) *pnStatus = (int)ExitCode; - CloseHandle((HANDLE)hProc); + CloseHandle((HANDLE)ULongToPtr(hProc)); return hProc; } _____
Modified: trunk/reactos/lib/crt/process/dll.c --- trunk/reactos/lib/crt/process/dll.c 2005-11-15 09:47:31 UTC (rev 19244) +++ trunk/reactos/lib/crt/process/dll.c 2005-11-15 14:26:06 UTC (rev 19245) @@ -11,31 +11,30 @@
#include "precomp.h" #include <process.h>
- /* * @implemented */ -void* _loaddll(char* name) +intptr_t _loaddll(char* name) { - return LoadLibraryA(name); + return (intptr_t) LoadLibraryA(name); }
/* * @implemented */ -int _unloaddll(void* handle) +int _unloaddll(intptr_t handle) { - return FreeLibrary(handle); + return FreeLibrary((HMODULE) handle); }
/* * @implemented */ -FARPROC _getdllprocaddr(void* hModule, char* lpProcName, int iOrdinal) +FARPROC _getdllprocaddr(intptr_t hModule, char* lpProcName, intptr_t iOrdinal) { if (lpProcName != NULL) - return GetProcAddress(hModule, lpProcName); + return GetProcAddress((HMODULE) hModule, lpProcName); else - return GetProcAddress(hModule, (LPSTR)iOrdinal); + return GetProcAddress((HMODULE) hModule, (LPSTR)iOrdinal); return (NULL); }