[FFmpeg-devel] [PATCH] avutil/error: hidden macro av_err2str for C++

Timo Rothenpieler timo at rothenpieler.org
Thu May 17 13:00:24 EEST 2018


On 17.05.2018 06:46, Zhao Zhili wrote:
> ---
>  libavutil/error.h | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/libavutil/error.h b/libavutil/error.h
> index 71df4da..8a35fef 100644
> --- a/libavutil/error.h
> +++ b/libavutil/error.h
> @@ -116,8 +116,10 @@ static inline char *av_make_error_string(char *errbuf, size_t errbuf_size, int e
>   * Convenience macro, the return value should be used only directly in
>   * function arguments but never stand-alone.
>   */
> +#ifndef __cplusplus
>  #define av_err2str(errnum) \
>      av_make_error_string((char[AV_ERROR_MAX_STRING_SIZE]){0}, AV_ERROR_MAX_STRING_SIZE, errnum)
> +#endif

It's a macro, as long as you don't call it, it should never hit the
compiler.
So this will only change the error as now the macro won't be known anymore.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20180517/6a7625ea/attachment.sig>


More information about the ffmpeg-devel mailing list