From: solar Date: Sun, 4 Dec 2005 16:48:38 +0000 (+0000) Subject: Added div_t types. X-Git-Tag: v0.4~45 X-Git-Url: https://pd.if.org/git/?p=pdclib;a=commitdiff_plain;h=a5d93ddfe2e3afc18540fef4a1b7d6759b031ae9 Added div_t types. --- diff --git a/internals/_PDCLIB_config.h b/internals/_PDCLIB_config.h index 49afcee..5e22b52 100644 --- a/internals/_PDCLIB_config.h +++ b/internals/_PDCLIB_config.h @@ -39,6 +39,30 @@ #define _PDCLIB_LONG_BYTES 4 #define _PDCLIB_LLONG_BYTES 8 +/* defines the div() function family that allows taking quotient */ +/* and remainder of an integer division in one operation. Many platforms */ +/* support this in hardware / opcode, and the standard permits ordering of */ +/* the return structure in any way to fit the hardware. That is why those */ +/* structs can be configured here. */ + +struct _PDCLIB_div_t +{ + int quot; + int rem; +}; + +struct _PDCLIB_ldiv_t +{ + long int quot; + long int rem; +}; + +struct _PDCLIB_lldiv_t +{ + long long int quot; + long long int rem; +}; + /* -------------------------------------------------------------------------- */ /* defines a set of integer types that are of a minimum width, and */ /* "usually fastest" on the system. (If, for example, accessing a single char */