Hi,

On Tue, Jan 3, 2012 at 5:54 AM, Diego Biurrun <[email protected]> wrote:
> This fixes compilation failures related to START_TIMER/STOP_TIMER macros and
> -Werror=declaration-after-statement.  START_TIMER declares variables and thus
> may not be placed after statements outside of a new block.
> ---
>  libavutil/timer.h |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/libavutil/timer.h b/libavutil/timer.h
> index 6333cc6..f365e49 100644
> --- a/libavutil/timer.h
> +++ b/libavutil/timer.h
> @@ -46,6 +46,7 @@
>
>  #ifdef AV_READ_TIME
>  #define START_TIMER \
> +    {               \
>  uint64_t tend;\
>  uint64_t tstart= AV_READ_TIME();\
>
> @@ -64,6 +65,7 @@ tend= AV_READ_TIME();\
>         av_log(NULL, AV_LOG_ERROR, "%"PRIu64" decicycles in %s, %d runs, %d 
> skips\n",\
>                tsum*10/tcount, id, tcount, tskip_count);\
>     }\
> +} \
>  }
>  #else
>  #define START_TIMER

I preferred the other idea, which is to add an INIT_TIMER macro, like:

#define INIT_TIMER \
uint64_t start_time, end_time

#define START_TIMER \
start_time = AV_READ_TIME()

and STOP_TIME stays as it is.

Ronald
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to