vlc-2.2.4-qt57.patch 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285
  1. As the 2.2 headers are still using vlc_atomics (picture)
  2. we cannot have a way to avoid collisions with early
  3. or late <atomic> inclusion when using GCC >= 4.7
  4. Conditionals in vlc_atomic won't work.
  5. Happens in ProjectM and Qt5.
  6. ---
  7. modules/gui/qt4/actions_manager.cpp | 2 ++
  8. modules/gui/qt4/adapters/seekpoints.cpp | 4 +--
  9. modules/gui/qt4/adapters/seekpoints.hpp | 4 +--
  10. modules/gui/qt4/components/controller.cpp | 2 ++
  11. .../gui/qt4/components/playlist/playlist_model.hpp | 4 +--
  12. modules/gui/qt4/components/playlist/views.cpp | 6 ++++
  13. modules/gui/qt4/dialogs/messages.cpp | 2 ++
  14. modules/gui/qt4/dialogs/vlm.cpp | 4 ---
  15. modules/gui/qt4/dialogs/vlm.hpp | 4 ++-
  16. modules/gui/qt4/input_manager.cpp | 2 ++
  17. modules/gui/qt4/input_manager.hpp | 3 +-
  18. modules/gui/qt4/menus.cpp | 2 ++
  19. modules/gui/qt4/qt4.hpp | 32 ++++++++++++++++++----
  20. modules/gui/qt4/util/pictureflow.cpp | 2 ++
  21. modules/visualization/projectm.cpp | 4 +++
  22. 15 files changed, 56 insertions(+), 21 deletions(-)
  23. diff --git a/modules/gui/qt4/actions_manager.cpp b/modules/gui/qt4/actions_manager.cpp
  24. index eff40d9..b7ca967 100644
  25. --- a/modules/gui/qt4/actions_manager.cpp
  26. +++ b/modules/gui/qt4/actions_manager.cpp
  27. @@ -25,6 +25,8 @@
  28. # include "config.h"
  29. #endif
  30. +#include "qt4.hpp"
  31. +
  32. #include <vlc_vout.h>
  33. #include <vlc_keys.h>
  34. diff --git a/modules/gui/qt4/adapters/seekpoints.cpp b/modules/gui/qt4/adapters/seekpoints.cpp
  35. index fbf2957..a3564bb 100644
  36. --- a/modules/gui/qt4/adapters/seekpoints.cpp
  37. +++ b/modules/gui/qt4/adapters/seekpoints.cpp
  38. @@ -19,14 +19,12 @@
  39. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  40. *****************************************************************************/
  41. +#include "seekpoints.hpp"
  42. #include "recents.hpp"
  43. #include "dialogs_provider.hpp"
  44. #include "menus.hpp"
  45. -#include "seekpoints.hpp"
  46. -
  47. -#include "qt4.hpp"
  48. #include "input_manager.hpp"
  49. SeekPoints::SeekPoints( QObject *parent, intf_thread_t *p_intf_ ) :
  50. diff --git a/modules/gui/qt4/adapters/seekpoints.hpp b/modules/gui/qt4/adapters/seekpoints.hpp
  51. index 0083989..bbb9214 100644
  52. --- a/modules/gui/qt4/adapters/seekpoints.hpp
  53. +++ b/modules/gui/qt4/adapters/seekpoints.hpp
  54. @@ -22,9 +22,7 @@
  55. #ifndef SEEKPOINTS_HPP
  56. #define SEEKPOINTS_HPP
  57. -#ifdef HAVE_CONFIG_H
  58. -#include "config.h"
  59. -#endif
  60. +#include "qt4.hpp"
  61. #include <vlc_common.h>
  62. #include <vlc_interface.h>
  63. diff --git a/modules/gui/qt4/components/controller.cpp b/modules/gui/qt4/components/controller.cpp
  64. index d93e0db..c43d929 100644
  65. --- a/modules/gui/qt4/components/controller.cpp
  66. +++ b/modules/gui/qt4/components/controller.cpp
  67. @@ -26,6 +26,8 @@
  68. # include "config.h"
  69. #endif
  70. +#include "qt4.hpp"
  71. +
  72. #include <vlc_vout.h> /* vout_thread_t for FSC */
  73. /* Widgets */
  74. diff --git a/modules/gui/qt4/components/playlist/playlist_model.hpp b/modules/gui/qt4/components/playlist/playlist_model.hpp
  75. index f9d1d0c..1f71ac9 100644
  76. --- a/modules/gui/qt4/components/playlist/playlist_model.hpp
  77. +++ b/modules/gui/qt4/components/playlist/playlist_model.hpp
  78. @@ -25,9 +25,7 @@
  79. #ifndef _PLAYLIST_MODEL_H_
  80. #define _PLAYLIST_MODEL_H_
  81. -#ifdef HAVE_CONFIG_H
  82. -# include "config.h"
  83. -#endif
  84. +#include "qt4.hpp"
  85. #include <vlc_input.h>
  86. #include <vlc_playlist.h>
  87. diff --git a/modules/gui/qt4/components/playlist/views.cpp b/modules/gui/qt4/components/playlist/views.cpp
  88. index 59f6535..0066205 100644
  89. --- a/modules/gui/qt4/components/playlist/views.cpp
  90. +++ b/modules/gui/qt4/components/playlist/views.cpp
  91. @@ -21,6 +21,12 @@
  92. * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  93. *****************************************************************************/
  94. +#ifdef HAVE_CONFIG_H
  95. +#include "config.h"
  96. +#endif
  97. +
  98. +#include "qt4.hpp"
  99. +
  100. #include "components/playlist/views.hpp"
  101. #include "components/playlist/vlc_model.hpp" /* VLCModel */
  102. #include "components/playlist/sorting.h" /* Columns List */
  103. diff --git a/modules/gui/qt4/dialogs/messages.cpp b/modules/gui/qt4/dialogs/messages.cpp
  104. index 30793a2..9c79c99 100644
  105. --- a/modules/gui/qt4/dialogs/messages.cpp
  106. +++ b/modules/gui/qt4/dialogs/messages.cpp
  107. @@ -24,6 +24,8 @@
  108. # include "config.h"
  109. #endif
  110. +#include "qt4.hpp"
  111. +
  112. #include "dialogs/messages.hpp"
  113. #include <QPlainTextEdit>
  114. diff --git a/modules/gui/qt4/dialogs/vlm.cpp b/modules/gui/qt4/dialogs/vlm.cpp
  115. index 0da88cc..595f015 100644
  116. --- a/modules/gui/qt4/dialogs/vlm.cpp
  117. +++ b/modules/gui/qt4/dialogs/vlm.cpp
  118. @@ -23,10 +23,6 @@
  119. * Foundation, Inc., 51 Franklin street, Fifth Floor, Boston MA 02110-1301, USA.
  120. *****************************************************************************/
  121. -#ifdef HAVE_CONFIG_H
  122. -# include "config.h"
  123. -#endif
  124. -
  125. #include "dialogs/vlm.hpp"
  126. #ifdef ENABLE_VLM
  127. diff --git a/modules/gui/qt4/dialogs/vlm.hpp b/modules/gui/qt4/dialogs/vlm.hpp
  128. index a3c6e5d..dcf7110 100644
  129. --- a/modules/gui/qt4/dialogs/vlm.hpp
  130. +++ b/modules/gui/qt4/dialogs/vlm.hpp
  131. @@ -25,8 +25,10 @@
  132. #ifndef QVLC_VLM_DIALOG_H_
  133. #define QVLC_VLM_DIALOG_H_ 1
  134. +#include "qt4.hpp"
  135. +
  136. #ifdef HAVE_CONFIG_H
  137. -# include "config.h"
  138. +#include "config.h"
  139. #endif
  140. #ifdef ENABLE_VLM
  141. diff --git a/modules/gui/qt4/input_manager.cpp b/modules/gui/qt4/input_manager.cpp
  142. index fd45f4a..c50cb6c 100644
  143. --- a/modules/gui/qt4/input_manager.cpp
  144. +++ b/modules/gui/qt4/input_manager.cpp
  145. @@ -30,6 +30,8 @@
  146. # include "config.h"
  147. #endif
  148. +#include "qt4.hpp"
  149. +
  150. #include "input_manager.hpp"
  151. #include "recents.hpp"
  152. diff --git a/modules/gui/qt4/input_manager.hpp b/modules/gui/qt4/input_manager.hpp
  153. index 7d3b76a..4fbecbb 100644
  154. --- a/modules/gui/qt4/input_manager.hpp
  155. +++ b/modules/gui/qt4/input_manager.hpp
  156. @@ -29,9 +29,10 @@
  157. # include "config.h"
  158. #endif
  159. +#include "qt4.hpp"
  160. +
  161. #include <vlc_input.h>
  162. -#include "qt4.hpp"
  163. #include "util/singleton.hpp"
  164. #include "adapters/variables.hpp"
  165. diff --git a/modules/gui/qt4/menus.cpp b/modules/gui/qt4/menus.cpp
  166. index 116e98c..46240b0 100644
  167. --- a/modules/gui/qt4/menus.cpp
  168. +++ b/modules/gui/qt4/menus.cpp
  169. @@ -34,6 +34,8 @@
  170. # include "config.h"
  171. #endif
  172. +#include "qt4.hpp"
  173. +
  174. #include <vlc_common.h>
  175. #include <vlc_intf_strings.h>
  176. #include <vlc_vout.h> /* vout_thread_t */
  177. diff --git a/modules/gui/qt4/qt4.hpp b/modules/gui/qt4/qt4.hpp
  178. index 44d7db6..5aec957 100644
  179. --- a/modules/gui/qt4/qt4.hpp
  180. +++ b/modules/gui/qt4/qt4.hpp
  181. @@ -29,12 +29,7 @@
  182. # include "config.h"
  183. #endif
  184. -#include <vlc_common.h> /* VLC_COMMON_MEMBERS for vlc_interface.h */
  185. -#include <vlc_interface.h> /* intf_thread_t */
  186. -#include <vlc_playlist.h> /* playlist_t */
  187. -
  188. -#define QT_NO_CAST_TO_ASCII
  189. -#include <QString>
  190. +#include <QtGlobal>
  191. #if ( QT_VERSION < 0x040600 )
  192. # error Update your Qt version to at least 4.6.0
  193. @@ -43,6 +38,31 @@
  194. #define HAS_QT47 ( QT_VERSION >= 0x040700 )
  195. #define HAS_QT5 ( QT_VERSION >= 0x050000 )
  196. +#if HAS_QT5
  197. + #include <QtCore/qcompilerdetection.h>
  198. + #if defined(Q_COMPILER_ATOMICS) && \
  199. + ( __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7 ) )
  200. + #define VLC_ATOMIC_H
  201. + #include <atomic>
  202. + using namespace std;
  203. + # define atomic_store(object,desired) \
  204. + do { \
  205. + *(object) = (desired); \
  206. + __sync_synchronize(); \
  207. + } while (0)
  208. +
  209. + # define atomic_load(object) \
  210. + (__sync_synchronize(), *(object))
  211. + #endif
  212. +#endif
  213. +
  214. +#include <vlc_common.h> /* VLC_COMMON_MEMBERS for vlc_interface.h */
  215. +#include <vlc_interface.h> /* intf_thread_t */
  216. +#include <vlc_playlist.h> /* playlist_t */
  217. +
  218. +#define QT_NO_CAST_TO_ASCII
  219. +#include <QString>
  220. +
  221. enum {
  222. DialogEventTypeOffset = 0,
  223. IMEventTypeOffset = 100,
  224. diff --git a/modules/gui/qt4/util/pictureflow.cpp b/modules/gui/qt4/util/pictureflow.cpp
  225. index 9318953..a7e6a01 100644
  226. --- a/modules/gui/qt4/util/pictureflow.cpp
  227. +++ b/modules/gui/qt4/util/pictureflow.cpp
  228. @@ -29,6 +29,8 @@
  229. THE SOFTWARE.
  230. */
  231. +#include "qt4.hpp"
  232. +
  233. #include "pictureflow.hpp"
  234. #include <QApplication>
  235. diff --git a/modules/visualization/projectm.cpp b/modules/visualization/projectm.cpp
  236. index e80fbf4..96d532d 100644
  237. --- a/modules/visualization/projectm.cpp
  238. +++ b/modules/visualization/projectm.cpp
  239. @@ -30,6 +30,10 @@
  240. #endif
  241. #include <assert.h>
  242. +#if defined(__GNUC__) && \
  243. + ( __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7 ) )
  244. + #define VLC_ATOMIC_H /* Ensure C atomics wont collide with old intrinsics */
  245. +#endif
  246. #include <vlc_common.h>
  247. #include <vlc_plugin.h>
  248. --
  249. 2.7.4