dev-libs/chmlib: fix w/ clang 16

Closes: https://bugs.gentoo.org/871177
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Sam James
2023-04-22 17:53:17 +01:00
parent 8c4b2ca299
commit d60d0beb9b
2 changed files with 26 additions and 1 deletions

View File

@@ -1,4 +1,4 @@
# Copyright 1999-2021 Gentoo Authors
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
@@ -17,6 +17,7 @@ IUSE="+examples static-libs"
PATCHES=(
"${FILESDIR}"/${PN}-0.39-stdtypes.patch
"${FILESDIR}"/${P}-headers.patch
"${FILESDIR}"/${P}-clang16.patch
)
src_prepare() {

View File

@@ -0,0 +1,24 @@
https://bugs.gentoo.org/871177
https://github.com/jedwing/CHMLib/pull/17
From 5877959e3eb9a54e131608c52e2d6f4c89bc0189 Mon Sep 17 00:00:00 2001
From: Florian Weimer <fweimer@redhat.com>
Date: Wed, 19 Apr 2023 09:47:03 +0200
Subject: [PATCH] Avoid implicit function declarations, for C99 compatibility
Define _LARGEFILE64_SOURCE so that <unistd.h> defines pread64.
This avoids build failures with future compilers which do not
support implicit function declarations by default.
--- a/src/chm_lib.c
+++ b/src/chm_lib.c
@@ -48,6 +48,8 @@
* *
***************************************************************************/
+#define _LARGEFILE64_SOURCE /* for pread64 */
+
#include "chm_lib.h"
#ifdef CHM_MT