[FFmpeg-devel] Eliminating long
Uoti Urpala
uoti.urpala
Mon Mar 31 00:56:15 CEST 2008
On Sun, 2008-03-30 at 23:40 +0100, Jay L. T. Cornwall wrote:
> Luca Barbato wrote:
>
> >> There is no reliable way to marshall this type into a managed structure
> >> on all platforms. Could I request that the type be made explicit in
> >> ByteIOContext, as 'unsigned int' or 'uint32_t'.
>
> > I'm not sure that's a good workaround... Cannot fix it on your wrapper side?
>
> Not reliably. The size of the ByteIOContext structure depends on the
> compiler that FFmpeg was built with. It's worse than a 32-bit/64-bit
Normally compilers follow an ABI, and the ABI will define the size of
'long'. If you really wouldn't know the ABI used then you couldn't do
much with a library (there would be much more significant problems than
'long').
> issue; unfortunately the C specification is lax enough to permit that
> for the long type. There's no way to detect how the structure was built
> from C#.
The C specification allows varying size for basically everything except
the intXX_t types, including 'int'.
If C# really makes it that hard to interface with C libraries I'd
consider using a better language.
More information about the ffmpeg-devel
mailing list