external/ffmpeg
Revisión | 157155f3874105eaba4a70496fe6d84d037a962d (tree) |
---|---|
Tiempo | 2014-02-04 14:57:06 |
Autor | Chih-Wei Huang <cwhuang@linu...> |
Commiter | Chih-Wei Huang |
libavutil: fix av_err2str compiling error for C++
The implementation may not be thread-safe. But good enough for us.
@@ -87,6 +87,17 @@ | ||
87 | 87 | */ |
88 | 88 | int av_strerror(int errnum, char *errbuf, size_t errbuf_size); |
89 | 89 | |
90 | +#ifdef __cplusplus | |
91 | + | |
92 | +static inline const char *av_err2str(int errnum) | |
93 | +{ | |
94 | + static char errbuf[AV_ERROR_MAX_STRING_SIZE]; | |
95 | + av_strerror(errnum, errbuf, AV_ERROR_MAX_STRING_SIZE); | |
96 | + return errbuf; | |
97 | +} | |
98 | + | |
99 | +#else | |
100 | + | |
90 | 101 | /** |
91 | 102 | * Fill the provided buffer with a string containing an error string |
92 | 103 | * 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 | ||
110 | 121 | #define av_err2str(errnum) \ |
111 | 122 | av_make_error_string((char[AV_ERROR_MAX_STRING_SIZE]){0}, AV_ERROR_MAX_STRING_SIZE, errnum) |
112 | 123 | |
124 | +#endif /* __cplusplus */ | |
113 | 125 | /** |
114 | 126 | * @} |
115 | 127 | */ |