From a5d93ddfe2e3afc18540fef4a1b7d6759b031ae9 Mon Sep 17 00:00:00 2001 From: solar Date: Sun, 4 Dec 2005 16:48:38 +0000 Subject: [PATCH] Added div_t types. --- internals/_PDCLIB_config.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) 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 */ -- 2.40.0