windows: Use WINAPI call convention for Windows API callbacks

For x86_64 it does not actually matter, but for i686 builds the call convention
is different with WINAPI.
This commit is contained in:
Martin Willi
2014-06-06 16:28:28 +02:00
parent bd19e27ae3
commit cab59c73fc
8 changed files with 28 additions and 23 deletions
+2 -2
View File
@@ -138,7 +138,7 @@ static DWORD main_thread;
/**
* APC routine invoked by main thread on worker failure
*/
static void set_worker_failure(ULONG_PTR dwParam)
static void WINAPI set_worker_failure(ULONG_PTR dwParam)
{
worker_failed = TRUE;
}
@@ -180,7 +180,7 @@ void test_fail_if_worker_failed()
/**
* Vectored exception handler
*/
static long eh_handler(PEXCEPTION_POINTERS ei)
static long WINAPI eh_handler(PEXCEPTION_POINTERS ei)
{
char *ename;
bool old = FALSE;
+4 -2
View File
@@ -378,8 +378,10 @@ void thread_set_active_condvar(CONDITION_VARIABLE *condvar)
/**
* APC to cancel a thread
*/
static void docancel(private_thread_t *this)
static void WINAPI docancel(ULONG_PTR dwParam)
{
private_thread_t *this = (private_thread_t*)dwParam;
/* make sure cancel() does not access this anymore */
threads_lock->lock(threads_lock);
threads_lock->unlock(threads_lock);
@@ -398,7 +400,7 @@ METHOD(thread_t, cancel, void,
if (!this->cancel_pending)
{
this->cancel_pending = TRUE;
QueueUserAPC((void*)docancel, this->handle, (uintptr_t)this);
QueueUserAPC(docancel, this->handle, (uintptr_t)this);
if (this->condvar)
{
WakeAllConditionVariable(this->condvar);
+1 -1
View File
@@ -247,7 +247,7 @@ static mutex_t *sigint_mutex;
/**
* Control handler to catch ^C
*/
static BOOL handler(DWORD dwCtrlType)
static BOOL WINAPI handler(DWORD dwCtrlType)
{
switch (dwCtrlType)
{
+2 -2
View File
@@ -116,14 +116,14 @@ char* strndup(const char *s, size_t n);
* Provided via ws2_32
*/
#ifndef InetNtop
const char *inet_ntop(int af, const void *src, char *dst, socklen_t size);
const char WINAPI *inet_ntop(int af, const void *src, char *dst, socklen_t size);
#endif
/**
* Provided via ws2_32
*/
#ifndef InetPton
int inet_pton(int af, const char *src, void *dst);
int WINAPI inet_pton(int af, const char *src, void *dst);
#endif
/**