fix some MSVC compile problems
authorChristoph von Wittich <christoph_vw@reactos.org>
Tue, 15 Nov 2005 14:26:06 +0000 (14:26 +0000)
committerChristoph von Wittich <christoph_vw@reactos.org>
Tue, 15 Nov 2005 14:26:06 +0000 (14:26 +0000)
svn path=/trunk/; revision=19245

reactos/lib/crt/include/internal/debug.h
reactos/lib/crt/precomp.h
reactos/lib/crt/process/_cwait.c
reactos/lib/crt/process/dll.c

index f25e161..01f8b33 100644 (file)
@@ -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__
index d74ebbd..3aea404 100644 (file)
@@ -1,3 +1,7 @@
 #define CRT_SECURE_NO_DEPRECATE
 
 #include <windows.h>
+
+#if !defined(_MSC_VER)
+  #include <stdint.h>
+#endif
index c1f93fa..bf4a744 100644 (file)
@@ -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;
 }
index 77c9226..7191010 100644 (file)
 #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);
 }