aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2021-08-30 16:40:48 +0300
committerKimplul <kimi.h.kuparinen@gmail.com>2021-08-30 16:40:48 +0300
commit2939b749b1169a0c01c19698a3f0026034346ebd (patch)
tree827664edbdbb91a7be5eb038bebf5d81bb583215 /include
parent07af47eca912f3b56f013749a268718d78656961 (diff)
downloadkmi-2939b749b1169a0c01c19698a3f0026034346ebd.tar.gz
kmi-2939b749b1169a0c01c19698a3f0026034346ebd.zip
Initial formatted debug output
+ Mostly follows the POSIX printf, with the exceptions of no floating points and `X` signifies binary instead of uppercase hex
Diffstat (limited to 'include')
-rw-r--r--include/apos/bits.h8
-rw-r--r--include/apos/types.h5
2 files changed, 12 insertions, 1 deletions
diff --git a/include/apos/bits.h b/include/apos/bits.h
new file mode 100644
index 0000000..77bdde4
--- /dev/null
+++ b/include/apos/bits.h
@@ -0,0 +1,8 @@
+#ifndef APOS_BITS_H
+#define APOS_BITS_H
+
+#define __is_set(x, y) ((x) & (y))
+#define __set_bit(x, y) ((x) |= (y))
+#define __clear_bit(x, y) ((x) &= ~(y))
+
+#endif /* APOS_BITS_H */
diff --git a/include/apos/types.h b/include/apos/types.h
index 04afd4c..f63857b 100644
--- a/include/apos/types.h
+++ b/include/apos/types.h
@@ -5,7 +5,6 @@ typedef _Bool bool;
#define true 1
#define false 0
-typedef __SIZE_TYPE__ size_t;
typedef __PTRDIFF_TYPE__ ptrdiff_t;
typedef __WCHAR_TYPE__ wchar_t;
typedef __WINT_TYPE__ wint_t;
@@ -39,6 +38,10 @@ typedef __UINT_FAST64_TYPE__ uint_fast64_t;
typedef __INTPTR_TYPE__ intptr_t;
typedef __UINTPTR_TYPE__ uintptr_t;
+/* sort of unconventional, but should be fine */
+typedef uintmax_t size_t;
+typedef intmax_t ssize_t;
+
#define INT8_C __INT8_C
#define INT16_C __INT16_C
#define INT32_C __INT32_C