[FFmpeg-devel] os_support.c r24072: change of include order

Axel Holzinger aholzinger
Fri Jul 23 21:45:57 CEST 2010


Hi Martin,

On Friday, July 23, 2010 9:19 PM Martin Storsj? wrote:

> On Fri, 23 Jul 2010, Axel Holzinger wrote:
> 
> > Hello M?ns et al,
> > 
> > os_support.c r24072 (os_support: include some headers only when
> > needed) changed the include order. In r22329 unistd.h, fcntl.h and

> > sys/time.h were included BEFORE inclusion of os_support.h, 
> in r24072 
> > they are included AFTER inclusion of os_suport.h (besides making 
> > inclusion conditional on CONFIG_NETWORK).
> > 
> > This breaks (at least my) build on Windows, because there is an 
> > ambiguity with the close function in winsock2.h (there is another 
> > close function in io.h).
> > 
> > On my build the issue is solved, if os_support.h is 
> included after the 
> > #include "network.h" line (potentially also directly before this 
> > line).
> > 
> > Would it be thinkable to again change os_support.c and include 
> > os_support.h again after the above mentioned headers (similar to 
> > r22329)?
> 
> This would be ok for me at least (didn't test it yet, though).
> 
> What windows build environment do you use, if nobody else has 
> run into the issue yet? And in which way does it manifest 
> itself (what compiler/linker errors do you get)?

as with the last {} to {0} patches I stumbled across this with my
experimental icl (Intel compiler for Windows) build, where I try to
map icc parameters to icl parameters. I'm not sure if this will ever
work reliably, but at least in principle it's working, as icl is C99.

The bigger problem is that icl relies on Microsoft's runtime and I
guess that the issue here comes from icl finding a close function in
the VC headers instead of the one in winsock2:

C:\Program Files (x86)\Microsoft Visual Studio
9.0\VC\INCLUDE\io.h(306): error #147: declaration is incompatible with
"int __stdcall close(SOCKET={UINT_PTR={unsigned int}})" (declared at
line 1565 of "C:\Program Files\Microsoft
SDKs\Windows\v6.0A\include\winsock2.h")
  _Check_return_opt_ _CRT_NONSTDC_DEPRECATE(_close) _CRTIMP int
__cdecl close(_In_ int _FileHandle);

With the inclusion of os_support.h on its original position this
doesn't happen. I will try to dig deeper here and understand what
makes the difference, anyhow it would be great to have the old order
back and not to have a separate patch to be applied here in my repo.

Cheers and have a nice weekend
Axel




More information about the ffmpeg-devel mailing list