Updated Branches:
  refs/heads/R15B-driver [created] bc5a35587

Make icu_driver compatible with interface changes in R15B.

R15B implements a new driver interface. This patch detects
which version we are compiling with and uses the correct
interface.


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/bc5a3558
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/bc5a3558
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/bc5a3558

Branch: refs/heads/R15B-driver
Commit: bc5a35587d871f662932013bca7db4bb70d5d348
Parents: 4c77997
Author: Jan Lehnardt <[email protected]>
Authored: Mon Feb 27 16:38:40 2012 +0100
Committer: Jan Lehnardt <[email protected]>
Committed: Mon Feb 27 18:12:49 2012 +0100

----------------------------------------------------------------------
 src/couchdb/priv/icu_driver/couch_icu_driver.c |   17 ++++++++++++++---
 1 files changed, 14 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/bc5a3558/src/couchdb/priv/icu_driver/couch_icu_driver.c
----------------------------------------------------------------------
diff --git a/src/couchdb/priv/icu_driver/couch_icu_driver.c 
b/src/couchdb/priv/icu_driver/couch_icu_driver.c
index edfd84a..145c714 100644
--- a/src/couchdb/priv/icu_driver/couch_icu_driver.c
+++ b/src/couchdb/priv/icu_driver/couch_icu_driver.c
@@ -79,7 +79,13 @@ static ErlDrvData couch_drv_start(ErlDrvPort port, char 
*buff)
     return (ErlDrvData)pData;
 }
 
-static int return_control_result(void* pLocalResult, int localLen, char 
**ppRetBuf, int returnLen)
+#if ERL_DRV_EXTENDED_MAJOR_VERSION == 1
+// < R15B
+int return_control_result(void* pLocalResult, int localLen, char **ppRetBuf, 
int returnLen)
+#else
+// >= R15B
+ErlDrvSSizeT return_control_result(void* pLocalResult, int localLen, char 
**ppRetBuf, ErlDrvSizeT returnLen)
+#endif
 {
     if (*ppRetBuf == NULL || localLen > returnLen) {
         *ppRetBuf = (char*)driver_alloc_binary(localLen);
@@ -91,8 +97,13 @@ static int return_control_result(void* pLocalResult, int 
localLen, char **ppRetB
     return localLen;
 }
 
-static int couch_drv_control(ErlDrvData drv_data, unsigned int command, char 
*pBuf,
-             int bufLen, char **rbuf, int rlen)
+#if ERL_DRV_EXTENDED_MAJOR_VERSION == 1
+// < R15B
+static int couch_drv_control(ErlDrvData drv_data, unsigned int command, char 
*pBuf, int bufLen, char **rbuf, int rlen)
+#else
+// >= R15B
+ErlDrvSSizeT couch_drv_control(ErlDrvData drv_data, unsigned int command, char 
*pBuf, ErlDrvSizeT bufLen, char **rbuf, ErlDrvSizeT rlen)
+#endif
 {
 
     couch_drv_data* pData = (couch_drv_data*)drv_data;

Reply via email to