Help: BCC32 + latest SDL CVS = compile error

Hi all,

I just downloaded the latest SDL source from the CVS repository using
TortoiseCVS. Next, I proceed to try and compile that using Borland’s free
compiler (using the makefiles in borland.zip).

Now the problem, using sdl.mak as the makefile, most of the sdl source
seems to compile fine except for SDL_dibevents.c

This is the error it’s giving me:

Borland C++ 5.5.1 for Win32 Copyright © 1993, 2000 Borland
…\src\video\windib\SDL_dibevents.c:
Error E2342 …\src\video\windib\SDL_dibevents.c 189: Type mismatch in
paramet
er ‘lpPrevWndFunc’ (wanted ‘int (__stdcall *)()’, got ‘long (__stdcall *)
(void *
,unsigned int,unsigned int,long)’) in function DIB_HandleMessage
*** 1 errors in Compile ***

The error seems pretty clear but I’m unsure of how this should be
corrected. Anyone have any ideas?

Thanks

Ok, I did some more fooling around in an attempt to fix this and this is
the silly hack I came up with.

In the SDL_dibevents.c at line 189:

		} else if (userWindowProc) {
            typedef int (__stdcall *DIFFPROC)(void);
			return CallWindowProc((DIFFPROC)userWindowProc, 

hwnd, msg, wParam, lParam);
}

And in SDL_dx5events.c line 545:

did the same changes. I don’t think it looks very nice but at least it
compiles now. Any comments and suggestions on a better way of fixing
this? I would really like to hear about it.

I also found that the SDL_HasMMX() function is unresolved because the
borland makefile didn’t include the SDL_cpuinfo.c for its compile. I’ve
added that to the list so now it links properly.

Thanks

Ok, I did some more fooling around in an attempt to fix this and this is
the silly hack I came up with.

In the SDL_dibevents.c at line 189:

  	} else if (userWindowProc) {
            typedef int (__stdcall *DIFFPROC)(void);
  		return CallWindowProc((DIFFPROC)userWindowProc, 

hwnd, msg, wParam, lParam);
}

And in SDL_dx5events.c line 545:

did the same changes. I don’t think it looks very nice but at least it
compiles now. Any comments and suggestions on a better way of fixing
this? I would really like to hear about it.

It sounds like there’s a problem with Borland’s CallWindowProc declaration.
According to the MSDN documentation the first parameter to CallWindowProc
is of type WNDPROC, which is defined as:
LRESULT (CALLBACK* WNDPROC) (HWND, UINT, WPARAM, LPARAM);

I also found that the SDL_HasMMX() function is unresolved because the
borland makefile didn’t include the SDL_cpuinfo.c for its compile. I’ve
added that to the list so now it links properly.

Thanks, can you send me updated Borland makefiles?

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment