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
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2014-06-24 22:01:38 +0400
committerCampbell Barton <ideasman42@gmail.com>2014-06-24 22:04:52 +0400
commitdf1c400420b39506e38745bb0db3d4f9797de424 (patch)
tree11ffd31924f8b69f6149c55e89a76819b1eceb52 /source/blender/blenlib/intern/sort.c
parent04648767fabda7d9461e32c89afcd806d0227547 (diff)
Use gnu-libc arg order for BLI_sort_r
When building on gnu-libc don't use our own implementation.
Diffstat (limited to 'source/blender/blenlib/intern/sort.c')
-rw-r--r--source/blender/blenlib/intern/sort.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/blenlib/intern/sort.c b/source/blender/blenlib/intern/sort.c
index a1b7296feb6..991337446cf 100644
--- a/source/blender/blenlib/intern/sort.c
+++ b/source/blender/blenlib/intern/sort.c
@@ -32,10 +32,13 @@
#include <stdlib.h>
+#ifndef __GLIBC__
+
#include "BLI_utildefines.h"
#include "BLI_sort.h"
+/* note: modified to use glibc arg order for callback */
/* **** qsort based on FreeBSD source (libkern\qsort.c) **** */
BLI_INLINE char *med3(char *, char *, char *, BLI_sort_cmp_t, void *);
BLI_INLINE void swapfunc(char *, char *, int, int);
@@ -72,7 +75,7 @@ BLI_INLINE void swapfunc(char *a, char *b, int n, int swaptype)
swapfunc(a, b, es, swaptype)
#define vecswap(a, b, n) if ((n) > 0) swapfunc(a, b, n, swaptype)
-#define CMP(t, x, y) (cmp((t), (x), (y)))
+#define CMP(t, x, y) (cmp((x), (y), (t)))
BLI_INLINE char *med3(char *a, char *b, char *c, BLI_sort_cmp_t cmp, void *thunk)
{
@@ -171,3 +174,5 @@ loop:
goto loop;
}
}
+
+#endif /* __GLIBC__ */