X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=internals%2F_PDCLIB_config.h;h=2fa66c79507dd347522b1bead42c55210300d1fe;hb=064097d5ed6eb8c2cfd337c29ac3ebc471e557b8;hp=753080ba25cee8780f50c90f8d59f0cd9c0ac56d;hpb=6da00d2f9ead7e732007fef0ae46c45523059f2d;p=pdclib diff --git a/internals/_PDCLIB_config.h b/internals/_PDCLIB_config.h index 753080b..2fa66c7 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 */ /* -------------------------------------------------------------------------- */ @@ -194,3 +199,12 @@ typedef char * _PDCLIB_va_list; #define _PDCLIB_va_copy( dest, src ) ( (dest) = (src), (void)0 ) #define _PDCLIB_va_end( ap ) ( (ap) = (void *)0, (void)0 ) #define _PDCLIB_va_start( ap, parmN ) ( (ap) = (char *) &parmN + ( _PDCLIB_va_round(parmN) ), (void)0 ) + +/* -------------------------------------------------------------------------- */ +/* OS "glue" */ +/* This is where PDCLib interfaces with the operating system. The examples */ +/* below are POSIX calls; provide your OS' equivalents. */ +/* -------------------------------------------------------------------------- */ + +/* A system call that terminates the calling process */ +#define _PDCLIB_Exit( x ) _exit( x )