[FFmpeg-devel] [PATCH 5/5] build: rename version.h to libavutil/ffversion.h

Michael Niedermayer michaelni at gmx.at
Sat Nov 30 21:23:35 CET 2013


On Sat, Nov 30, 2013 at 10:31:48AM -0800, Timothy Gu wrote:
> Updated.
> 
> Can someone review this?
> 
> Timothy

>  version.sh |   12 ++++++++++--
>  1 file changed, 10 insertions(+), 2 deletions(-)
> 4526aa35d1bb744288a11d3f4de99dc81b536b83  0002-version.sh-add-preprocessing-guards.patch
> From d82aec2015740f58919cb545eb4ac049fde4ddf1 Mon Sep 17 00:00:00 2001
> From: Timothy Gu <timothygu99 at gmail.com>
> Date: Fri, 29 Nov 2013 09:57:30 -0800
> Subject: [PATCH 2/3] version.sh: add preprocessing guards
> 
> Signed-off-by: Timothy Gu <timothygu99 at gmail.com>
> ---
>  version.sh | 12 ++++++++++--
>  1 file changed, 10 insertions(+), 2 deletions(-)
> 
> diff --git a/version.sh b/version.sh
> index c28ffe7..92edcb9 100755
> --- a/version.sh
> +++ b/version.sh
> @@ -42,9 +42,17 @@ if [ -z "$2" ]; then
>  fi
>  
>  NEW_REVISION="#define FFMPEG_VERSION \"$version\""
> -OLD_REVISION=$(cat "$2" 2> /dev/null)
> +OLD_REVISION=$(cat "$2" 2> /dev/null | head -3 | tail -1)
> +
> +# String used for preprocessor guard
> +GUARD=$(echo "$2" | sed 's/\//_/' | sed 's/\./_/' | tr '[:lower:]' '[:upper:]' | sed 's/LIB//')
>  
>  # Update version header only on revision changes to avoid spurious rebuilds
>  if test "$NEW_REVISION" != "$OLD_REVISION"; then
> -    echo "$NEW_REVISION" > "$2"
> +    cat << EOF > "$2"
> +#ifndef $GUARD
> +#define $GUARD
> +$NEW_REVISION
> +#endif /* $GUARD */
> +EOF
>  fi

"#ifndef VERSION_H"

missing prefix to avoid name clashes

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

During times of universal deceit, telling the truth becomes a
revolutionary act. -- George Orwell
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20131130/65669719/attachment.asc>


More information about the ffmpeg-devel mailing list