X-Git-Url: https://pd.if.org/git/?p=pdclib;a=blobdiff_plain;f=internals%2F_PDCLIB_config.h;h=d2188ff112f8657124884bf3b54dd700138fa2ca;hp=753080ba25cee8780f50c90f8d59f0cd9c0ac56d;hb=744bbe0fcec2f59f755dd56fa59d8979f4253dfd;hpb=fcdedc037cdd1e5137ae38892a980257fab057f7 diff --git a/internals/_PDCLIB_config.h b/internals/_PDCLIB_config.h index 753080b..d2188ff 100644 --- a/internals/_PDCLIB_config.h +++ b/internals/_PDCLIB_config.h @@ -23,6 +23,11 @@ #define _PDCLIB_SUCCESS 0 #define _PDCLIB_FAILURE -1 +/* qsort() in requires a function that swaps two memory areas. */ +/* Below is a naive implementation that can be improved significantly for */ +/* specific platforms, e.g. by swapping int instead of char. */ +#define _PDCLIB_memswp( i, j, size ) char tmp; do { tmp = *i; *i++ = *j; *j++ = tmp; } while ( --size ); + /* -------------------------------------------------------------------------- */ /* Integers */ /* -------------------------------------------------------------------------- */