dev-libs/libuninum: fix incompatible pointer type

Closes: https://bugs.gentoo.org/920524
Signed-off-by: Conrad Kostecki <conikost@gentoo.org>
This commit is contained in:
Conrad Kostecki
2024-01-05 22:04:36 +01:00
parent 65c252213a
commit ba98e2ac86
3 changed files with 76 additions and 1 deletions

View File

@@ -0,0 +1,37 @@
--- libuninum-2.7.orig/uninum.c
+++ libuninum-2.7/uninum.c
@@ -35,11 +35,11 @@
*/
-#define ucslen(x) wcslen((signed long *) x)
-#define ucscpy(x,y) (UTF32 *)wcscpy((signed long *)x,(signed long *)y)
-#define ucscat(x,y) (UTF32 *)wcscat((signed long *)x,(signed long *)y)
-#define ucschr(x,y) (UTF32 *)wcschr((signed long *)x,(signed long)y)
-#define ucsrchr(x,y) (UTF32 *)wcsrchr((signed long *)x,(signed long)y)
+#define ucslen(x) wcslen((wchar_t *) x)
+#define ucscpy(x,y) (UTF32 *)wcscpy((wchar_t *)x,(wchar_t *)y)
+#define ucscat(x,y) (UTF32 *)wcscat((wchar_t *)x,(wchar_t *)y)
+#define ucschr(x,y) (UTF32 *)wcschr((wchar_t *)x,(wchar_t)y)
+#define ucsrchr(x,y) (UTF32 *)wcsrchr((wchar_t *)x,(wchar_t)y)
#define UNINUM
--- libuninum-2.7.orig/unicode.h
+++ libuninum-2.7/unicode.h
@@ -1,8 +1,10 @@
-typedef unsigned long UTF32; /* at least 32 bits */
-typedef unsigned short UTF16; /* at least 16 bits */
-typedef unsigned short UCS2; /* at least 16 bits */
-typedef unsigned char UTF8; /* 8 bits */
-typedef unsigned char Boolean; /* 0 or 1 */
+#include <stdint.h>
+
+typedef uint32_t UTF32; /* 32 bits */
+typedef uint16_t UTF16; /* 16 bits */
+typedef uint16_t UCS2; /* 16 bits */
+typedef uint8_t UTF8; /* 8 bits */
+typedef uint8_t Boolean; /* 0 or 1 */
#define UNI_MAX_ASCII (UTF32)0x0000007F
#define UNI_MAX_BMP (UTF32)0x0000FFFF

View File

@@ -0,0 +1,30 @@
Avoid an implicit declaration of exit in the configure script. This
ensures that the package continues to build with future compilers
which do not support such implicit declarations by default.
diff --git a/configure b/configure
index 8fd0eed37cb997de..f5ebc89db38d88f4 100755
--- a/configure
+++ b/configure
@@ -4323,8 +4323,8 @@ main ()
for (i = 0; i < 256; i++)
if (XOR (islower (i), ISLOWER (i))
|| toupper (i) != TOUPPER (i))
- exit(2);
- exit (0);
+ return 2;
+ return 0;
}
_ACEOF
rm -f conftest$ac_exeext
@@ -18747,8 +18747,8 @@ main ()
for (i = 0; i < 256; i++)
if (XOR (islower (i), ISLOWER (i))
|| toupper (i) != TOUPPER (i))
- exit(2);
- exit (0);
+ return 2;
+ return 0;
}
_ACEOF
rm -f conftest$ac_exeext

View File

@@ -1,4 +1,4 @@
# Copyright 1999-2023 Gentoo Authors
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
@@ -13,6 +13,14 @@ KEYWORDS="amd64 x86"
LICENSE="GPL-2 GPL-2+ LGPL-2 LGPL-2.1"
SLOT="0"
RDEPEND="dev-libs/gmp:="
DEPEND="${RDEPEND}"
PATCHES=(
"${FILESDIR}/${PN}-2.7-64bit.patch"
"${FILESDIR}/${PN}-2.7-c99.patch"
)
src_prepare() {
default