]> pd.if.org Git - pdclib/commitdiff
Added div_t types.
authorsolar <unknown>
Sun, 4 Dec 2005 16:48:38 +0000 (16:48 +0000)
committersolar <unknown>
Sun, 4 Dec 2005 16:48:38 +0000 (16:48 +0000)
internals/_PDCLIB_config.h

index 49afceeb2050b5c2eb8a57f569d58181e83a80a1..5e22b527478bbe20d4fc9f2501b450497b3afbb3 100644 (file)
 #define _PDCLIB_LONG_BYTES  4
 #define _PDCLIB_LLONG_BYTES 8
 
+/* <stdlib.h> 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;
+};
+
 /* -------------------------------------------------------------------------- */
 /* <stdint.h> 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 */