Win64 compilation fixes.
authorPekka Riikonen <priikone@silcnet.org>
Tue, 6 Nov 2007 10:14:57 +0000 (10:14 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Tue, 6 Nov 2007 10:14:57 +0000 (10:14 +0000)
lib/silcutil/silcatomic.h
lib/silcutil/win32/silcwin32schedule.c

index 27e055b70d09d0e48366582b1b2d417580b07928..77197fa0b37eb879b53ea39060d34af9548be5c1 100644 (file)
@@ -447,7 +447,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))
@@ -905,7 +905,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))
@@ -1011,7 +1011,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))
index d336ff6d9189b2dd715d84f8b3f000b331b3da5d..0a0505228121172d4ecffd86fe58c0b7d5b91cfd 100644 (file)
@@ -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);