com php-src: * Make ext/dba compile with newer versions of Oracle's Berkeley (in my case 6.1) * Make the db3 driver work with 4.3+: ext/dba/config.w32
ext/dba/dba_db3.c
| From: | Kalle Sommer Nielsen | Date: | Tue, 19 May 2015 10:12:24 +0000 |
| Subject: | com php-src: * Make ext/dba compile with newer versions of Oracle's Berkeley (in my case 6.1) * Make the db3 driver work with 4.3+: ext/dba/config.w32 ext/dba/dba_db3.c |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-86802@lists.php.net to get a copy of this message | ||
Commit: dd527806e9268b11d3044da7518e81858d1f07f8
Author: Kalle Sommer Nielsen <kalle@php.net> Tue, 19 May 2015 12:12:24 +0200
Parents: b3d053b036e564e9bce6df705de8710823a43016
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=dd527806e9268b11d3044da7518e81858d1f07f8
Log:
* Make ext/dba compile with newer versions of Oracle's Berkeley (in my case 6.1)
* Make the db3 driver work with 4.3+
Changed paths:
M ext/dba/config.w32
M ext/dba/dba_db3.c
Diff:
diff --git a/ext/dba/config.w32 b/ext/dba/config.w32
index 4f3514e..4abba8d 100644
--- a/ext/dba/config.w32
+++ b/ext/dba/config.w32
@@ -4,7 +4,7 @@
ARG_WITH("dba", "DBA support", "no");
if (PHP_DBA != "no") {
- if (CHECK_LIB("libdb31s.lib", "dba", PHP_DBA) &&
+ if (CHECK_LIB("libdb31s.lib;libdb61.lib", "dba", PHP_DBA) &&
CHECK_HEADER_ADD_INCLUDE("db.h", "CFLAGS_DBA")) {
EXTENSION("dba", "dba.c dba_cdb.c dba_db1.c dba_db2.c dba_db3.c dba_dbm.c
dba_flatfile.c dba_gdbm.c dba_ndbm.c dba_inifile.c");
ADD_SOURCES("ext/dba/libcdb", "cdb.c cdb_make.c uint32.c", "dba");
diff --git a/ext/dba/dba_db3.c b/ext/dba/dba_db3.c
index 1b46295..3a99eb8 100644
--- a/ext/dba/dba_db3.c
+++ b/ext/dba/dba_db3.c
@@ -25,6 +25,10 @@
#include "php.h"
#if DBA_DB3
+#ifdef DBA_IS_MODERN
+#undef off_t
+#undef ssize_t
+#endif
#include "php_db3.h"
#include <sys/stat.h>
@@ -35,7 +39,11 @@
#include <db.h>
#endif
-static void php_dba_db3_errcall_fcn(const char *errpfx, char *msg)
+static void php_dba_db3_errcall_fcn(
+#if (DB_VERSION_MAJOR > 4 || (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 3))
+ const DB_ENV *dbenv,
+#endif
+ const char *errpfx, const char *msg)
{
php_error_docref(NULL, E_NOTICE, "%s%s", errpfx?errpfx:"", msg);
@@ -90,7 +98,12 @@ DBA_OPEN_FUNC(db3)
if ((err=db_create(&dbp, NULL, 0)) == 0) {
dbp->set_errcall(dbp, php_dba_db3_errcall_fcn);
- if ((err=dbp->open(dbp, info->path, NULL, type, gmode, filemode)) == 0) {
+ if(
+#if (DB_VERSION_MAJOR > 4 || (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 1))
+ (err=dbp->open(dbp, 0, info->path, NULL, type, gmode, filemode)) == 0) {
+#else
+ (err=dbp->open(dbp, info->path, NULL, type, gmode, filemode)) == 0) {
+#endif
dba_db3_data *data;
data = pemalloc(sizeof(*data), info->flags&DBA_PERSISTENT);