View | Details | Raw Unified | Return to bug 217051
Collapse All | Expand All

(-)Makefile (-1 / +7 lines)
Lines 3-9 Link Here
3
3
4
PORTNAME=	vlc
4
PORTNAME=	vlc
5
DISTVERSION=	2.2.4
5
DISTVERSION=	2.2.4
6
PORTREVISION=	7
6
PORTREVISION=	8
7
PORTEPOCH=	4
7
PORTEPOCH=	4
8
CATEGORIES=	multimedia audio ipv6 net www
8
CATEGORIES=	multimedia audio ipv6 net www
9
MASTER_SITES=	http://download.videolan.org/pub/videolan/${PORTNAME}/${DISTVERSION:S/a$//}/ \
9
MASTER_SITES=	http://download.videolan.org/pub/videolan/${PORTNAME}/${DISTVERSION:S/a$//}/ \
Lines 24-29 Link Here
24
		yasm:devel/yasm
24
		yasm:devel/yasm
25
RUN_DEPENDS=	ffmpeg>=2.0:multimedia/ffmpeg
25
RUN_DEPENDS=	ffmpeg>=2.0:multimedia/ffmpeg
26
26
27
# VLC git (post 2.2.4) requires C++11 support and passes the appropriate flag
28
# to the compiler. Until the port is updated, we explicitly pass -std=c++11 to
29
# the compiler because Qt 5.7+ requires C++11 support, and FreeBSD 10.3's clang
30
# does not default to C++11 mode.
31
USE_CXXSTD=	c++11
32
27
USES=		compiler:c11 desktop-file-utils gmake iconv libtool pathfix \
33
USES=		compiler:c11 desktop-file-utils gmake iconv libtool pathfix \
28
		pkgconfig tar:xz
34
		pkgconfig tar:xz
29
USE_GNOME=	libxml2
35
USE_GNOME=	libxml2
(-)files/patch-git_92ec47e (+43 lines)
Line 0 Link Here
1
Partial import of upstream git-commit to fix build in c++11 mode
2
3
From 92ec47e15b62ef12e15e6ce5550abe2620bc3167 Mon Sep 17 00:00:00 2001
4
From: =?UTF-8?q?Hugo=20Beauz=C3=A9e-Luyssen?= <hugo@beauzee.fr>
5
Date: Wed, 2 Jul 2014 14:17:19 +0000
6
Subject: [PATCH] Fix build when using C++11
7
8
--- modules/access/live555.cpp.orig	2015-10-21 17:48:45 UTC
9
+++ modules/access/live555.cpp
10
@@ -307,7 +307,7 @@ static int  Open ( vlc_object_t *p_this
11
     p_demux->p_sys     = p_sys = (demux_sys_t*)calloc( 1, sizeof( demux_sys_t ) );
12
     if( !p_sys ) return VLC_ENOMEM;
13
14
-    msg_Dbg( p_demux, "version "LIVEMEDIA_LIBRARY_VERSION_STRING );
15
+    msg_Dbg( p_demux, "version " LIVEMEDIA_LIBRARY_VERSION_STRING );
16
17
     TAB_INIT( p_sys->i_track, p_sys->track );
18
     p_sys->f_npt = 0.;
19
@@ -593,7 +593,7 @@ createnew:
20
21
     p_sys->rtsp = new RTSPClientVlc( *p_sys->env, psz_url,
22
                                      var_InheritInteger( p_demux, "verbose" ) > 1 ? 1 : 0,
23
-                                     "LibVLC/"VERSION, i_http_port, p_sys );
24
+                                     "LibVLC/" VERSION, i_http_port, p_sys );
25
     if( !p_sys->rtsp )
