From 4aa521a7f6f7a94a5a75bfdc96d900a0033bf70c Mon Sep 17 00:00:00 2001 From: Christoph von Wittich Date: Tue, 15 Nov 2005 14:26:06 +0000 Subject: [PATCH] fix some MSVC compile problems svn path=/trunk/; revision=19245 --- reactos/lib/crt/include/internal/debug.h | 9 ++++++--- reactos/lib/crt/precomp.h | 4 ++++ reactos/lib/crt/process/_cwait.c | 6 +++--- reactos/lib/crt/process/dll.c | 15 +++++++-------- 4 files changed, 20 insertions(+), 14 deletions(-) diff --git a/reactos/lib/crt/include/internal/debug.h b/reactos/lib/crt/include/internal/debug.h index f25e1613ad5..01f8b334e5c 100644 --- a/reactos/lib/crt/include/internal/debug.h +++ b/reactos/lib/crt/include/internal/debug.h @@ -30,8 +30,9 @@ unsigned long DbgPrint(char *Format,...); -#define TRACE(...) - +#ifdef __GNUC__ + #define TRACE(...) +#endif #ifdef DBG #ifdef __GNUC__ @@ -50,7 +51,9 @@ unsigned long DbgPrint(char *Format,...); #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__ diff --git a/reactos/lib/crt/precomp.h b/reactos/lib/crt/precomp.h index d74ebbdeabe..3aea4045452 100644 --- a/reactos/lib/crt/precomp.h +++ b/reactos/lib/crt/precomp.h @@ -1,3 +1,7 @@ #define CRT_SECURE_NO_DEPRECATE #include + +#if !defined(_MSC_VER) + #include +#endif diff --git a/reactos/lib/crt/process/_cwait.c b/reactos/lib/crt/process/_cwait.c index c1f93facc69..bf4a7447560 100644 --- a/reactos/lib/crt/process/_cwait.c +++ b/reactos/lib/crt/process/_cwait.c @@ -22,15 +22,15 @@ int _cwait(int* pnStatus, int hProc, int nAction) 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; } diff --git a/reactos/lib/crt/process/dll.c b/reactos/lib/crt/process/dll.c index 77c92265da5..71910108d1a 100644 --- a/reactos/lib/crt/process/dll.c +++ b/reactos/lib/crt/process/dll.c @@ -11,31 +11,30 @@ #include "precomp.h" #include - /* * @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); } -- 2.17.1