This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
DB_File 1.70
authorPaul Marquess <paul.marquess@btinternet.com>
Wed, 4 Aug 1999 23:22:22 +0000 (00:22 +0100)
committerJarkko Hietaniemi <jhi@iki.fi>
Thu, 5 Aug 1999 08:05:13 +0000 (08:05 +0000)
To: perl5-porters@perl.org
Cc: gsar@activestate.com, nik@tiuk.ti.com, jhi@iki.fi,
        randy@theoryx5.uwinnipeg.ca
Message-ID: <5104D4DBC598D211B5FE0000F8FE7EB202D49B21@mbtlipnt02.btlabs.bt.co.uk>

(Replaces change #3917)

p4raw-link: @3917 on //depot/cfgperl: a62982a846c50953d49f512fd1ec36e63b0a9e81

p4raw-id: //depot/cfgperl@3921

ext/DB_File/Changes
ext/DB_File/DB_File.pm
ext/DB_File/DB_File.xs

index 462056a..6d374bf 100644 (file)
 1.69 3rd August 1999
 
    * fixed a bug in push -- DB_APPEND wasn't working properly.
+
    * Fixed the R_SETCURSOR bug introduced in 1.68
+
    * Added a new Perl variable $DB_File::db_ver
    
+1.70 4th August 1999
+
+   * Initialise $DB_File::db_ver and $DB_File::db_version with
+     GV_ADD|GV_ADDMULT -- bug spotted by Nick Ing-Simmons.
+
+   * Added a BOOT check to test for equivalent versions of db.h &
+     libdb.a/so.
+
index c2b7b09..e20a562 100644 (file)
@@ -1,8 +1,8 @@
 # DB_File.pm -- Perl 5 interface to Berkeley DB 
 #
 # written by Paul Marquess (Paul.Marquess@btinternet.com)
-# last modified 3rd August 1999
-# version 1.69
+# last modified 4th August 1999
+# version 1.70
 #
 #     Copyright (c) 1995-1999 Paul Marquess. All rights reserved.
 #     This program is free software; you can redistribute it and/or
@@ -145,7 +145,7 @@ use vars qw($VERSION @ISA @EXPORT $AUTOLOAD $DB_BTREE $DB_HASH $DB_RECNO $db_ver
 use Carp;
 
 
-$VERSION = "1.69" ;
+$VERSION = "1.70" ;
 
 #typedef enum { DB_BTREE, DB_HASH, DB_RECNO } DBTYPE;
 $DB_BTREE = new DB_File::BTREEINFO ;
index 1223ad4..2ee1e61 100644 (file)
@@ -3,8 +3,8 @@
  DB_File.xs -- Perl 5 interface to Berkeley DB 
 
  written by Paul Marquess <Paul.Marquess@btinternet.com>
- last modified 3rd August 1999
- version 1.69
+ last modified 4th August 1999
+ version 1.70
 
  All comments/suggestions/problems are welcome
 
         1.69 -  fixed a bug in push -- DB_APPEND wasn't working properly.
                Fixed the R_SETCURSOR bug introduced in 1.68
                Added a new Perl variable $DB_File::db_ver 
-
-
-
+        1.70 -  Initialise $DB_File::db_ver and $DB_File::db_version with 
+               GV_ADD|GV_ADDMULT -- bug spotted by Nick Ing-Simmons.
+               Added a BOOT check to test for equivalent versions of db.h &
+               libdb.a/so.
 
 */
 
@@ -441,13 +442,20 @@ u_int             flags ;
 static void
 GetVersionInfo(pTHX)
 {
-    SV * version_sv = perl_get_sv("DB_File::db_version", TRUE) ;
-    SV * ver_sv = perl_get_sv("DB_File::db_ver", TRUE) ;
+    SV * version_sv = perl_get_sv("DB_File::db_version", GV_ADD|GV_ADDMULTI) ;
+    SV * ver_sv = perl_get_sv("DB_File::db_ver", GV_ADD|GV_ADDMULTI) ;
 #ifdef DB_VERSION_MAJOR
     int Major, Minor, Patch ;
 
     (void)db_version(&Major, &Minor, &Patch) ;
 
+    /* Check that the versions of db.h and libdb.a are the same */
+    if (Major != DB_VERSION_MAJOR || Minor != DB_VERSION_MINOR 
+               || Patch != DB_VERSION_PATCH)
+       croak("\nDB_File needs compatible versions of libdb & db.h\n\tyou have db.h version %d.%d.%d and libdb version %d.%d.%d\n",  
+               DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH, 
+               Major, Minor, Patch) ;
+    
     /* check that libdb is recent enough  -- we need 2.3.4 or greater */
     if (Major == 2 && (Minor < 3 || (Minor ==  3 && Patch < 4)))
        croak("DB_File needs Berkeley DB 2.3.4 or greater, you have %d.%d.%d\n",