X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=functions%2Fstdlib%2Fqsort.c;h=582d1f9313acfd8da8240b93f052314460d4a7d6;hb=d7154dc8cd1b7d41d0d956b7310e59d794f1a59f;hp=b654c309ccae1493aaf87efc0aaecd4a231555cd;hpb=b1fc26afebd4d557ff89a44bc21767a8704c3809;p=pdclib diff --git a/functions/stdlib/qsort.c b/functions/stdlib/qsort.c index b654c30..582d1f9 100644 --- a/functions/stdlib/qsort.c +++ b/functions/stdlib/qsort.c @@ -33,7 +33,7 @@ static inline void memswp( char * i, char * j, size_t size ) #define PUSH( base, limit ) stackptr[0] = base; stackptr[1] = limit; stackptr += 2 #define POP( base, limit ) stackptr -= 2; base = stackptr[0]; limit = stackptr[1] /* TODO: Stack usage is log2( nmemb ) (minus what T shaves off the worst case). - Worst-case nmemb is platform dependent and should probably be + Worst-case nmemb is platform dependent and should probably be configured through _PDCLIB_config.h. */ #define STACKSIZE 64 @@ -128,7 +128,9 @@ void qsort( void * base, size_t nmemb, size_t size, int (*compar)( const void *, #endif #ifdef TEST -#include <_PDCLIB_test.h> + +#include "_PDCLIB_test.h" + #include #include @@ -152,7 +154,7 @@ int main( void ) strcpy( s, presort ); qsort( s, 1, 1, compare ); TESTCASE( strcmp( s, presort ) == 0 ); -#if __BSD_VISIBLE +#if defined( REGTEST ) && ( defined( __BSD_VISIBLE ) || defined( __APPLE__ ) ) puts( "qsort.c: Skipping test #4 for BSD as it goes into endless loop here." ); #else qsort( s, 100, 0, compare );