diff options
author | Felix Fietkau <nbd@openwrt.org> | 2016-01-12 11:15:34 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2016-01-12 11:15:34 +0000 |
commit | 9ab3a7c14270735308699b9c983034e34586de2a (patch) | |
tree | 6dc3bc058892c948bc0046e1c79e1c900b4994b4 /package/devel | |
parent | e64b031508d08894b68ee74b7ec68a19e1727494 (diff) | |
download | master-187ad058-9ab3a7c14270735308699b9c983034e34586de2a.tar.gz master-187ad058-9ab3a7c14270735308699b9c983034e34586de2a.tar.bz2 master-187ad058-9ab3a7c14270735308699b9c983034e34586de2a.zip |
perf: fix build errors on x86 and other platforms
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@48218 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/devel')
-rw-r--r-- | package/devel/perf/musl-compat.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/package/devel/perf/musl-compat.h b/package/devel/perf/musl-compat.h index ecfbec6a29..d0fa7810fa 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 |