* [PATCH] Define roundup() for strings.c if it doesn't exist
@ 2017-05-04 9:57 Ulf Hermann
0 siblings, 0 replies; only message in thread
From: Ulf Hermann @ 2017-05-04 9:57 UTC (permalink / raw)
To: elfutils-devel
Change-Id: I6ea7c1f894e89bbaaecb724473c4c00e67296f05
Signed-off-by: Ulf Hermann <ulf.hermann@qt.io>
---
src/ChangeLog | 4 ++++
src/strings.c | 3 +++
2 files changed, 7 insertions(+)
diff --git a/src/ChangeLog b/src/ChangeLog
index 64db1ca..4a32604 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,7 @@
+2017-05-04 Ulf Hermann <ulf.hermann@qt.io>
+
+ * strings.c: If roundup() is not defined, define it.
+
2017-04-28 Ulf Hermann <ulf.hermann@qt.io>
* Makefile.am: Use the predefined names for libelf, libdw, libasm,
diff --git a/src/strings.c b/src/strings.c
index d214356..22cbfac 100644
--- a/src/strings.c
+++ b/src/strings.c
@@ -450,6 +450,9 @@ process_chunk (const char *fname, const unsigned char *buf, off_t to,
*unprinted = xstrndup ((const char *) start, curlen);
}
+#ifndef roundup
+#define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y))
+#endif
/* Map a file in as large chunks as possible. */
static void *
--
2.1.4
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-05-04 9:38 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-04 9:57 [PATCH] Define roundup() for strings.c if it doesn't exist Ulf Hermann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).