aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2017-04-28 15:29:27 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2017-04-28 15:29:27 +0200
commitdc3efce3dfc668f65fad3486ac689ceb4870ce09 (patch)
treefe0ca3a787f2da0ae07371290538180f0c7f8b8d
parent54cc52d16ccd0c6350823a1cfcc0154c1a1f543b (diff)
parent73ba1c3442dc7bb14a71183a98f6a08f9600f4e9 (diff)
Merge remote-tracking branch 'origin/5.6' into 5.9
-rw-r--r--ApiExtractor/typedatabase.cpp22
-rw-r--r--generator/shiboken2/cppgenerator.cpp2
-rw-r--r--tests/libsample/photon.h14
3 files changed, 23 insertions, 15 deletions
diff --git a/ApiExtractor/typedatabase.cpp b/ApiExtractor/typedatabase.cpp
index d9a741f..8530d15 100644
--- a/ApiExtractor/typedatabase.cpp
+++ b/ApiExtractor/typedatabase.cpp
@@ -384,14 +384,16 @@ bool TypeDatabase::isSuppressedWarning(const QString& s) const
QString TypeDatabase::modifiedTypesystemFilepath(const QString& tsFile) const
{
- if (!QFile::exists(tsFile)) {
- int idx = tsFile.lastIndexOf(QLatin1Char('/'));
- QString fileName = idx >= 0 ? tsFile.right(tsFile.length() - idx - 1) : tsFile;
- for (const QString &path : m_typesystemPaths) {
- QString filepath(path + QLatin1Char('/') + fileName);
- if (QFile::exists(filepath))
- return filepath;
- }
+ const QFileInfo tsFi(tsFile);
+ if (tsFi.isAbsolute()) // No point in further lookups
+ return tsFi.absoluteFilePath();
+ if (tsFi.isFile()) // Make path absolute
+ return tsFi.absoluteFilePath();
+ const QString fileName = tsFi.fileName();
+ for (const QString &path : m_typesystemPaths) {
+ const QFileInfo fi(path + QLatin1Char('/') + fileName);
+ if (fi.isFile())
+ return fi.absoluteFilePath();
}
return tsFile;
}
@@ -402,13 +404,17 @@ bool TypeDatabase::parseFile(const QString &filename, bool generate)
if (m_parsedTypesystemFiles.contains(filepath))
return m_parsedTypesystemFiles[filepath];
+ m_parsedTypesystemFiles[filepath] = true; // Prevent recursion when including self.
+
QFile file(filepath);
if (!file.exists()) {
+ m_parsedTypesystemFiles[filepath] = false;
qCWarning(lcShiboken).noquote().nospace()
<< "Can't find " << filename << ", typesystem paths: " << m_typesystemPaths.join(QLatin1String(", "));
return false;
}
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
+ m_parsedTypesystemFiles[filepath] = false;
qCWarning(lcShiboken).noquote().nospace()
<< "Can't open " << QDir::toNativeSeparators(filename) << ": " << file.errorString();
return false;
diff --git a/generator/shiboken2/cppgenerator.cpp b/generator/shiboken2/cppgenerator.cpp
index df2fd4a..f8b90af 100644
--- a/generator/shiboken2/cppgenerator.cpp
+++ b/generator/shiboken2/cppgenerator.cpp
@@ -266,7 +266,7 @@ void CppGenerator::generateClass(QTextStream &s, GeneratorContext &classContext)
s << endl << "// main header" << endl << "#include \"" << headerfile << '"' << endl;
// PYSIDE-500: Use also includes for inherited wrapper classes, because
- // with the protected hack, we sometimes need to cast inherited wrappers.
+ // without the protected hack, we sometimes need to cast inherited wrappers.
s << endl << "// inherited wrapper classes" << endl;
AbstractMetaClass *basis = metaClass->baseClass();
for (; basis; basis = basis->baseClass()) {
diff --git a/tests/libsample/photon.h b/tests/libsample/photon.h
index e3baa12..d8b1be4 100644
--- a/tests/libsample/photon.h
+++ b/tests/libsample/photon.h
@@ -108,21 +108,23 @@ LIBSAMPLE_API int countValueDuplicators(const std::list<TemplateBase<DuplicatorT
//
// NOTE: For reasons that should be fairly obvious, this test unfortunately can
// only be "run" when building in C++11 mode.
-#if __cplusplus < 201103L
-#define noexcept
+#if __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1900)
+# define PHOTON_NOEXCEPT noexcept
+#else
+# define PHOTON_NOEXCEPT
#endif
class Pointer
{
public:
- Pointer() noexcept : px(0) {}
+ Pointer() PHOTON_NOEXCEPT : px(0) {}
Pointer(int* p) : px(p) {}
- void reset() noexcept { Pointer().swap(*this); }
+ void reset() PHOTON_NOEXCEPT { Pointer().swap(*this); }
- int* get() const noexcept { return px; }
+ int* get() const PHOTON_NOEXCEPT { return px; }
int& operator*() const { return *px; }
- void swap(Pointer& rhs) noexcept
+ void swap(Pointer& rhs) PHOTON_NOEXCEPT
{
int* tmp = px;
px = rhs.px;