sys-apps/isapnptools: fix compile on musl

Copied this patch from ::musl overlay (whose origin is unknown
since it appeared as part of initial commit in that repo).

The change itself consists of 2 fixes:

1. Adding "#include <stdlib.h>" which is safe
2. converting conditional include into consistent "#include <sys/io.h>"
   which should work on all libc we care about in Gentoo.

I don't see a reason to cause rebuild with this patch, since where it
managed to build work as needed, so no need for revbump.

Closes: https://bugs.gentoo.org/712764
Closes: https://bugs.gentoo.org/889557
Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
This commit is contained in:
Arthur Zamarin 2025-10-05 22:56:18 +03:00
parent 7596e0d157
commit 474f171b5d
No known key found for this signature in database
GPG Key ID: 02A0AF503D120504
2 changed files with 31 additions and 0 deletions

View File

@ -0,0 +1,30 @@
--- a/include/isapnp/iopl.h
+++ b/include/isapnp/iopl.h
@@ -52,15 +52,7 @@ extern "C" {
#include <dos.h>
#else
#ifndef _OS2_
-# if defined __GLIBC__ && __GLIBC__ >= 2
-# include <sys/io.h>
-# else
-# ifdef _AXP_
-# include <sys/io.h>
-# else
-# include <asm/io.h>
-# endif
-# endif /* __GLIBC__ */
+#include <sys/io.h>
#else
#include <sys/hw.h>
#endif /* _OS2_ */
--- a/src/pnp-select.c
+++ b/src/pnp-select.c
@@ -6,6 +6,8 @@
Foundation.
*/
+#include <stdlib.h>
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

View File

@ -17,6 +17,7 @@ PATCHES=(
"${FILESDIR}"/${P}-include.patch
"${FILESDIR}"/${P}-fno-common.patch
"${FILESDIR}"/${P}-incompatible-pointer-types.patch
"${FILESDIR}"/${P}-musl.patch
)
src_configure() {