summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibC/sys
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2022-04-29 20:29:05 +0200
committerAndreas Kling <kling@serenityos.org>2022-04-29 22:01:27 +0200
commit577b4c73b0ae4dd9163be483de0b50d9d468c690 (patch)
treec5e8b1e5b6f29c33cc7dbf364f11165b9e4d77de /Userland/Libraries/LibC/sys
parent89f94547856717028cbe4f59ebfc74386d74e555 (diff)
downloadserenity-577b4c73b0ae4dd9163be483de0b50d9d468c690.zip
LibC: Add MIN, MAX and howmany macros to sys/param.h
Diffstat (limited to 'Userland/Libraries/LibC/sys')
-rw-r--r--Userland/Libraries/LibC/sys/param.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/Userland/Libraries/LibC/sys/param.h b/Userland/Libraries/LibC/sys/param.h
index 52c24437d2..319b7f0f76 100644
--- a/Userland/Libraries/LibC/sys/param.h
+++ b/Userland/Libraries/LibC/sys/param.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
+ * Copyright (c) 2018-2022, Andreas Kling <kling@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@@ -8,3 +8,15 @@
#include <endian.h>
#include <limits.h>
+
+#ifndef MIN
+# define MIN(a, b) (((a) < (b)) ? (a) : (b))
+#endif
+
+#ifndef MAX
+# define MAX(a, b) (((a) > (b)) ? (a) : (b))
+#endif
+
+#ifndef howmany
+# define howmany(x, y) (((x) + ((y)-1)) / (y))
+#endif