[FFmpeg-devel] [PATCH] mxfdec: make it work with other calling conventions
Reimar Döffinger
Reimar.Doeffinger
Thu Jul 1 01:50:28 CEST 2010
On Wed, Jun 30, 2010 at 04:20:50PM -0700, Baptiste Coudurier wrote:
> On 06/30/2010 04:06 PM, Reimar D?ffinger wrote:
> >On Wed, Jun 30, 2010 at 02:49:55PM -0700, Baptiste Coudurier wrote:
> >>>>But that's more an explanation of
> >>>>why there isn't any prototype for the read() function.
> >>>
> >>>I expected that is because pointers to functions with a different
> >>>number of arguments were stored there, but that is more of an argument
> >>>_for_ making it an error, since this allowed the fact that the
> >>>code would crash with stdcall and all other calle-restores-stack calling
> >>>conventions to go by unnoticed, without even a warning.
> >>
> >>All the functions are called with the same number of arguments.
> >
> >That's completely irrelevant, they are called with a different number
> >of arguments than the number of arguments they are declared with!
>
> In any case, the compiler has to fail in this case, because
> vararg/undefined prototype cannot work and stdcall requires a
> function prototype.
What? Whatever gave you that idea?
Microsoft all those years has never noticed that none of their sofware
can even compile?
http://www.cygwin.com/ml/cygwin/2003-06/msg00470/windef.h
[...]
#define WINAPI __stdcall
[...]
typedef int (WINAPI *FARPROC)();
Usage grabbed from a random sample code:
FARPROC fpDirectDrawCreate = GetProcAddress(hmodDDraw, "DirectDrawCreate");
retval = fpDirectDrawCreate(NULL, &lpdd, NULL);
More information about the ffmpeg-devel
mailing list