summaryrefslogtreecommitdiff
path: root/src/macros.h
diff options
context:
space:
mode:
authorRichard Braun <rbraun@sceen.net>2025-05-07 22:19:05 +0200
committerRichard Braun <rbraun@sceen.net>2025-05-07 22:19:05 +0200
commitf3aa771a8d1416b57e1580833bbfb2914b790582 (patch)
treee4b08d671baa48e7107f88e9aa0112a7ec8011fa /src/macros.h
parent6a6d994cc469328fd03516ac897f850eb277f7db (diff)
Fix spawning position
Diffstat (limited to 'src/macros.h')
-rw-r--r--src/macros.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/macros.h b/src/macros.h
index 58cdca2..422bb8b 100644
--- a/src/macros.h
+++ b/src/macros.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2024 Richard Braun.
+ * Copyright (c) 2024-2025 Richard Braun.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted.
@@ -19,7 +19,9 @@
#ifndef MACROS_H
#define MACROS_H
-#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
+#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
+
+#define DIV_CEIL(n, d) (((n) + (d) - 1) / (d))
#define structof(ptr, type, member) \
((type *)((char *)(ptr) - offsetof(type, member)))