]> git.ozlabs.org Git - ccan/commitdiff
asort: Remove the trampoline version.
authorAndreas Schlick <schlick@lavabit.com>
Sat, 2 Apr 2011 01:30:36 +0000 (12:00 +1030)
committerRusty Russell <rusty@rustcorp.com.au>
Sat, 2 Apr 2011 01:30:36 +0000 (12:00 +1030)
Most Linux systems use glibc and therefore have qsort_r() and for the others an
implementation is provided, therefore there is no need to have a third case in
asort.

ccan/asort/asort.c

index f5ed8f863f6f400cdcbb72217146a9387c52a6eb..e7eaf2c2999b68a3f0f6ea9d3b300f59df38ffc7 100644 (file)
@@ -3,21 +3,6 @@
 
 #if !HAVE_QSORT_R_PRIVATE_LAST
 
 
 #if !HAVE_QSORT_R_PRIVATE_LAST
 
-#if HAVE_NESTED_FUNCTIONS
-void _asort(void *base, size_t nmemb, size_t size,
-           int(*compar)(const void *, const void *, void *ctx),
-           void *ctx)
-{
-       /* This gives bogus "warning: no previous prototype for ‘cmp’"
-        * with gcc 4 with -Wmissing-prototypes.  Hence the auto crap. */
-       auto int cmp(const void *a, const void *b);
-       int cmp(const void *a, const void *b)
-       {
-               return compar(a, b, ctx);
-       }
-       qsort(base, nmemb, size, cmp);
-}
-#else
 /* Steal glibc's code. */
 
 /* Copyright (C) 1991,1992,1996,1997,1999,2004 Free Software Foundation, Inc.
 /* Steal glibc's code. */
 
 /* Copyright (C) 1991,1992,1996,1997,1999,2004 Free Software Foundation, Inc.
@@ -270,6 +255,5 @@ _asort (void *const pbase, size_t total_elems, size_t size,
       }
   }
 }
       }
   }
 }
-#endif /* !HAVE_NESTED_FUNCTIONS */
 
 #endif /* !HAVE_QSORT_R_PRIVATE_LAST */
 
 #endif /* !HAVE_QSORT_R_PRIVATE_LAST */