Fixes missing routines and defines for MINGW32 application builds.

Also fixes some type warnings.


svn path=/trunk/boinc/; revision=14655
This commit is contained in:
David Anderson 2008-01-31 18:34:51 +00:00
parent 7364f8710d
commit 41bd38148d
6 changed files with 23 additions and 18 deletions

View File

@ -236,6 +236,9 @@ extern "C" {
#endif
void __cdecl _fpreset (void);
void __cdecl fpreset (void);
#define SetClassLongPtr SetClassLong
#define GCLP_HICON GCL_HICON
#define GCLP_HICONSM GCL_HICONSM
#ifdef __cplusplus
}
#endif

View File

@ -35,6 +35,7 @@
#include "str_util.h"
#include "util.h"
#define BOINC_VERSION_STRING "5.10.0"
// NtQuerySystemInformation
typedef NTSTATUS (WINAPI *tNTQSI)(
@ -72,7 +73,7 @@ BOOL diagnostics_get_registry_value(LPCTSTR lpName, LPDWORD lpdwType, LPDWORD lp
lRetVal = RegOpenKeyEx(
HKEY_LOCAL_MACHINE,
_T("SOFTWARE\\Space Sciences Laboratory, U.C. Berkeley\\BOINC Diagnostics"),
NULL,
(DWORD)NULL,
KEY_READ,
&hKey
);
@ -81,7 +82,7 @@ BOOL diagnostics_get_registry_value(LPCTSTR lpName, LPDWORD lpdwType, LPDWORD lp
lRetVal = RegOpenKeyEx(
HKEY_CURRENT_USER,
_T("SOFTWARE\\Space Sciences Laboratory, U.C. Berkeley\\BOINC Diagnostics"),
NULL,
(DWORD)NULL,
KEY_READ,
&hKey
);
@ -336,10 +337,10 @@ int diagnostics_get_process_information(PVOID* ppBuffer, PULONG pcbBuffer) {
);
if (Status == STATUS_INFO_LENGTH_MISMATCH) {
HeapFree(hHeap, NULL, *ppBuffer);
HeapFree(hHeap, (DWORD)NULL, *ppBuffer);
*pcbBuffer *= 2;
} else if (!NT_SUCCESS(Status)) {
HeapFree(hHeap, NULL, *ppBuffer);
HeapFree(hHeap, (DWORD)NULL, *ppBuffer);
retval = Status;
}
} while (Status == STATUS_INFO_LENGTH_MISMATCH);
@ -433,7 +434,7 @@ int diagnostics_update_thread_list_NT() {
// Release resources
if (hThreadListSync) ReleaseMutex(hThreadListSync);
if (pBuffer) HeapFree(GetProcessHeap(), NULL, pBuffer);
if (pBuffer) HeapFree(GetProcessHeap(), (DWORD)NULL, pBuffer);
return 0;
}
@ -525,7 +526,7 @@ int diagnostics_update_thread_list_XP() {
// Release resources
if (hThreadListSync) ReleaseMutex(hThreadListSync);
if (pBuffer) HeapFree(GetProcessHeap(), NULL, pBuffer);
if (pBuffer) HeapFree(GetProcessHeap(), (DWORD)NULL, pBuffer);
return 0;
}
@ -1050,8 +1051,8 @@ int diagnostics_message_monitor_dump() {
// See: http://support.microsoft.com/kb/q173260/
//
UINT WINAPI diagnostics_message_monitor(LPVOID /* lpParameter */) {
DWORD dwEvent = NULL;
DWORD dwCurrentProcessId = NULL;
DWORD dwEvent = (DWORD)NULL;
DWORD dwCurrentProcessId = (DWORD)NULL;
BOOL bContinue = TRUE;
DWORD dwRepeatMessageCounter = 0;
DWORD dwRepeatMessageProcessId = 0;
@ -1216,7 +1217,7 @@ typedef struct _BOINC_WINDOWCAPTURE {
DWORD window_thread_id;
} BOINC_WINDOWCAPTURE, *PBOINC_WINDOWCAPTURE;
static UINT uiExceptionMonitorThreadId = NULL;
static UINT uiExceptionMonitorThreadId = (UINT)NULL;
static HANDLE hExceptionMonitorThread = NULL;
static HANDLE hExceptionMonitorHalt = NULL;
static HANDLE hExceptionMonitorStartedEvent = NULL;
@ -1707,7 +1708,7 @@ UINT diagnostics_determine_exit_code() {
UINT WINAPI diagnostics_unhandled_exception_monitor(LPVOID /* lpParameter */) {
DWORD dwEvent = NULL;
DWORD dwEvent = (DWORD)NULL;
BOOL bContinue = TRUE;
BOOL bDebuggerInitialized = FALSE;
HANDLE hEvents[2];

View File

@ -107,7 +107,7 @@ int make_random_string(char* out) {
if (!f) {
return -1;
}
int n = fread(buf, 32, 1, f);
size_t n = fread(buf, 32, 1, f);
fclose(f);
if (n != 1) return -1;
#endif

View File

@ -72,8 +72,8 @@ int MIOFILE::printf(const char* format, ...) {
} else if (f) {
retval = vfprintf(f, format, ap);
} else {
int cursize = strlen(wbuf);
int remaining_len = len - cursize;
size_t cursize = strlen(wbuf);
size_t remaining_len = len - cursize;
retval = vsnprintf(wbuf+cursize, remaining_len, format, ap);
}
va_end(ap);

View File

@ -1,3 +1,4 @@
#include "boinc_win.h"
#include "error_numbers.h"
#include "diagnostics_win.h"
#include "procinfo.h"

View File

@ -594,7 +594,7 @@ int DebuggerInitialize( LPCSTR pszBOINCLocation, LPCSTR pszSymbolStore, BOOL bPr
free( tt );
// Setting symbol options to the WinDbg defaults.
symOptions = NULL;
symOptions = (DWORD)NULL;
symOptions |= SYMOPT_CASE_INSENSITIVE;
symOptions |= SYMOPT_LOAD_LINES;
symOptions |= SYMOPT_OMAP_FIND_NEAREST;
@ -937,10 +937,10 @@ static void ShowStackRM(HANDLE hThread, CONTEXT& Context)
// Zero out params so we have fresh parameters through the next interation
StackFrame.Params[0] = NULL;
StackFrame.Params[1] = NULL;
StackFrame.Params[2] = NULL;
StackFrame.Params[3] = NULL;
StackFrame.Params[0] = (DWORD64)NULL;
StackFrame.Params[1] = (DWORD64)NULL;
StackFrame.Params[2] = (DWORD64)NULL;
StackFrame.Params[3] = (DWORD64)NULL;
// no return address means no deeper stackframe