summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@qt.io>2018-06-28 05:35:03 +0200
committerAndy Shaw <andy.shaw@qt.io>2018-08-20 12:51:59 +0000
commit29035a09a4db2fb3d35d8d494b609bb15b0a97f5 (patch)
tree8b9256342e359332f624cda6e11333ac4f549833
parent608de36fd8802b53d028a92b1984c40321435b0a (diff)
Compile with Xcode 9.4
The changes are backported from the assimp 4.1 version Change-Id: I0adee853961ffbbecf1f8212b41d3ec06fd57109 Reviewed-by: Mike Krus <mike.krus@kdab.com>
-rw-r--r--src/3rdparty/assimp/code/BlenderModifier.cpp2
-rw-r--r--src/3rdparty/assimp/code/FBXDocument.cpp4
-rw-r--r--src/3rdparty/assimp/code/FBXMeshGeometry.cpp2
-rw-r--r--src/3rdparty/assimp/code/LWOAnimation.cpp2
-rw-r--r--src/3rdparty/assimp/code/OgreParsingUtils.h8
-rw-r--r--src/3rdparty/patches/0007-Compile-with-Xcode-9.4.patch93
6 files changed, 102 insertions, 9 deletions
diff --git a/src/3rdparty/assimp/code/BlenderModifier.cpp b/src/3rdparty/assimp/code/BlenderModifier.cpp
index 24aed25d0..9c48b79a8 100644
--- a/src/3rdparty/assimp/code/BlenderModifier.cpp
+++ b/src/3rdparty/assimp/code/BlenderModifier.cpp
@@ -265,7 +265,7 @@ void BlenderModifier_Mirror :: DoIt(aiNode& out, ConversionData& conv_data, co
std::copy(out.mMeshes,out.mMeshes+out.mNumMeshes,nind);
std::transform(out.mMeshes,out.mMeshes+out.mNumMeshes,nind+out.mNumMeshes,
- std::bind1st(std::plus< unsigned int >(),out.mNumMeshes));
+ [&out](unsigned int n) { return out.mNumMeshes + n; });
delete[] out.mMeshes;
out.mMeshes = nind;
diff --git a/src/3rdparty/assimp/code/FBXDocument.cpp b/src/3rdparty/assimp/code/FBXDocument.cpp
index cf5f6da86..7215acbc3 100644
--- a/src/3rdparty/assimp/code/FBXDocument.cpp
+++ b/src/3rdparty/assimp/code/FBXDocument.cpp
@@ -574,7 +574,7 @@ std::vector<const Connection*> Document::GetConnectionsSequenced(uint64_t id,
temp.push_back((*it).second);
}
- std::sort(temp.begin(), temp.end(), std::mem_fun(&Connection::Compare));
+ std::sort(temp.begin(), temp.end(), std::mem_fn(&Connection::Compare));
return temp; // NRVO should handle this
}
@@ -626,7 +626,7 @@ std::vector<const Connection*> Document::GetConnectionsSequenced(uint64_t id, bo
temp.push_back((*it).second);
}
- std::sort(temp.begin(), temp.end(), std::mem_fun(&Connection::Compare));
+ std::sort(temp.begin(), temp.end(), std::mem_fn(&Connection::Compare));
return temp; // NRVO should handle this
}
diff --git a/src/3rdparty/assimp/code/FBXMeshGeometry.cpp b/src/3rdparty/assimp/code/FBXMeshGeometry.cpp
index e9d83911b..d57df577a 100644
--- a/src/3rdparty/assimp/code/FBXMeshGeometry.cpp
+++ b/src/3rdparty/assimp/code/FBXMeshGeometry.cpp
@@ -356,7 +356,7 @@ void MeshGeometry::ReadVertexData(const std::string& type, int index, const Scop
// avoids losing the material if there are more material layers
// coming of which at least one contains actual data (did observe
// that with one test file).
- const size_t count_neg = std::count_if(temp_materials.begin(),temp_materials.end(),std::bind2nd(std::less<int>(),0));
+ const size_t count_neg = std::count_if(temp_materials.begin(),temp_materials.end(),[](int n) { return n < 0; });
if(count_neg == temp_materials.size()) {
FBXImporter::LogWarn("ignoring dummy material layer (all entries -1)");
return;
diff --git a/src/3rdparty/assimp/code/LWOAnimation.cpp b/src/3rdparty/assimp/code/LWOAnimation.cpp
index 9f23c13b2..134c04cc8 100644
--- a/src/3rdparty/assimp/code/LWOAnimation.cpp
+++ b/src/3rdparty/assimp/code/LWOAnimation.cpp
@@ -162,7 +162,7 @@ void AnimResolver::UpdateAnimRangeSetup()
{
const double start_time = delta - fmod(my_first-first,delta);
std::vector<LWO::Key>::iterator n = std::find_if((*it).keys.begin(),(*it).keys.end(),
- std::bind1st(std::greater<double>(),start_time)),m;
+ [start_time](double t) { return start_time > t; }),m;
size_t ofs = 0;
if (n != (*it).keys.end()) {
diff --git a/src/3rdparty/assimp/code/OgreParsingUtils.h b/src/3rdparty/assimp/code/OgreParsingUtils.h
index def3cf733..388f9686e 100644
--- a/src/3rdparty/assimp/code/OgreParsingUtils.h
+++ b/src/3rdparty/assimp/code/OgreParsingUtils.h
@@ -90,11 +90,11 @@ static inline std::string &TrimLeft(std::string &s, bool newlines = true)
{
if (!newlines)
{
- s.erase(s.begin(), std::find_if(s.begin(), s.end(), std::not1(std::ptr_fun(Assimp::IsSpace<char>))));
+ s.erase(s.begin(), std::find_if(s.begin(), s.end(), [](char c) { return !Assimp::IsSpace<char>(c); }));
}
else
{
- s.erase(s.begin(), std::find_if(s.begin(), s.end(), std::not1(std::ptr_fun(Assimp::IsSpaceOrNewLine<char>))));
+ s.erase(s.begin(), std::find_if(s.begin(), s.end(), [](char c) { return !Assimp::IsSpaceOrNewLine<char>(c); }));
}
return s;
}
@@ -104,11 +104,11 @@ static inline std::string &TrimRight(std::string &s, bool newlines = true)
{
if (!newlines)
{
- s.erase(std::find_if(s.rbegin(), s.rend(), std::not1(std::ptr_fun(Assimp::IsSpace<char>))).base(),s.end());
+ s.erase(std::find_if(s.rbegin(), s.rend(), [](char c) { return !Assimp::IsSpace<char>(c); }).base(),s.end());
}
else
{
- s.erase(s.begin(), std::find_if(s.begin(), s.end(), std::not1(std::ptr_fun(Assimp::IsSpaceOrNewLine<char>))));
+ s.erase(s.begin(), std::find_if(s.begin(), s.end(), [](char c) { return !Assimp::IsSpaceOrNewLine<char>(c); }));
}
return s;
}
diff --git a/src/3rdparty/patches/0007-Compile-with-Xcode-9.4.patch b/src/3rdparty/patches/0007-Compile-with-Xcode-9.4.patch
new file mode 100644
index 000000000..cc1fce421
--- /dev/null
+++ b/src/3rdparty/patches/0007-Compile-with-Xcode-9.4.patch
@@ -0,0 +1,93 @@
+diff -ur assimpGIT/code/BlenderModifier.cpp assimp/code/BlenderModifier.cpp
+--- assimpGIT/code/BlenderModifier.cpp 2018-07-19 13:49:03.000000000 +0200
++++ assimp/code/BlenderModifier.cpp 2018-07-19 13:49:40.000000000 +0200
+@@ -265,7 +265,7 @@
+
+ std::copy(out.mMeshes,out.mMeshes+out.mNumMeshes,nind);
+ std::transform(out.mMeshes,out.mMeshes+out.mNumMeshes,nind+out.mNumMeshes,
+- std::bind1st(std::plus< unsigned int >(),out.mNumMeshes));
++ [&out](unsigned int n) { return out.mNumMeshes + n; });
+
+ delete[] out.mMeshes;
+ out.mMeshes = nind;
+
+diff -ur assimpGIT/code/OgreParsingUtils.h assimp/code/OgreParsingUtils.h
+--- assimpGIT/code/OgreParsingUtils.h 2018-07-19 13:48:34.000000000 +0200
++++ assimp/code/OgreParsingUtils.h 2018-07-19 13:49:40.000000000 +0200
+@@ -90,11 +90,11 @@
+ {
+ if (!newlines)
+ {
+- s.erase(s.begin(), std::find_if(s.begin(), s.end(), std::not1(std::ptr_fun(Assimp::IsSpace<char>))));
++ s.erase(s.begin(), std::find_if(s.begin(), s.end(), [](char c) { return !Assimp::IsSpace<char>(c); }));
+ }
+ else
+ {
+- s.erase(s.begin(), std::find_if(s.begin(), s.end(), std::not1(std::ptr_fun(Assimp::IsSpaceOrNewLine<char>))));
++ s.erase(s.begin(), std::find_if(s.begin(), s.end(), [](char c) { return !Assimp::IsSpaceOrNewLine<char>(c); }));
+ }
+ return s;
+ }
+@@ -104,11 +104,11 @@
+ {
+ if (!newlines)
+ {
+- s.erase(std::find_if(s.rbegin(), s.rend(), std::not1(std::ptr_fun(Assimp::IsSpace<char>))).base(),s.end());
++ s.erase(std::find_if(s.rbegin(), s.rend(), [](char c) { return !Assimp::IsSpace<char>(c); }).base(),s.end());
+ }
+ else
+ {
+- s.erase(s.begin(), std::find_if(s.begin(), s.end(), std::not1(std::ptr_fun(Assimp::IsSpaceOrNewLine<char>))));
++ s.erase(s.begin(), std::find_if(s.begin(), s.end(), [](char c) { return !Assimp::IsSpaceOrNewLine<char>(c); }));
+ }
+ return s;
+ }
+
+diff -ur assimpGIT/code/LWOAnimation.cpp assimp/code/LWOAnimation.cpp
+--- assimpGIT/code/LWOAnimation.cpp 2018-07-19 13:48:40.000000000 +0200
++++ assimp/code/LWOAnimation.cpp 2018-07-19 13:49:40.000000000 +0200
+@@ -162,7 +162,7 @@
+ {
+ const double start_time = delta - fmod(my_first-first,delta);
+ std::vector<LWO::Key>::iterator n = std::find_if((*it).keys.begin(),(*it).keys.end(),
+- std::bind1st(std::greater<double>(),start_time)),m;
++ [start_time](double t) { return start_time > t; }),m;
+
+ size_t ofs = 0;
+ if (n != (*it).keys.end()) {
+
+diff -ru assimpGIT/code/FBXMeshGeometry.cpp assimp/code/FBXMeshGeometry.cpp
+--- assimpGIT/code/FBXMeshGeometry.cpp 2018-07-19 13:48:52.000000000 +0200
++++ assimp/code/FBXMeshGeometry.cpp 2018-07-19 13:49:40.000000000 +0200
+@@ -356,7 +356,7 @@
+ // avoids losing the material if there are more material layers
+ // coming of which at least one contains actual data (did observe
+ // that with one test file).
+- const size_t count_neg = std::count_if(temp_materials.begin(),temp_materials.end(),std::bind2nd(std::less<int>(),0));
++ const size_t count_neg = std::count_if(temp_materials.begin(),temp_materials.end(),[](int n) { return n < 0; });
+ if(count_neg == temp_materials.size()) {
+ FBXImporter::LogWarn("ignoring dummy material layer (all entries -1)");
+ return;
+
+
+diff -ru assimpGIT/code/FBXDocument.cpp assimp/code/FBXDocument.cpp
+--- assimpGIT/code/FBXDocument.cpp 2018-07-19 13:49:11.000000000 +0200
++++ assimp/code/FBXDocument.cpp 2018-07-19 13:49:40.000000000 +0200
+@@ -574,7 +574,7 @@
+ temp.push_back((*it).second);
+ }
+
+- std::sort(temp.begin(), temp.end(), std::mem_fun(&Connection::Compare));
++ std::sort(temp.begin(), temp.end(), std::mem_fn(&Connection::Compare));
+
+ return temp; // NRVO should handle this
+ }
+@@ -626,7 +626,7 @@
+ temp.push_back((*it).second);
+ }
+
+- std::sort(temp.begin(), temp.end(), std::mem_fun(&Connection::Compare));
++ std::sort(temp.begin(), temp.end(), std::mem_fn(&Connection::Compare));
+ return temp; // NRVO should handle this
+ }
+