Imported Upstream version 0.7.20
[platform/upstream/libsolv.git] / src / qsort_r.c
index f264ed0..ffc09dc 100644 (file)
@@ -37,7 +37,9 @@
 #if defined(LIBC_SCCS) && !defined(lint)
 static char sccsid[] = "@(#)qsort.c    8.1 (Berkeley) 6/4/93";
 #endif /* LIBC_SCCS and not lint */
+#ifndef _WIN32
 #include <sys/cdefs.h>
+#endif
 
 /* $FreeBSD: src/lib/libc/stdlib/qsort.c,v 1.13.2.1.8.1 2010/12/21 17:10:29 kensmith Exp $ */
 
@@ -47,7 +49,9 @@ typedef int            cmp_t(const void *, const void *, void *);
 static inline char     *med3(char *, char *, char *, cmp_t *, void *);
 static inline void      swapfunc(char *, char *, int, int);
 
+#ifndef min
 #define min(a, b)      (a) < (b) ? a : b
+#endif
 
 /*
  * Qsort routine from Bentley & McIlroy's "Engineering a Sort Function".