Remove use of anonymous struct in header file
authorKai Koehne <kai.koehne@digia.com>
Mon, 1 Sep 2014 08:43:01 +0000 (10:43 +0200)
committerKai Koehne <kai.koehne@digia.com>
Mon, 1 Sep 2014 10:28:45 +0000 (12:28 +0200)
Although all compilers seem to support this, anonymous structs have only
been added formally to C++ 11. Also, this breaks with a change that adds
a constructor to QElapsedTimer:

error: member 'QElapsedTimer QQmlInstantiationInterrupt::<anonymous struct>::timer' with constructor not allowed in anonymous aggregate
        QElapsedTimer timer;
              ^

Change-Id: I5672060e3a623a5d9c4eb1d4e2981c67b96a1192
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
src/qml/qml/qqmlvme_p.h

index daff335..e819a19 100644 (file)
@@ -104,10 +104,8 @@ public:
 private:
     enum Mode { None, Time, Flag };
     Mode mode;
-    struct {
-        QElapsedTimer timer;
-        int nsecs;
-    };
+    QElapsedTimer timer;
+    int nsecs;
     volatile bool *runWhile;
 };