summaryrefslogtreecommitdiff
path: root/package/devel/perf
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2016-01-12 11:15:34 +0000
committerFelix Fietkau <nbd@openwrt.org>2016-01-12 11:15:34 +0000
commit10e6d3ade9f13306f637e88d0516cc49c261733d (patch)
treedf07ede3f963770d2c9b4a52ea7dbcfc92a94fc7 /package/devel/perf
parenta68d8a660a60aa0b0f4e0068ede44e5e07007b0e (diff)
downloadmtk-20170518-10e6d3ade9f13306f637e88d0516cc49c261733d.zip
mtk-20170518-10e6d3ade9f13306f637e88d0516cc49c261733d.tar.gz
mtk-20170518-10e6d3ade9f13306f637e88d0516cc49c261733d.tar.bz2
perf: fix build errors on x86 and other platforms
Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 48218
Diffstat (limited to 'package/devel/perf')
-rw-r--r--package/devel/perf/musl-compat.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/package/devel/perf/musl-compat.h b/package/devel/perf/musl-compat.h
index ecfbec6..d0fa781 100644
--- a/package/devel/perf/musl-compat.h
+++ b/package/devel/perf/musl-compat.h
@@ -1,6 +1,8 @@
#ifndef __PERF_MUSL_COMPAT_H
#define __PERF_MUSL_COMPAT_H
+#ifndef __ASSEMBLER__
+
#include <sys/ioctl.h>
#include <string.h>
#include <unistd.h>
@@ -15,8 +17,14 @@
#undef _IO
/* Change XSI compliant version into GNU extension hackery */
-#define strerror_r(err, buf, buflen) \
- (strerror_r(err, buf, buflen) ? NULL : buf)
+static inline char *
+gnu_strerror_r(int err, char *buf, size_t buflen)
+{
+ if (strerror_r(err, buf, buflen))
+ return NULL;
+ return buf;
+}
+#define strerror_r gnu_strerror_r
#define _SC_LEVEL1_DCACHE_LINESIZE -1
@@ -60,3 +68,4 @@ static inline int compat_sched_getcpu(void)
#define sched_getcpu compat_sched_getcpu
#endif
+#endif