This does fix #61. See the comments in #61 for details.

This commit is contained in:
Hauke Heibel 2009-10-22 09:29:59 +02:00
parent 9af431e78e
commit 76d578fb99
2 changed files with 24 additions and 2 deletions

View File

@ -1,8 +1,21 @@
#ifndef EIGEN_QTMALLOC_MODULE_H #ifndef EIGEN_QTMALLOC_MODULE_H
#define EIGEN_QTMALLOC_MODULE_H #define EIGEN_QTMALLOC_MODULE_H
#ifdef QVECTOR_H
#error You must include <Eigen/QtAlignedMalloc> before <QtCore/QVector>.
#endif
#ifdef Q_DECL_IMPORT
#define Q_DECL_IMPORT_ORIG Q_DECL_IMPORT
#undef Q_DECL_IMPORT
#define Q_DECL_IMPORT
#else
#define Q_DECL_IMPORT
#endif
#include "Core" #include "Core"
#include <QtCore/QVector>
#include <QtCore/QVectorData> #include <QtCore/QVectorData>
#if (!EIGEN_MALLOC_ALREADY_ALIGNED) #if (!EIGEN_MALLOC_ALREADY_ALIGNED)
@ -37,4 +50,11 @@ QVectorData *QVectorData::malloc(int sizeofTypedData, int size, int sizeofT, QVe
#endif #endif
#ifdef Q_DECL_IMPORT_ORIG
#define Q_DECL_IMPORT Q_DECL_IMPORT_ORIG
#undef Q_DECL_IMPORT_ORIG
#else
#undef Q_DECL_IMPORT
#endif
#endif // EIGEN_QTMALLOC_MODULE_H #endif // EIGEN_QTMALLOC_MODULE_H

View File

@ -26,10 +26,12 @@
#define EIGEN_WORK_AROUND_QT_BUG_CALLING_WRONG_OPERATOR_NEW_FIXED_IN_QT_4_5 #define EIGEN_WORK_AROUND_QT_BUG_CALLING_WRONG_OPERATOR_NEW_FIXED_IN_QT_4_5
#include "main.h" #include "main.h"
#include <QtCore/QVector>
#include <Eigen/Geometry> #include <Eigen/Geometry>
#include <Eigen/QtAlignedMalloc> #include <Eigen/QtAlignedMalloc>
#include <QtCore/QVector>
template<typename MatrixType> template<typename MatrixType>
void check_qtvector_matrix(const MatrixType& m) void check_qtvector_matrix(const MatrixType& m)
{ {