diff options
author | Chih-Wei Huang <cwhuang@linux.org.tw> | 2013-11-04 00:06:07 +0800 |
---|---|---|
committer | Chih-Wei Huang <cwhuang@linux.org.tw> | 2014-04-23 16:14:08 +0800 |
commit | c94e03f4458fd1a79fb44e2a37779f2a9db5eacd (patch) | |
tree | 5d8c41d456bbac6346e7b450614bb127ca8376d6 | |
parent | b726ddcfb000ab19551d775512794f625c599495 (diff) | |
download | android_external_ffmpeg-c94e03f4458fd1a79fb44e2a37779f2a9db5eacd.tar.gz android_external_ffmpeg-c94e03f4458fd1a79fb44e2a37779f2a9db5eacd.tar.bz2 android_external_ffmpeg-c94e03f4458fd1a79fb44e2a37779f2a9db5eacd.zip |
libavutil: fix av_err2str compiling error for C++cm-11.0-XNPH44S-bacon-5fa8c79c0bcm-11.0-XNPH33R-bacon-3628510d76cm-11.0-XNPH30O-bacon-4f280f505acm-11.0-XNPH25R-bacon-d22b777afacm-11.0-XNPH22R-bacon-03d77315ea
The implementation may not be thread-safe. But good enough for us.
-rw-r--r-- | libavutil/error.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libavutil/error.h b/libavutil/error.h index f3fd7bbff6..a1f68e570b 100644 --- a/libavutil/error.h +++ b/libavutil/error.h @@ -87,6 +87,17 @@ */ int av_strerror(int errnum, char *errbuf, size_t errbuf_size); +#ifdef __cplusplus + +static inline const char *av_err2str(int errnum) +{ + static char errbuf[AV_ERROR_MAX_STRING_SIZE]; + av_strerror(errnum, errbuf, AV_ERROR_MAX_STRING_SIZE); + return errbuf; +} + +#else + /** * Fill the provided buffer with a string containing an error string * corresponding to the AVERROR code errnum. @@ -110,6 +121,7 @@ static inline char *av_make_error_string(char *errbuf, size_t errbuf_size, int e #define av_err2str(errnum) \ av_make_error_string((char[AV_ERROR_MAX_STRING_SIZE]){0}, AV_ERROR_MAX_STRING_SIZE, errnum) +#endif /* __cplusplus */ /** * @} */ |