This is the mail archive of the
elfutils-devel@sourceware.org
mailing list for the elfutils project.
[PATCH] Define roundup() for strings.c if it doesn't exist
- From: Ulf Hermann <ulf dot hermann at qt dot io>
- To: <elfutils-devel at sourceware dot org>
- Date: Thu, 4 May 2017 11:38:17 +0200
- Subject: [PATCH] Define roundup() for strings.c if it doesn't exist
- Authentication-results: sourceware.org; auth=none
- Authentication-results: sourceware.org; dkim=none (message not signed) header.d=none;sourceware.org; dmarc=none action=none header.from=qt.io;
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qtcompany.onmicrosoft.com; s=selector1-qt-io; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=3mihmHuktSjP1sF+eKzIgrubiqNZtg2nU0Eq+Lix0X4=; b=B3G9vvGJPf975wFeO4qm4Xz4oLKonFft8XRtlT1apDQ8zOsIQwSHf/wvWEhiKmjCtBd2Qt9QVgDRtNnONm1uGRGmr7zcpDgp6bjOy8eagk/D6aPJMyjPd0ZnpYrc0GCiEGHnHDLO5AY+6hkKxyqatJEhHVmxlcny8mDnDIqrbX0=
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
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