Signed-off-by: Felix Fietkau <nbd@openwrt.org>
SVN-Revision: 48221
prefix=/usr
ifdef CONFIG_USE_MUSL
- MAKE_FLAGS += EXTRA_CFLAGS="-include $(CURDIR)/musl-compat.h -D__UCLIBC__"
+ MAKE_FLAGS += EXTRA_CFLAGS="-I$(CURDIR)/musl-include -include $(CURDIR)/musl-compat.h -D__UCLIBC__"
endif
define Build/Compile
#ifndef __ASSEMBLER__
#include <sys/ioctl.h>
-#include <string.h>
#include <unistd.h>
#include <stdio.h>
#include <syscall.h>
#undef _IOC
#undef _IO
-/* Change XSI compliant version into GNU extension hackery */
-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
static inline long sysconf_wrap(int name)
--- /dev/null
+#ifndef __MUSL_COMPAT_STRING_H
+#define __MUSL_COMPAT_STRING_H
+
+#include_next <string.h>
+
+/* Change XSI compliant version into GNU extension hackery */
+static inline char *
+gnu_strerror_r(int err, char *buf, size_t buflen)
+{
+ if (strerror_r(err, buf, buflen))
+ return NULL;
+ return buf;
+}
+#ifdef _GNU_SOURCE
+#define strerror_r gnu_strerror_r
+#endif
+
+#endif