[vlmc-devel] Enable C++11

Hugo Beauzée-Luyssen git at videolan.org
Mon Feb 29 01:06:32 CET 2016


vlmc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Thu Feb 25 23:52:38 2016 +0100| [57f4ed4d025b47f0a145f8d7367afadc4d5c445d] | committer: Hugo Beauzée-Luyssen

Enable C++11

By checking a couple basic features.
Also fix warnings that this introduced

> https://code.videolan.org/videolan/vlmc/commit/57f4ed4d025b47f0a145f8d7367afadc4d5c445d
---

 src/Backend/VLC/LibVLCpp/VLCMedia.cpp | 12 ++++++------
 src/CMakeLists.txt                    |  4 ++++
 2 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/src/Backend/VLC/LibVLCpp/VLCMedia.cpp b/src/Backend/VLC/LibVLCpp/VLCMedia.cpp
index 658631f..8ba6770 100644
--- a/src/Backend/VLC/LibVLCpp/VLCMedia.cpp
+++ b/src/Backend/VLC/LibVLCpp/VLCMedia.cpp
@@ -57,7 +57,7 @@ void
 Media::setVideoLockCallback( void* callback )
 {
     char    param[64];
-    sprintf( param, ":sout-smem-video-prerender-callback=%"PRIdPTR, (intptr_t)callback );
+    sprintf( param, ":sout-smem-video-prerender-callback=%" PRIdPTR, (intptr_t)callback );
     addOption(param);
 }
 
@@ -65,7 +65,7 @@ void
 Media::setVideoUnlockCallback( void* callback )
 {
     char    param[64];
-    sprintf( param, ":sout-smem-video-postrender-callback=%"PRIdPTR, (intptr_t)callback );
+    sprintf( param, ":sout-smem-video-postrender-callback=%" PRIdPTR, (intptr_t)callback );
     addOption( param );
 }
 
@@ -73,7 +73,7 @@ void
 Media::setAudioLockCallback( void* callback )
 {
     char    param[64];
-    sprintf( param, ":sout-smem-audio-prerender-callback=%"PRIdPTR, (intptr_t)callback );
+    sprintf( param, ":sout-smem-audio-prerender-callback=%" PRIdPTR, (intptr_t)callback );
     addOption(param);
 }
 
@@ -81,7 +81,7 @@ void
 Media::setAudioUnlockCallback( void* callback )
 {
     char    param[64];
-    sprintf( param, ":sout-smem-audio-postrender-callback=%"PRIdPTR, (intptr_t)callback );
+    sprintf( param, ":sout-smem-audio-postrender-callback=%" PRIdPTR, (intptr_t)callback );
     addOption( param );
 }
 
@@ -90,7 +90,7 @@ Media::setVideoDataCtx( void* dataCtx )
 {
     char    param[64];
 
-    sprintf( param, ":sout-smem-video-data=%"PRIdPTR, (intptr_t)dataCtx );
+    sprintf( param, ":sout-smem-video-data=%" PRIdPTR, (intptr_t)dataCtx );
     addOption( param );
 }
 
@@ -99,7 +99,7 @@ Media::setAudioDataCtx( void* dataCtx )
 {
     char    param[64];
 
-    sprintf( param, ":sout-smem-audio-data=%"PRIdPTR, (intptr_t)dataCtx );
+    sprintf( param, ":sout-smem-audio-data=%" PRIdPTR, (intptr_t)dataCtx );
     addOption( param );
 }
 
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index a7380bd..d2a59e3 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -269,6 +269,10 @@ ADD_CUSTOM_COMMAND(
 
 ADD_DEFINITIONS( -W -Wall -Wextra )
 
+
+# Ensure we can use some C++11 features
+target_compile_features(vlmc PUBLIC cxx_nullptr cxx_range_for)
+
 IF(UNIX)
     IF (WITH_PROFILING)
         ADD_DEFINITIONS( -pg )



More information about the Vlmc-devel mailing list