mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 07:07:34 +00:00
LibC: Add MIN, MAX and howmany macros to sys/param.h
This commit is contained in:
parent
89f9454785
commit
577b4c73b0
1 changed files with 13 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue