William A. Kennington III | ac69b48 | 2021-06-02 12:28:27 -0700 | [diff] [blame] | 1 | From 07572920319ea86cebb6dd073ab65915ec207eed Mon Sep 17 00:00:00 2001 |
| 2 | From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@gmail.com> |
| 3 | Date: Sat, 8 May 2021 14:08:41 +0200 |
| 4 | Subject: [PATCH] Remove volatile from static vars to fix build with gcc11 |
| 5 | MIME-Version: 1.0 |
| 6 | Content-Type: text/plain; charset=UTF-8 |
| 7 | Content-Transfer-Encoding: 8bit |
| 8 | |
| 9 | Stolen from [1] |
| 10 | |
| 11 | [1] https://src.fedoraproject.org/rpms/gstreamer1-plugins-good/blob/rawhide/f/gstreamer1-plugins-good-gcc11.patch |
| 12 | |
| 13 | Upstream-Status: Pending |
| 14 | |
| 15 | Signed-off-by: Andreas MΓΌller <schnitzeltony@gmail.com> |
| 16 | --- |
| 17 | ext/qt/gstqsgtexture.cc | 2 +- |
| 18 | ext/qt/gstqtglutility.cc | 2 +- |
| 19 | ext/qt/qtglrenderer.cc | 2 +- |
| 20 | ext/qt/qtitem.cc | 2 +- |
| 21 | ext/qt/qtwindow.cc | 4 ++-- |
| 22 | 5 files changed, 6 insertions(+), 6 deletions(-) |
| 23 | |
| 24 | diff --git a/ext/qt/gstqsgtexture.cc b/ext/qt/gstqsgtexture.cc |
| 25 | index 4cc9fc6..50c8d7f 100644 |
| 26 | --- a/ext/qt/gstqsgtexture.cc |
| 27 | +++ b/ext/qt/gstqsgtexture.cc |
| 28 | @@ -35,7 +35,7 @@ GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFAULT); |
| 29 | |
| 30 | GstQSGTexture::GstQSGTexture () |
| 31 | { |
| 32 | - static volatile gsize _debug; |
| 33 | + static gsize _debug; |
| 34 | |
| 35 | initializeOpenGLFunctions(); |
| 36 | |
| 37 | diff --git a/ext/qt/gstqtglutility.cc b/ext/qt/gstqtglutility.cc |
| 38 | index acb89b6..d2c0922 100644 |
| 39 | --- a/ext/qt/gstqtglutility.cc |
| 40 | +++ b/ext/qt/gstqtglutility.cc |
| 41 | @@ -66,7 +66,7 @@ gst_qt_get_gl_display () |
| 42 | { |
| 43 | GstGLDisplay *display = NULL; |
| 44 | QGuiApplication *app = static_cast<QGuiApplication *> (QCoreApplication::instance ()); |
| 45 | - static volatile gsize _debug; |
| 46 | + static gsize _debug; |
| 47 | |
| 48 | g_assert (app != NULL); |
| 49 | |
| 50 | diff --git a/ext/qt/qtglrenderer.cc b/ext/qt/qtglrenderer.cc |
| 51 | index 2ad5601..bffba8f 100644 |
| 52 | --- a/ext/qt/qtglrenderer.cc |
| 53 | +++ b/ext/qt/qtglrenderer.cc |
| 54 | @@ -22,7 +22,7 @@ GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFAULT); |
| 55 | static void |
| 56 | init_debug (void) |
| 57 | { |
| 58 | - static volatile gsize _debug; |
| 59 | + static gsize _debug; |
| 60 | |
| 61 | if (g_once_init_enter (&_debug)) { |
| 62 | GST_DEBUG_CATEGORY_INIT (GST_CAT_DEFAULT, "qtglrenderer", 0, |
| 63 | diff --git a/ext/qt/qtitem.cc b/ext/qt/qtitem.cc |
| 64 | index 7659800..bc99639 100644 |
| 65 | --- a/ext/qt/qtitem.cc |
| 66 | +++ b/ext/qt/qtitem.cc |
| 67 | @@ -104,7 +104,7 @@ void InitializeSceneGraph::run() |
| 68 | |
| 69 | QtGLVideoItem::QtGLVideoItem() |
| 70 | { |
| 71 | - static volatile gsize _debug; |
| 72 | + static gsize _debug; |
| 73 | |
| 74 | if (g_once_init_enter (&_debug)) { |
| 75 | GST_DEBUG_CATEGORY_INIT (GST_CAT_DEFAULT, "qtglwidget", 0, "Qt GL Widget"); |
| 76 | diff --git a/ext/qt/qtwindow.cc b/ext/qt/qtwindow.cc |
| 77 | index 0dfd3f1..f1bd4ae 100644 |
| 78 | --- a/ext/qt/qtwindow.cc |
| 79 | +++ b/ext/qt/qtwindow.cc |
| 80 | @@ -103,7 +103,7 @@ QtGLWindow::QtGLWindow ( QWindow * parent, QQuickWindow *src ) : |
| 81 | QQuickWindow( parent ), source (src) |
| 82 | { |
| 83 | QGuiApplication *app = static_cast<QGuiApplication *> (QCoreApplication::instance ()); |
| 84 | - static volatile gsize _debug; |
| 85 | + static gsize _debug; |
| 86 | |
| 87 | g_assert (app != NULL); |
| 88 | |
| 89 | @@ -152,7 +152,7 @@ QtGLWindow::beforeRendering() |
| 90 | |
| 91 | g_mutex_lock (&this->priv->lock); |
| 92 | |
| 93 | - static volatile gsize once = 0; |
| 94 | + static gsize once = 0; |
| 95 | if (g_once_init_enter(&once)) { |
| 96 | this->priv->start = QDateTime::currentDateTime().toMSecsSinceEpoch(); |
| 97 | g_once_init_leave(&once,1); |
| 98 | -- |
| 99 | 2.30.2 |
| 100 | |