[FFmpeg-devel] [PATCH] lavu/timestamp: Avoid C++-unfriendly code in installed header

Mark Thompson sw at jkqxz.net
Wed Aug 31 23:01:57 EEST 2016


Including this header in a C++11 program (inside extern "C") will
throw an error because it looks like a user-defined literal.  Add a
space between the two tokens to avoid the problem.
---
Noted by mcjack in #ffmpeg.

I think this is the only instance of the problem in all of the installed headers - it doesn't matter anywhere else because ffmpeg itself is built with a C compiler.

 libavutil/timestamp.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavutil/timestamp.h b/libavutil/timestamp.h
index f010a7e..e082f01 100644
--- a/libavutil/timestamp.h
+++ b/libavutil/timestamp.h
@@ -43,7 +43,7 @@
 static inline char *av_ts_make_string(char *buf, int64_t ts)
 {
     if (ts == AV_NOPTS_VALUE) snprintf(buf, AV_TS_MAX_STRING_SIZE, "NOPTS");
-    else                      snprintf(buf, AV_TS_MAX_STRING_SIZE, "%"PRId64, ts);
+    else                      snprintf(buf, AV_TS_MAX_STRING_SIZE, "%" PRId64, ts);
     return buf;
 }

-- 
2.9.3



More information about the ffmpeg-devel mailing list