]>
Commit | Line | Data |
---|---|---|
45a5f076 JR |
1 | From 5bc1e5fdd87aa205011512cd1e6cc655bcf677fd Mon Sep 17 00:00:00 2001 |
2 | From: Sergey Poznyakoff <gray@gnu.org> | |
3 | Date: Wed, 23 Jun 2021 15:31:42 +0300 | |
4 | Subject: [PATCH 3/3] Fix definition of ITEM_NOT_FOUND for pre-1.13 versions. | |
5 | ||
6 | --- | |
7 | ext/GDBM_File/GDBM_File.xs | 9 +++++---- | |
8 | 1 file changed, 5 insertions(+), 4 deletions(-) | |
9 | ||
10 | diff --git a/ext/GDBM_File/GDBM_File.xs b/ext/GDBM_File/GDBM_File.xs | |
11 | index 494c2889ca..0125b5dcac 100644 | |
12 | --- a/ext/GDBM_File/GDBM_File.xs | |
13 | +++ b/ext/GDBM_File/GDBM_File.xs | |
14 | @@ -145,10 +145,11 @@ output_datum(pTHX_ SV *arg, char *str, int size) | |
15 | #define gdbm_setopt(db,optflag,optval,optlen) not_here("gdbm_setopt") | |
16 | #endif | |
17 | ||
18 | -#if GDBM_VERSION_MAJOR == 1 && GDBM_VERSION_MINOR < 13 | |
19 | -/* Prior to 1.13, gdbm_fetch family functions set gdbm_errno to GDBM_NO_ERROR | |
20 | - if the requested key did not exist */ | |
21 | -# define ITEM_NOT_FOUND() (gdbm_errno == GDBM_NO_ERROR) | |
22 | +#if GDBM_VERSION_MAJOR == 1 && GDBM_VERSION_MINOR < 13 | |
23 | +/* Prior to 1.13, only gdbm_fetch set GDBM_ITEM_NOT_FOUND if the requested | |
24 | + key did not exist. Other similar functions would set GDBM_NO_ERROR instead. | |
25 | + The GDBM_ITEM_NOT_FOUND existed as early as in 1.7.3 */ | |
26 | +# define ITEM_NOT_FOUND() (gdbm_errno == GDBM_NO_ERROR || gdbm_errno == GDBM_ITEM_NOT_FOUND) | |
27 | #else | |
28 | # define ITEM_NOT_FOUND() (gdbm_errno == GDBM_ITEM_NOT_FOUND) | |
29 | #endif | |
30 | -- | |
31 | 2.31.1 | |
32 |