diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2021-06-23 15:31:42 +0300 |
---|---|---|
committer | Steve Hay <steve.m.hay@googlemail.com> | 2022-03-05 11:26:11 +0000 |
commit | 69e00c95ee1b528119d71ada906b507e16aabaf2 (patch) | |
tree | c402fc9b7d3c1740ed9a1ac6fca6b96cce4f24ee | |
parent | 9bbcd29d17b12d74ae691e9499c0f88766144467 (diff) | |
download | perl-69e00c95ee1b528119d71ada906b507e16aabaf2.tar.gz |
Fix definition of ITEM_NOT_FOUND for pre-1.13 versions.
(cherry picked from commit 5bc1e5fdd87aa205011512cd1e6cc655bcf677fd)
-rw-r--r-- | ext/GDBM_File/GDBM_File.xs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/ext/GDBM_File/GDBM_File.xs b/ext/GDBM_File/GDBM_File.xs index 494c2889ca..0125b5dcac 100644 --- a/ext/GDBM_File/GDBM_File.xs +++ b/ext/GDBM_File/GDBM_File.xs @@ -145,10 +145,11 @@ output_datum(pTHX_ SV *arg, char *str, int size) #define gdbm_setopt(db,optflag,optval,optlen) not_here("gdbm_setopt") #endif -#if GDBM_VERSION_MAJOR == 1 && GDBM_VERSION_MINOR < 13 -/* Prior to 1.13, gdbm_fetch family functions set gdbm_errno to GDBM_NO_ERROR - if the requested key did not exist */ -# define ITEM_NOT_FOUND() (gdbm_errno == GDBM_NO_ERROR) +#if GDBM_VERSION_MAJOR == 1 && GDBM_VERSION_MINOR < 13 +/* Prior to 1.13, only gdbm_fetch set GDBM_ITEM_NOT_FOUND if the requested + key did not exist. Other similar function wouls set GDBM_NO_ERROR instead. + The GDBM_ITEM_NOT_FOUND existeds as early as in 1.7.3 */ +# define ITEM_NOT_FOUND() (gdbm_errno == GDBM_NO_ERROR || gdbm_errno == GDBM_ITEM_NOT_FOUND) #else # define ITEM_NOT_FOUND() (gdbm_errno == GDBM_ITEM_NOT_FOUND) #endif |