From: Jerome St-Louis Date: Wed, 21 Dec 2016 03:48:31 +0000 (-0500) Subject: ecere/com/Array: Remove dependency on qsort_s for static Windows builds X-Git-Url: https://ecere.com/cgi-bin/gitweb.cgi?p=sdk;a=commitdiff_plain;h=7dff7d9c1c2912c81433e58a9036317e0b92036d ecere/com/Array: Remove dependency on qsort_s for static Windows builds - Was missing from stock Windows XP / WSMS system --- diff --git a/ecere/src/com/containers/Array.ec b/ecere/src/com/containers/Array.ec index 096bde3..b2c8cc8 100644 --- a/ecere/src/com/containers/Array.ec +++ b/ecere/src/com/containers/Array.ec @@ -18,7 +18,7 @@ extern int __ecereVMethodID_class_OnCompare; #define BSD extern void qsort_r(void *base, uintsize nel, uintsize width, void *arg, int (*compare)(void *, const void *, const void *)); #elif defined(__WIN32__) - extern void qsort_s(void *base, uintsize nel, uintsize width, int (*compare)(void *, const void *, const void *), void * arg); + __declspec(dllimport) __cdecl extern void qsort_s(void *base, uintsize nel, uintsize width, int (*compare)(void *, const void *, const void *), void * arg); #elif (defined __GLIBC__ && ((__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 8))) #define GLIBC extern void qsort_r(void *base, uintsize nel, uintsize width, int(* compare)(const void *, const void *, void *), void *arg); @@ -107,7 +107,7 @@ static inline void _qsortrx(void *base, uintsize nel, uintsize width, { #if defined(BSD) && !defined(ECERE_BOOTSTRAP) qsort_r(base, nel, width, arg, compare); - #elif defined(__WIN32__) && !defined(ECERE_BOOTSTRAP) + #elif defined(__WIN32__) && !defined(ECERE_BOOTSTRAP) && !defined(ECERE_STATIC) qsort_s(base, nel, width, compare, arg); #else { @@ -123,7 +123,7 @@ static inline void _qsortrx(void *base, uintsize nel, uintsize width, #define compare_fn !deref ? compareDesc : ascending ? compareDeref : compareDescDeref #if defined(BSD) && !defined(ECERE_BOOTSTRAP) qsort_r(base, nel, width, s, compare_fn); - #elif defined(__WIN32__) && !defined(ECERE_BOOTSTRAP) + #elif defined(__WIN32__) && !defined(ECERE_BOOTSTRAP) && !defined(ECERE_STATIC) qsort_s(base, nel, width, compare_fn, s); #else {