26
     {
27
         msg_Err( p_demux, "RTSPClient::createNew failed (%s)",
28
 modules/access/live555.cpp                   |  4 ++--
29
 modules/demux/mp4/libmp4.h                   |  2 +-
30
 modules/demux/vobsub.h                       |  8 +++----
31
 10 files changed, 40 insertions(+), 40 deletions(-)
32
33
--- modules/demux/mp4/libmp4.h.orig	2015-02-02 19:42:29 UTC
34
+++ modules/demux/mp4/libmp4.h
35
@@ -1360,7 +1360,7 @@ static inline size_t mp4_box_headersize(
36
     if( i_actually_read < 0 || (int64_t)i_actually_read < i_read )\
37
     { \
38
         msg_Warn( p_stream, "MP4_READBOX_ENTER: I got %i bytes, "\
39
-        "but I requested %"PRId64"", i_actually_read, i_read );\
40
+        "but I requested %" PRId64, i_actually_read, i_read );\
41
         free( p_buff ); \
42
         return( 0 ); \
43
     } \
(-)files/patch-git_d2571e6 (+51 lines)
Line 0 Link Here
1
commit d2571e643edb0f1cb217805ef8d5ac172d59a864
2
Author: RĂ©mi Denis-Courmont <remi@remlab.net>
3
Date:   Fri Jun 26 00:06:44 2015 +0300
4
5
    qt: use QAtomicInt
6
7
diff --git a/modules/gui/qt4/dialogs/messages.cpp b/modules/gui/qt4/dialogs/messages.cpp
8
index 21c11107c7..d23007f036 100644
9
--- modules/gui/qt4/dialogs/messages.cpp
10
+++ modules/gui/qt4/dialogs/messages.cpp
11
@@ -146,7 +146,7 @@ MessagesDialog::~MessagesDialog()
12
 
13
 void MessagesDialog::changeVerbosity( int i_verbosity )
14
 {
15
-    atomic_store( &this->verbosity, i_verbosity );
16
+    verbosity = i_verbosity;
17
 }
18
 
19
 void MessagesDialog::updateConfig()
20
@@ -340,7 +340,7 @@ void MessagesDialog::MsgCallback( void *self, int type, const vlc_log_t *item,
21
 {
22
     MessagesDialog *dialog = (MessagesDialog *)self;
23
     char *str;
24
-    int verbosity = atomic_load( &dialog->verbosity );
25
+    int verbosity = dialog->verbosity;
26
 
27
     if( verbosity < 0 || verbosity < (type - VLC_MSG_ERR)
28
      || unlikely(vasprintf( &str, format, ap ) == -1) )
29
diff --git a/modules/gui/qt4/dialogs/messages.hpp b/modules/gui/qt4/dialogs/messages.hpp
30
index a8d5804be2..0491a8f158 100644
31
--- modules/gui/qt4/dialogs/messages.hpp
32
+++ modules/gui/qt4/dialogs/messages.hpp
33
@@ -28,8 +28,8 @@
34
 #include "util/singleton.hpp"
35
 #include "ui/messages_panel.h"
36
 #include <stdarg.h>
37
-#include <vlc_atomic.h>
38
 #include <QMutex>
39
+#include <QAtomicInt>
40
 
41
 class QPushButton;
42
 class QTreeWidget;
43
@@ -49,7 +49,7 @@ private:
44
     void sinkMessage( const MsgEvent * );
45
     bool matchFilter( const QString& );
46
 
47
-    atomic_uint verbosity;
48
+    QAtomicInt verbosity;
49
     static void MsgCallback( void *, int, const vlc_log_t *, const char *,
50
                              va_list );
51
 
(-)files/patch-include_vlc__atomic.h (-10 / +96 lines)
Lines 1-17 Link Here
1
Move vlc_atomic.h closer to the git version (post-2.2.4), especially revision
2
ab550d60dd8d8 ("include: stick to a single version (2011) C/C++ atomics") by
3
assuming C++ builds are being done in C++11 mode or later and include <atomic>.
4
For C usages, use <stdatomic.h> in C11 mode and define some shims otherwise.
5
6
The original 2.2.4 version does not have C++11 support and breaks with Qt5, as
7
Qt 5.7+ requires C++11 support.
1
--- include/vlc_atomic.h.orig	2014-08-14 07:20:03 UTC
8
--- include/vlc_atomic.h.orig	2014-08-14 07:20:03 UTC
2
+++ include/vlc_atomic.h
9
+++ include/vlc_atomic.h
3
@@ -32,6 +32,14 @@
10
@@ -26,13 +26,13 @@
11
  * Atomic operations do not require locking, but they are not very powerful.
12
  */
13
 
14
-# if !defined (__cplusplus) && (__STDC_VERSION__ >= 201112L) \
15
-  && !defined (__STDC_NO_ATOMICS__)
16
+# ifndef __cplusplus
17
+#  if (__STDC_VERSION__ >= 201112L) && !defined (__STDC_NO_ATOMICS__)
18
 
4
 /*** Native C11 atomics ***/
19
 /*** Native C11 atomics ***/
5
 #  include <stdatomic.h>
20
 #  include <stdatomic.h>
6
 
21
 
7
+# elif defined (__cplusplus) && defined(_LIBCPP_VERSION) && _LIBCPP_VERSION >= 3800
22
-# else
8
+
23
+#  else
24
 
25
 #  define ATOMIC_FLAG_INIT false
26
 
27
@@ -57,7 +57,7 @@
28
  * unsigned equivalents, i.e. 4-bytes and 8-bytes types, although GCC also
29
  * supports 1 and 2-bytes types. Some non-x86 architectures do not support
30
  * 8-byte atomic types (or not efficiently). */
31
-#  if defined (_MSC_VER)
32
+#   if defined (_MSC_VER)
33
 /* Some atomic operations of the Interlocked API are only
34
    available for desktop apps. Thus we define the atomic types to
35
    be at least 32 bits wide. */
36
@@ -68,7 +68,7 @@
37
 typedef     uint_least32_t atomic_uchar;
38
 typedef      int_least32_t atomic_short;
39
 typedef     uint_least32_t atomic_ushort;
40
-#  else
41
+#   else
42
 typedef          bool      atomic_flag;
43
 typedef          bool      atomic_bool;
44
 typedef          char      atomic_char;
45
@@ -76,7 +76,7 @@
46
 typedef unsigned char      atomic_uchar;
47
 typedef          short     atomic_short;
48
 typedef unsigned short     atomic_ushort;
49
-#  endif
50
+#   endif
51
 typedef          int       atomic_int;
52
 typedef unsigned int       atomic_uint;
53
 typedef          long      atomic_long;
54
@@ -109,7 +109,7 @@
55
 typedef          intmax_t atomic_intmax_t;
56
 typedef         uintmax_t atomic_uintmax_t;
57
 
58
-# if defined (__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4) || (defined (__clang__) && (defined (__x86_64__) || defined (__i386__)))
59
+#   if defined (__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4) || (defined (__clang__) && (defined (__x86_64__) || defined (__i386__)))
60
 
61
 /*** Intel/GCC atomics ***/
62
 
63
@@ -203,7 +203,7 @@
64
 #  define atomic_flag_clear_explicit(object,order) \
65
     atomic_flag_clear(object)
66
 
67
-# elif defined (__GNUC__)
68
+#   elif defined (__GNUC__)
69
 
70
 /*** No atomics ***/
71
 
72
@@ -315,7 +315,7 @@
73
 #  define atomic_flag_clear_explicit(object,order) \
74
     atomic_flag_clear(object)
75
 
76
-# elif defined (_MSC_VER)
77
+#   elif defined (_MSC_VER)
78
 
79
 # include <windows.h>
80
 
81
@@ -397,10 +397,8 @@
82
 #  define atomic_flag_clear_explicit(object,order) \
83
     atomic_flag_clear(object)
84
 
85
-# else
86
-#  error FIXME: implement atomic operations for this compiler.
87
-# endif
88
-# endif
89
+#   endif
90
+#  endif
91
 
92
 typedef atomic_uint_least32_t vlc_atomic_float;
93
 
94
@@ -427,4 +425,9 @@
95
     atomic_store(atom, u.i);
96
 }
97
 
98
+# else /* C++ */
99
+/*** Native C++11 atomics ***/
9
+#  include <atomic>
100
+#  include <atomic>
101
+# endif
10
+
102
+
11
+using std::atomic_uint_least32_t;
103
 #endif
12
+using std::atomic_uintptr_t;
13
+using std::atomic_int;
14
+
15
 # else
16
 
17
 #  define ATOMIC_FLAG_INIT false
(-)files/patch-modules_gui_qt4_dialogs_messages.hpp (-11 lines)
Lines 1-11 Link Here
1
--- modules/gui/qt4/dialogs/messages.hpp.orig	2014-08-14 07:20:04 UTC
2
+++ modules/gui/qt4/dialogs/messages.hpp
3
@@ -55,7 +55,7 @@ private:
4
     void sinkMessage( const MsgEvent * );
5
     bool matchFilter( const QString& );
6
 
7
-    atomic_uint verbosity;
8
+    atomic_int verbosity;
9
     static void MsgCallback( void *, int, const vlc_log_t *, const char *,
10
                              va_list );
11
 

Return to bug 217051