[FFmpeg-devel] [PATCH] configure: add #include "version.h" to config.h

Timothy Gu timothygu99 at gmail.com
Wed Nov 27 22:19:49 CET 2013


On Wednesday, November 27, 2013, Michael Niedermayer wrote:

> On Wed, Nov 27, 2013 at 03:58:27PM -0300, James Almer wrote:
> > On 27/11/13 6:06 AM, Stefano Sabatini wrote:
> > > On date Tuesday 2013-11-26 14:43:18 -0800, Timothy Gu encoded:
> > >> Avoid clash with version.h of the libraries.
> > >>
> > >> Signed-off-by: Timothy Gu <timothygu99 at gmail.com <javascript:;>>
> > >> ---
> > >>  cmdutils.c | 1 -
> > >>  configure  | 1 +
> > >>  ffprobe.c  | 1 -
> > >>  3 files changed, 1 insertion(+), 2 deletions(-)
> > >>
> > >> diff --git a/cmdutils.c b/cmdutils.c
> > >> index 2608bce..95accb0 100644
> > >> --- a/cmdutils.c
> > >> +++ b/cmdutils.c
> > >> @@ -50,7 +50,6 @@
> > >>  #include "libavutil/opt.h"
> > >>  #include "libavutil/cpu.h"
> > >>  #include "cmdutils.h"
> > >> -#include "version.h"
> > >>  #if CONFIG_NETWORK
> > >>  #include "libavformat/network.h"
> > >>  #endif
> > >> diff --git a/configure b/configure
> > >> index aaf5c8f..317b112 100755
> > >> --- a/configure
> > >> +++ b/configure
> > >> @@ -4919,6 +4919,7 @@ cat > $TMPH <<EOF
> > >>  #define FFMPEG_CONFIG_H
> > >>  #define FFMPEG_CONFIGURATION "$(c_escape $FFMPEG_CONFIGURATION)"
> > >>  #define FFMPEG_LICENSE "$(c_escape $license)"
> > >> +#include "version.h"
> > >>  #define CONFIG_THIS_YEAR 2013
> > >>  #define FFMPEG_DATADIR "$(eval c_escape $datadir)"
> > >>  #define AVCONV_DATADIR "$(eval c_escape $datadir)"
> > >> diff --git a/ffprobe.c b/ffprobe.c
> > >> index d124d4e..c68cb16 100644
> > >> --- a/ffprobe.c
> > >> +++ b/ffprobe.c
> > >> @@ -24,7 +24,6 @@
> > >>   */
> > >>
> > >>  #include "config.h"
> > >> -#include "version.h"
> > >>
> > >>  #include <string.h>
> > >
> > > Not sure, what problem is this addressing?
> >
> > This is to avoid a clash between version.h and the version.h of a
> > library when a library source file includes both and is compiled on an
> > out-of-tree build.
> >
> > Things like
> > #include "version.h"
> > #include "libavformat/version.h"
> > In a libavformat source file will end up trying to include libavformat's
> > version.h twice.
> >
> > There may be some other solution, but this is probably the easiest,
> > and the Windows resource patch needs this.
> >
> > For that matter, it might be a good idea to add pre-processor guards to
> > version.h since it's the only header that lacks them, but that's
> > unrelated.
>
> i think the new version.h should be renamed
>
> You mean the generated version.h? I thought of that too (see the resource
file thread), but I'd rather not have such a nontrivial change.

(Unrelated: _why_ do we even have the version.h generate at make time? Why
not just put the versioning header in configure and output it to config.h?)

Timothy


More information about the ffmpeg-devel mailing list