Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/extern
diff options
context:
space:
mode:
authorAntony Riakiotakis <kalast@gmail.com>2011-09-13 23:51:58 +0400
committerAntony Riakiotakis <kalast@gmail.com>2011-09-13 23:51:58 +0400
commit8a977cbcc90f870acdb8c03366bfc2c35f4a0a6f (patch)
tree3e73dabf917147929e302c0204b958d5dba13bf6 /extern
parent7548333b55253b3ff79da2d3f0be5d6858aabaa0 (diff)
fix compilation for MinGW by substituting qsort_r with qsort. What aversion do MinGW guys have for including '_r' variants of functions anyway?
Warning: a clean build will be needed probably to account for recent merge changes, or link errors will occur.
Diffstat (limited to 'extern')
-rw-r--r--extern/recastnavigation/Recast/Source/RecastMeshDetail.cpp19
1 files changed, 18 insertions, 1 deletions
diff --git a/extern/recastnavigation/Recast/Source/RecastMeshDetail.cpp b/extern/recastnavigation/Recast/Source/RecastMeshDetail.cpp
index dab94eaa775..f1d2113a8c7 100644
--- a/extern/recastnavigation/Recast/Source/RecastMeshDetail.cpp
+++ b/extern/recastnavigation/Recast/Source/RecastMeshDetail.cpp
@@ -94,7 +94,20 @@ static int circumCircle(const float xp, const float yp,
return (drsqr <= rsqr) ? 1 : 0;
}
-
+#ifdef FREE_WINDOWS
+static float *_mingw_verts;
+static int ptcmp(const void *v1, const void *v2)
+{
+ const float* p1 = &_mingw_verts[(*(const int*)v1)*3];
+ const float* p2 = &_mingw_verts[(*(const int*)v2)*3];
+ if (p1[0] < p2[0])
+ return -1;
+ else if (p1[0] > p2[0])
+ return 1;
+ else
+ return 0;
+}
+#else
#if defined(_MSC_VER)
static int ptcmp(void* up, const void *v1, const void *v2)
#elif defined(__APPLE__) || defined(__FreeBSD__)
@@ -113,6 +126,7 @@ static int ptcmp(const void *v1, const void *v2, void* up)
else
return 0;
}
+#endif
// Based on Paul Bourke's triangulate.c
// http://astronomy.swin.edu.au/~pbourke/terrain/triangulate/triangulate.c
@@ -126,6 +140,9 @@ static void delaunay(const int nv, float *verts, rcIntArray& idx, rcIntArray& tr
qsort_s(&idx[0], idx.size(), sizeof(int), ptcmp, verts);
#elif defined(__APPLE__) || defined(__FreeBSD__)
qsort_r(&idx[0], idx.size(), sizeof(int), verts, ptcmp);
+#elif defined(FREE_WINDOWS)
+ _mingw_verts = verts;
+ qsort(&idx[0], idx.size(), sizeof(int), ptcmp);
#else
qsort_r(&idx[0], idx.size(), sizeof(int), ptcmp, verts);
#endif