strace/SOURCES/0028-macros-add-ROUNDUP-macro.patch
2021-09-10 04:55:48 +00:00

26 lines
817 B
Diff

From cbbf708b4d2f8a66b07cf805f82edbe892c0bbf7 Mon Sep 17 00:00:00 2001
From: Eugene Syromyatnikov <evgsyr@gmail.com>
Date: Sun, 2 Sep 2018 18:15:40 +0200
Subject: [PATCH] macros: add ROUNDUP macro
* macros.h (ROUNDUP): New macro.
---
macros.h | 4 ++++
1 file changed, 4 insertions(+)
Index: strace-4.24/macros.h
===================================================================
--- strace-4.24.orig/macros.h 2019-08-01 18:40:47.322659137 +0200
+++ strace-4.24/macros.h 2019-08-01 19:49:00.405972298 +0200
@@ -28,6 +28,10 @@
#endif
#define CLAMP(val, min, max) MIN(MAX(min, val), max)
+#ifndef ROUNDUP
+# define ROUNDUP(val_, div_) ((((val_) + (div_) - 1) / (div_)) * (div_))
+#endif
+
#ifndef offsetofend
# define offsetofend(type_, member_) \
(offsetof(type_, member_) + sizeof(((type_ *)0)->member_))