From 1d65f94e18488eaa8648f2499fc9814e81783f80 Mon Sep 17 00:00:00 2001 From: Pekka Riikonen Date: Sun, 28 Oct 2007 15:21:00 +0000 Subject: [PATCH] 64-bit Windows fixes. Patch from Skywing. --- lib/silcutil/silcatomic.h | 6 +++--- lib/silcutil/win32/silcwin32schedule.c | 4 ++-- win32/libsilcclient/libsilcclient.def | 1 + 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/silcutil/silcatomic.h b/lib/silcutil/silcatomic.h index 5ec57335..de22f802 100644 --- a/lib/silcutil/silcatomic.h +++ b/lib/silcutil/silcatomic.h @@ -437,7 +437,7 @@ SILC_ATOMIC_SET_INT_F(bits) \ SILC_ATOMIC_SET_INT_F(bits) \ { \ /* Windows */ \ - InterlockedExchange((LONG)&atomic->value, (LONG)value); \ + InterlockedExchange((LONG *)&atomic->value, (LONG)value); \ } #elif defined(__GNUC__) && (defined(SILC_I486) || defined(SILC_X86_64)) @@ -895,7 +895,7 @@ SILC_ATOMIC_INC_F(bits) \ SILC_ATOMIC_INC_F(bits) \ { \ /* Windows */ \ - InterlockedIncrement((LONG)&atomic->value); \ + InterlockedIncrement((LONG *)&atomic->value); \ } #elif defined(__GNUC__) && (defined(SILC_I486) || defined(SILC_X86_64)) @@ -1001,7 +1001,7 @@ SILC_ATOMIC_DEC_F(bits) \ SILC_ATOMIC_DEC_F(bits) \ { \ /* Windows */ \ - InterlockedDecrement((LONG)&atomic->value); \ + InterlockedDecrement((LONG *)&atomic->value); \ } #elif defined(__GNUC__) && (defined(SILC_I486) || defined(SILC_X86_64)) diff --git a/lib/silcutil/win32/silcwin32schedule.c b/lib/silcutil/win32/silcwin32schedule.c index d336ff6d..0a050522 100644 --- a/lib/silcutil/win32/silcwin32schedule.c +++ b/lib/silcutil/win32/silcwin32schedule.c @@ -130,7 +130,7 @@ int silc_select(SilcSchedule schedule, void *context) static LRESULT CALLBACK silc_schedule_wnd_proc(HWND hwnd, UINT wMsg, WPARAM wParam, LPARAM lParam) { - SilcSchedule schedule = (SilcSchedule)GetWindowLong(hwnd, GWL_USERDATA); + SilcSchedule schedule = (SilcSchedule)GetWindowLongPtr(hwnd, GWL_USERDATA); SilcWin32Scheduler internal; SilcUInt32 fd; SilcTaskFd task; @@ -268,7 +268,7 @@ void *silc_schedule_internal_init(SilcSchedule schedule, void *app_context) } /* Set the scheduler as the window's context */ - SetWindowLong(internal->window, GWL_USERDATA, (void *)schedule); + SetWindowLongPtr(internal->window, GWL_USERDATA, (void *)schedule); SetWindowPos(internal->window, HWND_BOTTOM, 0, 0, 0, 0, SWP_FRAMECHANGED); internal->wakeup_sema = CreateSemaphore(NULL, 0, 100, NULL); diff --git a/win32/libsilcclient/libsilcclient.def b/win32/libsilcclient/libsilcclient.def index 5bb9e9bb..99a05c9d 100644 --- a/win32/libsilcclient/libsilcclient.def +++ b/win32/libsilcclient/libsilcclient.def @@ -72,3 +72,4 @@ EXPORTS silc_client_private_message_wait_uninit @ 71 ; silc_client_send_private_message @ 72 ; silc_client_set_away_message @ 73 ; + silc_client_stop @ 74 ; -- 2.24.0