aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChih-Wei Huang <cwhuang@linux.org.tw>2013-11-04 00:06:07 +0800
committerChih-Wei Huang <cwhuang@linux.org.tw>2014-04-23 16:14:08 +0800
commitc94e03f4458fd1a79fb44e2a37779f2a9db5eacd (patch)
tree5d8c41d456bbac6346e7b450614bb127ca8376d6
parentb726ddcfb000ab19551d775512794f625c599495 (diff)
downloadandroid_external_ffmpeg-cm-11.0-XNPH22R-bacon-03d77315ea.tar.gz
android_external_ffmpeg-cm-11.0-XNPH22R-bacon-03d77315ea.tar.bz2
android_external_ffmpeg-cm-11.0-XNPH22R-bacon-03d77315ea.zip
The implementation may not be thread-safe. But good enough for us.
-rw-r--r--libavutil/error.h12
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 */
/**
* @}
*/