1 /* LibTomMath, multiple-precision integer library -- Tom St Denis */
2 /* SPDX-License-Identifier: Unlicense */
5 * This header defines custom types which
6 * are used in c89 mode.
8 * By default, the source uses stdbool.h
9 * and stdint.h. The command `make c89`
10 * can be used to convert the source,
11 * such that this header is used instead.
12 * Use `make c99` to convert back.
14 * Please adapt the following definitions to your needs!
17 /* stdbool.h replacement types */
18 typedef enum { MP_NO
, MP_YES
} mp_bool
;
20 /* stdint.h replacement types */
21 typedef __INT8_TYPE__ mp_i8
;
22 typedef __INT16_TYPE__ mp_i16
;
23 typedef __INT32_TYPE__ mp_i32
;
24 typedef __INT64_TYPE__ mp_i64
;
25 typedef __UINT8_TYPE__ mp_u8
;
26 typedef __UINT16_TYPE__ mp_u16
;
27 typedef __UINT32_TYPE__ mp_u32
;
28 typedef __UINT64_TYPE__ mp_u64
;
30 typedef __UINT64_TYPE__ mp_uintptr
;
32 typedef __UINT32_TYPE__ mp_uintptr
;
35 /* inttypes.h replacement, printf format specifier */
37 # define MP_PRI64_PREFIX "l"
39 # define MP_PRI64_PREFIX "ll"
41 #define MP_PRIi64 MP_PRI64_PREFIX "i"
42 #define MP_PRIu64 MP_PRI64_PREFIX "u"
43 #define MP_PRIx64 MP_PRI64_PREFIX "x"
44 #define MP_PRIo64 MP_PRI64_PREFIX "o"
46 #define MP_FUNCTION_NAME __func__