]> git.sesse.net Git - ffmpeg/commitdiff
Include headers for optional libraries only when enabled.
authorDiego Pettenò <flameeyes@gmail.com>
Wed, 22 Oct 2008 10:36:34 +0000 (10:36 +0000)
committerDiego Pettenò <flameeyes@gmail.com>
Wed, 22 Oct 2008 10:36:34 +0000 (10:36 +0000)
Include the headers for libavfilter, libswscale and libpostproc when
they are enabled (and thus linked in).

Without this change, Sun Studio will fail to link FFmpeg since two
inline functions defined in avfilter.h will have undefined references
to non-inline libavfilter functions.

Originally committed as revision 15665 to svn://svn.ffmpeg.org/ffmpeg/trunk

cmdutils.c

index 5c6715dd136bb5b9fea18e7e0deaa2c5cae15b2c..f52f56e7e2b5c7e72ef11d5d2571aec0bf370ec2 100644 (file)
 #include <errno.h>
 #include <math.h>
 
+/* Include only the enabled headers since some compilers (namely, Sun
+   Studio) will not omit unused inline functions and create undefined
+   references to libraries that are not being built. */
+
 #include "config.h"
 #include "libavformat/avformat.h"
+#ifdef CONFIG_AVFILTER
 #include "libavfilter/avfilter.h"
+#endif
 #include "libavdevice/avdevice.h"
 #include "libswscale/swscale.h"
+#ifdef CONFIG_POSTPROC
 #include "libpostproc/postprocess.h"
+#endif
 #include "libavutil/avstring.h"
 #include "libavcodec/opt.h"
 #include "cmdutils.h"