void-packages/srcpkgs/lshw/patches/musl-basename.patch
Jürgen Buchmüller 54900d99f5 lshw: unbreak musl
2016-05-07 05:42:01 +02:00

28 lines
714 B
Diff

For musl libc declare a macro version of basename(3).
--- src/core/dasd.cc 2016-05-07 05:33:49.580629923 +0200
+++ src/core/dasd.cc 2016-05-07 05:35:10.000625574 +0200
@@ -10,6 +10,10 @@
#include <linux/fs.h>
#include <map>
+#if !defined(__GLIBC__)
+#define basename(src) (strrchr(src,'/') ? strrchr(src,'/')+1 : src)
+#endif
+
using namespace std;
/*Read only block devices, not partitions*/
--- src/core/sysfs.cc 2016-05-07 05:36:45.771620396 +0200
+++ src/core/sysfs.cc 2016-05-07 05:37:33.265617827 +0200
@@ -19,6 +19,10 @@
__ID("@(#) $Id$");
+#if !defined(__GLIBC__)
+#define basename(src) (strrchr(src,'/') ? strrchr(src,'/')+1 : src)
+#endif
+
using namespace sysfs;
struct sysfs::entry_i