]> git.pld-linux.org Git - packages/perl.git/blame - Fix-GDBM_File-to-compile-with-version-1.20-and-earli.patch
- versioned Obsoletes
[packages/perl.git] / Fix-GDBM_File-to-compile-with-version-1.20-and-earli.patch
CommitLineData
45a5f076
JR
1From aacd2398e766500cb5d83c4d76b642fcf31d997a Mon Sep 17 00:00:00 2001
2From: Sergey Poznyakoff <gray@gnu.org>
3Date: Wed, 23 Jun 2021 10:26:50 +0300
4Subject: [PATCH 1/3] Fix GDBM_File to compile with version 1.20 and earlier
5
6* ext/GDBM_File/GDBM_File.xs (ITEM_NOT_FOUND): Define conditionally,
7depending on the GDBM_VERSION_MAJOR and GDBM_VERSION_MINOR.
8Don't assume GDBM_ITEM_NOT_FOUND is a define (it isn't since
9gdbm commit d3e27957).
10---
11 ext/GDBM_File/GDBM_File.xs | 11 +++++------
12 1 file changed, 5 insertions(+), 6 deletions(-)
13
14diff --git a/ext/GDBM_File/GDBM_File.xs b/ext/GDBM_File/GDBM_File.xs
15index cd0bb6f26f..494c2889ca 100644
16--- a/ext/GDBM_File/GDBM_File.xs
17+++ b/ext/GDBM_File/GDBM_File.xs
18@@ -145,14 +145,13 @@ output_datum(pTHX_ SV *arg, char *str, int size)
19 #define gdbm_setopt(db,optflag,optval,optlen) not_here("gdbm_setopt")
20 #endif
21
22-#ifndef GDBM_ITEM_NOT_FOUND
23-# define GDBM_ITEM_NOT_FOUND GDBM_NO_ERROR
24-#endif
25-
26+#if GDBM_VERSION_MAJOR == 1 && GDBM_VERSION_MINOR < 13
27 /* Prior to 1.13, gdbm_fetch family functions set gdbm_errno to GDBM_NO_ERROR
28 if the requested key did not exist */
29-#define ITEM_NOT_FOUND() \
30- (gdbm_errno == GDBM_ITEM_NOT_FOUND || gdbm_errno == GDBM_NO_ERROR)
31+# define ITEM_NOT_FOUND() (gdbm_errno == GDBM_NO_ERROR)
32+#else
33+# define ITEM_NOT_FOUND() (gdbm_errno == GDBM_ITEM_NOT_FOUND)
34+#endif
35
36 #define CHECKDB(db) do { \
37 if (!db->dbp) { \
38--
392.31.1
40
This page took 0.063319 seconds and 4 git commands to generate.