Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cxx-qt-lib: workaround GCC bug for explicit specialisation outside namespace #641

Merged
merged 1 commit into from
Jul 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion crates/cxx-qt-gen/include/cxxqt_thread.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,13 @@ cxxQtThreadQueue(const CxxQtThread<T>& cxxQtThread,
} // namespace cxxqtlib1
} // namespace rust

// Define namespace otherwise we hit a GCC bug
// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56480
namespace rust {

template<typename T>
struct rust::IsRelocatable<::rust::cxxqtlib1::CxxQtThread<T>> : ::std::true_type
struct IsRelocatable<::rust::cxxqtlib1::CxxQtThread<T>> : ::std::true_type
{
};

} // namespace rust
8 changes: 7 additions & 1 deletion crates/cxx-qt-lib-headers/include/core/qbytearray.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,17 @@

#include "rust/cxx.h"

// Define namespace otherwise we hit a GCC bug
// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56480
namespace rust {

template<>
struct rust::IsRelocatable<QByteArray> : ::std::true_type
struct IsRelocatable<QByteArray> : ::std::true_type
{
};

} // namespace rust

namespace rust {
namespace cxxqtlib1 {

Expand Down
8 changes: 7 additions & 1 deletion crates/cxx-qt-lib-headers/include/core/qdatetime.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,17 @@

#include "rust/cxx.h"

// Define namespace otherwise we hit a GCC bug
// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56480
namespace rust {

template<>
struct rust::IsRelocatable<QDateTime> : ::std::true_type
struct IsRelocatable<QDateTime> : ::std::true_type
{
};

} // namespace rust

namespace rust {
namespace cxxqtlib1 {

Expand Down
8 changes: 7 additions & 1 deletion crates/cxx-qt-lib-headers/include/core/qhash.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,18 @@

#include "rust/cxx.h"

// Define namespace otherwise we hit a GCC bug
// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56480
namespace rust {

// This has static asserts in the cpp file to ensure this is valid.
template<typename K, typename V>
struct rust::IsRelocatable<QHash<K, V>> : ::std::true_type
struct IsRelocatable<QHash<K, V>> : ::std::true_type
{
};

} // namespace rust

namespace rust {
namespace cxxqtlib1 {
namespace qhash {
Expand Down
8 changes: 7 additions & 1 deletion crates/cxx-qt-lib-headers/include/core/qlist.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,17 @@
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
#include "qlist_qvector.h"
#else
// Define namespace otherwise we hit a GCC bug
// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56480
namespace rust {

// This has static asserts in the cpp file to ensure this is valid.
template<typename T>
struct rust::IsRelocatable<QList<T>> : ::std::true_type
struct IsRelocatable<QList<T>> : ::std::true_type
{
};

} // namespace rust
#endif

namespace rust {
Expand Down
8 changes: 7 additions & 1 deletion crates/cxx-qt-lib-headers/include/core/qlist_qvector.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,16 @@

#include "rust/cxx.h"

// Define namespace otherwise we hit a GCC bug
// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56480
namespace rust {

// This has static asserts in the cpp file to ensure this is valid.
template<typename T>
struct rust::IsRelocatable<QList<T>> : ::std::true_type
struct IsRelocatable<QList<T>> : ::std::true_type
{
};

} // namespace rust

#endif
8 changes: 7 additions & 1 deletion crates/cxx-qt-lib-headers/include/core/qmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,18 @@

#include "rust/cxx.h"

// Define namespace otherwise we hit a GCC bug
// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56480
namespace rust {

// This has static asserts in the cpp file to ensure this is valid.
template<typename K, typename V>
struct rust::IsRelocatable<QMap<K, V>> : ::std::true_type
struct IsRelocatable<QMap<K, V>> : ::std::true_type
{
};

} // namespace rust

namespace rust {
namespace cxxqtlib1 {
namespace qmap {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,17 @@

#include "rust/cxx.h"

// Define namespace otherwise we hit a GCC bug
// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56480
namespace rust {

template<>
struct rust::IsRelocatable<::QMetaObject::Connection> : ::std::true_type
struct IsRelocatable<::QMetaObject::Connection> : ::std::true_type
{
};

} // namespace rust

namespace rust {
namespace cxxqtlib1 {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,14 @@

#include "rust/cxx.h"

// Define namespace otherwise we hit a GCC bug
// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56480
namespace rust {

// This has static asserts in the cpp file to ensure this is valid.
template<>
struct rust::IsRelocatable<QPersistentModelIndex> : ::std::true_type
struct IsRelocatable<QPersistentModelIndex> : ::std::true_type
{
};

} // namespace rust
8 changes: 7 additions & 1 deletion crates/cxx-qt-lib-headers/include/core/qset.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,18 @@

#include "rust/cxx.h"

// Define namespace otherwise we hit a GCC bug
// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56480
namespace rust {

// This has static asserts in the cpp file to ensure this is valid.
template<typename T>
struct rust::IsRelocatable<QSet<T>> : ::std::true_type
struct IsRelocatable<QSet<T>> : ::std::true_type
{
};

} // namespace rust

namespace rust {
namespace cxxqtlib1 {
namespace qset {
Expand Down
8 changes: 7 additions & 1 deletion crates/cxx-qt-lib-headers/include/core/qstring.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,17 @@

#include "rust/cxx.h"

// Define namespace otherwise we hit a GCC bug
// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56480
namespace rust {

template<>
struct rust::IsRelocatable<QString> : ::std::true_type
struct IsRelocatable<QString> : ::std::true_type
{
};

} // namespace rust

namespace rust {
namespace cxxqtlib1 {

Expand Down
8 changes: 7 additions & 1 deletion crates/cxx-qt-lib-headers/include/core/qstringlist.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,17 @@

#include "rust/cxx.h"

// Define namespace otherwise we hit a GCC bug
// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56480
namespace rust {

template<>
struct rust::IsRelocatable<QStringList> : ::std::true_type
struct IsRelocatable<QStringList> : ::std::true_type
{
};

} // namespace rust

namespace rust {
namespace cxxqtlib1 {

Expand Down
8 changes: 7 additions & 1 deletion crates/cxx-qt-lib-headers/include/core/qurl.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,17 @@

#include "rust/cxx.h"

// Define namespace otherwise we hit a GCC bug
// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56480
namespace rust {

template<>
struct rust::IsRelocatable<QUrl> : ::std::true_type
struct IsRelocatable<QUrl> : ::std::true_type
{
};

} // namespace rust

namespace rust {
namespace cxxqtlib1 {

Expand Down
8 changes: 7 additions & 1 deletion crates/cxx-qt-lib-headers/include/core/qvariant.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,17 @@

#include "rust/cxx.h"

// Define namespace otherwise we hit a GCC bug
// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56480
namespace rust {

template<>
struct rust::IsRelocatable<QVariant> : ::std::true_type
struct IsRelocatable<QVariant> : ::std::true_type
{
};

} // namespace rust

namespace rust {
namespace cxxqtlib1 {
namespace qvariant {
Expand Down
8 changes: 7 additions & 1 deletion crates/cxx-qt-lib-headers/include/core/qvector.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,17 @@
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
#include "qlist_qvector.h"
#else
// Define namespace otherwise we hit a GCC bug
// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56480
namespace rust {

// This has static asserts in the cpp file to ensure this is valid.
template<typename T>
struct rust::IsRelocatable<QVector<T>> : ::std::true_type
struct IsRelocatable<QVector<T>> : ::std::true_type
{
};

} // namespace rust
#endif

namespace rust {
Expand Down
8 changes: 7 additions & 1 deletion crates/cxx-qt-lib-headers/include/gui/qcolor.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,16 @@
// QColor still had copy & move constructors in Qt 5 but they were basically
// trivial.
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
// Define namespace otherwise we hit a GCC bug
// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56480
namespace rust {

template<>
struct rust::IsRelocatable<QColor> : ::std::true_type
struct IsRelocatable<QColor> : ::std::true_type
{
};

} // namespace rust
#endif

namespace rust {
Expand Down