From 11e45f683abc46efefb29ecc55bf50cfed14e489 Mon Sep 17 00:00:00 2001 From: Filippo Cucchetto Date: Sat, 30 Jan 2016 13:40:25 +0100 Subject: [PATCH] Other fixes for making compile the project on Visual Studio 2013 --- lib/include/DOtherSide/DOtherSideTypesCpp.h | 9 +++++---- lib/include/DOtherSide/Utils.h | 12 +++++++----- meson.build | 2 +- test/main.qml | 4 ++-- 4 files changed, 15 insertions(+), 12 deletions(-) diff --git a/lib/include/DOtherSide/DOtherSideTypesCpp.h b/lib/include/DOtherSide/DOtherSideTypesCpp.h index 1a947c9..30fc434 100644 --- a/lib/include/DOtherSide/DOtherSideTypesCpp.h +++ b/lib/include/DOtherSide/DOtherSideTypesCpp.h @@ -3,6 +3,7 @@ // std #include // Qt +#include #include #include // DOtherSide @@ -124,10 +125,10 @@ public: SafeQMetaObjectPtr(const SafeQMetaObjectPtr&) = delete; SafeQMetaObjectPtr& operator=(const SafeQMetaObjectPtr&) = delete; - operator bool() const noexcept { return m_d != nullptr; } - operator const QMetaObject*() const noexcept { return m_d.get(); } - const QMetaObject* operator->() const noexcept { return m_d.get(); } - void reset(QMetaObject* other) noexcept { m_d.reset(other); } + operator bool() const Q_DECL_NOEXCEPT { return m_d != nullptr; } + operator const QMetaObject*() const Q_DECL_NOEXCEPT { return m_d.get(); } + const QMetaObject* operator->() const Q_DECL_NOEXCEPT { return m_d.get(); } + void reset(QMetaObject* other) Q_DECL_NOEXCEPT { m_d.reset(other); } private: std::unique_ptr m_d; diff --git a/lib/include/DOtherSide/Utils.h b/lib/include/DOtherSide/Utils.h index ebcb9d4..015744f 100644 --- a/lib/include/DOtherSide/Utils.h +++ b/lib/include/DOtherSide/Utils.h @@ -4,6 +4,8 @@ #include #include #include +// Qt +#include namespace DOS { @@ -14,19 +16,19 @@ struct wrapped_array { wrapped_array(T* first, std::ptrdiff_t size) : wrapped_array {first, first + size} {} - T* begin() const noexcept { return begin_; } - T* end() const noexcept { return end_; } + T* begin() const Q_DECL_NOEXCEPT { return begin_; } + T* end() const Q_DECL_NOEXCEPT { return end_; } T* begin_; T* end_; }; template -wrapped_array wrap_array(T* first, std::ptrdiff_t size) noexcept +wrapped_array wrap_array(T* first, std::ptrdiff_t size) Q_DECL_NOEXCEPT { return {first, size}; } template -std::vector toVector(G* first, std::ptrdiff_t size) noexcept +std::vector toVector(G* first, std::ptrdiff_t size) Q_DECL_NOEXCEPT { const wrapped_array array = wrap_array(first, size); std::vector result; @@ -36,7 +38,7 @@ std::vector toVector(G* first, std::ptrdiff_t size) noexcept } template ::type> -std::vector toVector(T* first, std::ptrdiff_t size, K f) noexcept +std::vector toVector(T* first, std::ptrdiff_t size, K f) Q_DECL_NOEXCEPT { wrapped_array array = wrap_array(first, size); std::vector result; diff --git a/meson.build b/meson.build index 64eb6a6..cd9eab3 100644 --- a/meson.build +++ b/meson.build @@ -1,4 +1,4 @@ -project('DOtherSide', 'cpp', default_options : ['cpp_std=c++14']) +project('DOtherSide', 'cpp', default_options : ['cpp_std=c++11']) subdir('lib') subdir('test') diff --git a/test/main.qml b/test/main.qml index f8fe9a6..93fdea4 100644 --- a/test/main.qml +++ b/test/main.qml @@ -1,5 +1,5 @@ -import QtQuick 2.5 -import QtQuick.Controls 1.4 +import QtQuick 2.4 +import QtQuick.Controls 1.3 ApplicationWindow { width: 100