dev-perl/Bit-Vector: fix build w/ C23

Closes: https://bugs.gentoo.org/944355
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Sam James
2025-05-26 08:57:15 +01:00
parent 640054173a
commit 10708b8f34
2 changed files with 57 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
DIST_AUTHOR=STBEY
DIST_VERSION=7.4
inherit perl-module
DESCRIPTION="Efficient bit vector, set of integers and big int math library"
# License note: upstream mess, bug #721222, upstream is fine with "perl"
# https://rt.cpan.org/Public/Bug/Display.html?id=132512
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~m68k ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x64-solaris"
RDEPEND="
>=dev-perl/Carp-Clan-5.300.0
>=virtual/perl-Storable-2.210.0
"
BDEPEND="
${RDEPEND}
virtual/perl-ExtUtils-MakeMaker
"
PATCHES=(
"${FILESDIR}"/${PN}-7.400.0-c23.patch
)

View File

@@ -0,0 +1,28 @@
https://bugs.gentoo.org/944355
https://rt.cpan.org/Public/Bug/Display.html?id=165142
--- a/ToolBox.h
+++ b/ToolBox.h
@@ -93,10 +93,19 @@ typedef Z_longword *Z_longwordp
#elif PERL_DARWIN
#define boolean bool
#else
- typedef int boolean;
- #ifndef I_STDBOOL
- enum { false, true };
- #endif
+ typedef int boolean;
+ #ifndef I_STDBOOL
+ #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+ #include <stdbool.h>
+ #else
+ #ifndef false
+ #define false 0
+ #endif
+ #ifndef true
+ #define true 1
+ #endif
+ #endif
+ #endif
#endif
#endif