mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 21:32:56 +00:00
fix some MSVC compile problems
svn path=/trunk/; revision=19245
This commit is contained in:
parent
a6227b1c67
commit
4aa521a7f6
4 changed files with 20 additions and 14 deletions
|
@ -30,8 +30,9 @@
|
||||||
|
|
||||||
unsigned long DbgPrint(char *Format,...);
|
unsigned long DbgPrint(char *Format,...);
|
||||||
|
|
||||||
#define TRACE(...)
|
#ifdef __GNUC__
|
||||||
|
#define TRACE(...)
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef DBG
|
#ifdef DBG
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
|
@ -50,7 +51,9 @@ unsigned long DbgPrint(char *Format,...);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(NDEBUG) && defined(DBG)
|
#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);
|
#define CHECKPOINT do { DbgPrint("MSVCRT:%s:%d\n",__FILE__,__LINE__); } while(0);
|
||||||
#else
|
#else
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
#define CRT_SECURE_NO_DEPRECATE
|
#define CRT_SECURE_NO_DEPRECATE
|
||||||
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
|
||||||
|
#if !defined(_MSC_VER)
|
||||||
|
#include <stdint.h>
|
||||||
|
#endif
|
||||||
|
|
|
@ -22,15 +22,15 @@ int _cwait(int* pnStatus, int hProc, int nAction)
|
||||||
DWORD ExitCode;
|
DWORD ExitCode;
|
||||||
|
|
||||||
nAction = 0;
|
nAction = 0;
|
||||||
if (WaitForSingleObject((void*)hProc, INFINITE) != WAIT_OBJECT_0) {
|
if (WaitForSingleObject((void*)ULongToPtr(hProc), INFINITE) != WAIT_OBJECT_0) {
|
||||||
__set_errno(ECHILD);
|
__set_errno(ECHILD);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!GetExitCodeProcess((void*)hProc, &ExitCode))
|
if (!GetExitCodeProcess((void*)ULongToPtr(hProc), &ExitCode))
|
||||||
return -1;
|
return -1;
|
||||||
if (pnStatus != NULL)
|
if (pnStatus != NULL)
|
||||||
*pnStatus = (int)ExitCode;
|
*pnStatus = (int)ExitCode;
|
||||||
CloseHandle((HANDLE)hProc);
|
CloseHandle((HANDLE)ULongToPtr(hProc));
|
||||||
return hProc;
|
return hProc;
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,31 +11,30 @@
|
||||||
#include "precomp.h"
|
#include "precomp.h"
|
||||||
#include <process.h>
|
#include <process.h>
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
void* _loaddll(char* name)
|
intptr_t _loaddll(char* name)
|
||||||
{
|
{
|
||||||
return LoadLibraryA(name);
|
return (intptr_t) LoadLibraryA(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
int _unloaddll(void* handle)
|
int _unloaddll(intptr_t handle)
|
||||||
{
|
{
|
||||||
return FreeLibrary(handle);
|
return FreeLibrary((HMODULE) handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
FARPROC _getdllprocaddr(void* hModule, char* lpProcName, int iOrdinal)
|
FARPROC _getdllprocaddr(intptr_t hModule, char* lpProcName, intptr_t iOrdinal)
|
||||||
{
|
{
|
||||||
if (lpProcName != NULL)
|
if (lpProcName != NULL)
|
||||||
return GetProcAddress(hModule, lpProcName);
|
return GetProcAddress((HMODULE) hModule, lpProcName);
|
||||||
else
|
else
|
||||||
return GetProcAddress(hModule, (LPSTR)iOrdinal);
|
return GetProcAddress((HMODULE) hModule, (LPSTR)iOrdinal);
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue