summaryrefslogtreecommitdiff
path: root/src/libk/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/libk/include')
-rw-r--r--src/libk/include/assert.h9
-rw-r--r--src/libk/include/camellia/errno.h3
2 files changed, 10 insertions, 2 deletions
diff --git a/src/libk/include/assert.h b/src/libk/include/assert.h
index 7520aa9..affe1dc 100644
--- a/src/libk/include/assert.h
+++ b/src/libk/include/assert.h
@@ -1,7 +1,12 @@
#ifdef NDEBUG
-#define assert(stmt) do {} while (0)
+#define assert(stmt) ((void)0)
#else
-#define assert(stmt) do { if (!(stmt)) __badassert(__func__, __FILE__, __LINE__); } while (0)
+#define assert(stmt) (void)((stmt) || (__badassert(__func__, __FILE__, __LINE__),0))
+#endif
+
+#ifdef __SPARSE
+#undef assert
+#define assert(stmt) (0)
#endif
_Noreturn void __badassert(const char *func, const char *file, int line);
diff --git a/src/libk/include/camellia/errno.h b/src/libk/include/camellia/errno.h
index 1177f54..e148b40 100644
--- a/src/libk/include/camellia/errno.h
+++ b/src/libk/include/camellia/errno.h
@@ -26,3 +26,6 @@
#define EWOULDBLOCK 206
#define EEXIST 207
#define EAGAIN 208
+#define EIO 209
+#define EDOM 210 /* domain error */
+#define EFBIG 211 /* file too large */