Mercurial > sdl-ios-xcode
comparison src/video/windib/SDL_dibevents.c @ 1303:52b5afd7ecee
Date: Tue, 05 Jul 2005 21:43:26 +1000
From: Sean Childs
Subject: [SDL] Compiling SDL 1.2.8 with the free Borland compiler
When compiling SDL 1.2.8 with the free Borland compiler, I received this
error (there is a similar error that occurs in
src\video\windx5\sdl_dx5events.c):
Error E2342 ..\..\src\video\windib\sdl_dibevents.c 189: Type mismatch in
parameter 'lpPrevWndFunc' (wanted 'int (__stdcall *)()', got 'long
(__stdcall *)(void *,unsigned int,unsigned int,long)') in function
DIB_HandleMessage
I checked the MSDN library at:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/
windowsuserinterface/windowing/windowprocedures/windowprocedurereference/wind
owprocedurefunctions/callwindowproc.asp
and it had this to say:
If STRICT is not defined, the lpPrevWndFunc parameter has the data type
FARPROC. The FARPROC type is declared as follows:
int (FAR WINAPI * FARPROC) ()
In C, the FARPROC declaration indicates a callback function that has an
unspecified parameter list. In C++, however, the empty parameter list in
the declaration indicates that a function has no parameters. This subtle
distinction can break careless code. Following is one way to handle this
situation:
#ifdef STRICT
WNDPROC MyWindowProcedure
#else
FARPROC MyWindowProcedure
#endif
...
lResult = CallWindowProc(MyWindowProcedure, ...)
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Tue, 31 Jan 2006 15:30:42 +0000 |
parents | ea3888b472bf |
children | c9b51268668f |
comparison
equal
deleted
inserted
replaced
1302:94643e9bad18 | 1303:52b5afd7ecee |
---|---|
54 #define REPEATED_KEYMASK (1<<30) | 54 #define REPEATED_KEYMASK (1<<30) |
55 #define EXTENDED_KEYMASK (1<<24) | 55 #define EXTENDED_KEYMASK (1<<24) |
56 | 56 |
57 /* DJM: If the user setup the window for us, we want to save his window proc, | 57 /* DJM: If the user setup the window for us, we want to save his window proc, |
58 and give him a chance to handle some messages. */ | 58 and give him a chance to handle some messages. */ |
59 static WNDPROC userWindowProc = NULL; | 59 #ifdef STRICT |
60 #define WNDPROCTYPE WNDPROC | |
61 #else | |
62 #define WNDPROCTYPE FARPROC | |
63 #endif | |
64 static WNDPROCTYPE userWindowProc = NULL; | |
60 | 65 |
61 | 66 |
62 #ifdef _WIN32_WCE | 67 #ifdef _WIN32_WCE |
63 | 68 |
64 WPARAM rotateKey(WPARAM key,SDL_ScreenOrientation direction) | 69 WPARAM rotateKey(WPARAM key,SDL_ScreenOrientation direction) |
425 } | 430 } |
426 | 431 |
427 /* DJM: we want all event's for the user specified | 432 /* DJM: we want all event's for the user specified |
428 window to be handled by SDL. | 433 window to be handled by SDL. |
429 */ | 434 */ |
430 userWindowProc = (WNDPROC)GetWindowLong(SDL_Window, GWL_WNDPROC); | 435 userWindowProc = (WNDPROCTYPE)GetWindowLong(SDL_Window, GWL_WNDPROC); |
431 SetWindowLong(SDL_Window, GWL_WNDPROC, (LONG)WinMessage); | 436 SetWindowLong(SDL_Window, GWL_WNDPROC, (LONG)WinMessage); |
432 } else { | 437 } else { |
433 SDL_Window = CreateWindow(SDL_Appname, SDL_Appname, | 438 SDL_Window = CreateWindow(SDL_Appname, SDL_Appname, |
434 (WS_OVERLAPPED|WS_CAPTION|WS_SYSMENU|WS_MINIMIZEBOX), | 439 (WS_OVERLAPPED|WS_CAPTION|WS_SYSMENU|WS_MINIMIZEBOX), |
435 CW_USEDEFAULT, CW_USEDEFAULT, 0, 0, NULL, NULL, SDL_Instance, NULL); | 440 CW_USEDEFAULT, CW_USEDEFAULT, 0, 0, NULL, NULL, SDL_Instance, NULL); |