[FFmpeg-cvslog] r16593 - trunk/cmdutils.c
Ramiro Polla
ramiro
Sun Jan 18 15:53:10 CET 2009
Ramiro Polla wrote:
> diego wrote:
>> Author: diego
>> Date: Wed Jan 14 01:45:04 2009
>> New Revision: 16593
>>
>> Log:
>> Remove pointless #if around header #includes.
>>
>> Modified:
>> trunk/cmdutils.c
>>
>> Modified: trunk/cmdutils.c
>> ==============================================================================
>> --- trunk/cmdutils.c Wed Jan 14 01:44:42 2009 (r16592)
>> +++ trunk/cmdutils.c Wed Jan 14 01:45:04 2009 (r16593)
>> @@ -30,21 +30,15 @@
>>
>> #include "config.h"
>> #include "libavformat/avformat.h"
>> -#if CONFIG_AVFILTER
>> #include "libavfilter/avfilter.h"
>> -#endif
>> #include "libavdevice/avdevice.h"
>> #include "libswscale/swscale.h"
>> -#if CONFIG_POSTPROC
>> #include "libpostproc/postprocess.h"
>> -#endif
>> #include "libavutil/avstring.h"
>> #include "libavcodec/opt.h"
>> #include "cmdutils.h"
>> #include "version.h"
>
>> -#if CONFIG_NETWORK
>> #include "libavformat/network.h"
>> -#endif
>>
>> #undef exit
>
> gcc -DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -I.
> -I"/home/ramiro/code/ffmpeg/src" -D_ISOC99_SOURCE
> -D_POSIX_C_SOURCE=200112 -std=c99 -fomit-frame-pointer -g
> -Wdeclaration-after-statement -Wall -Wno-switch -Wdisabled-optimization
> -Wpointer-arith -Wredundant-decls -Wno-pointer-sign -Wcast-qual
> -Wwrite-strings -Wundef -O3 -fno-math-errno -c -o cmdutils.o
> /home/ramiro/code/ffmpeg/src/cmdutils.c
> In file included from C:/msys/home/ramiro/code/ffmpeg/src/cmdutils.c:41:
> C:/msys/home/ramiro/code/ffmpeg/src/libavformat/network.h:33:24: error:
> sys/socket.h: No such file or directory
> C:/msys/home/ramiro/code/ffmpeg/src/libavformat/network.h:34:24: error:
> netinet/in.h: No such file or directory
> C:/msys/home/ramiro/code/ffmpeg/src/libavformat/network.h:35:19: error:
> netdb.h: No such file or directory
> make: *** [cmdutils.o] Error 1
>
> This happens for targets where --disable-network was specified and they
> don't have the necessary includes in the else part of this if in
> libavformat/network.h:
>
> #if HAVE_WINSOCK2_H
> #include <winsock2.h>
> #include <ws2tcpip.h>
>
> #define ff_neterrno() WSAGetLastError()
> #define FF_NETERROR(err) WSA##err
> #define WSAEAGAIN WSAEWOULDBLOCK
> #else
> #include <sys/types.h>
> #include <sys/socket.h>
> #include <netinet/in.h>
> #include <netdb.h>
>
> #define ff_neterrno() errno
> #define FF_NETERROR(err) err
> #endif
>
> What's the best way to fix this?
>
> 1: in cmdutils.c
> +#if CONFIG_NETWORK
> #include "libavformat/network.h"
> +#endif
>
> 2: in libavformat/network.h
> #define WSAEAGAIN WSAEWOULDBLOCK
> -#else
> +#elif CONFIG_NETWORK
> #include <sys/types.h>
>
> 3: enclose all of libavformat/network.h in #if CONFIG_NETWORK
I'll revert to 1. in a couple of days if there are no objections.
Ramiro Polla
More information about the ffmpeg-cvslog
mailing list