couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@apache.org
Subject [12/50] [abbrv] git commit: Make icu_driver compatible with interface changes in R15B.
Date Wed, 14 Mar 2012 22:28:01 GMT
Make icu_driver compatible with interface changes in R15B.

Erlang R15B redefines* the signature for the driver control callback to
use its own special ssize_t type. This just adds a conditional based on
the definition of ERL_DRV_EXTENDED_MAJOR_VERSION to pick the right type.

* http://www.erlang.org/doc/man/erl_driver.html#rewrites_for_64_bits


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

Branch: refs/heads/COUCHDB-1426
Commit: 776aa1d0ac659ce7230b5b31307ca9d4f99e55ea
Parents: 4c77997
Author: Jan Lehnardt <jan@apache.org>
Authored: Mon Feb 27 16:38:40 2012 +0100
Committer: Jan Lehnardt <jan@apache.org>
Committed: Fri Mar 2 17:12:14 2012 +0100

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


http://git-wip-us.apache.org/repos/asf/couchdb/blob/776aa1d0/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..a59e8cb 100644
--- a/src/couchdb/priv/icu_driver/couch_icu_driver.c
+++ b/src/couchdb/priv/icu_driver/couch_icu_driver.c
@@ -30,6 +30,12 @@ specific language governing permissions and limitations under the License.
 #include <string.h> /* for memcpy */
 #endif
 
+#if ERL_DRV_EXTENDED_MAJOR_VERSION < 2
+typedef int COUCH_SSIZET;
+#else
+typedef ErlDrvSSizeT COUCH_SSIZET;
+#endif
+
 typedef struct {
     ErlDrvPort port;
     UCollator* collNoCase;
@@ -79,7 +85,9 @@ 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)
+COUCH_SSIZET
+return_control_result(void* pLocalResult, int localLen,
+            char **ppRetBuf, COUCH_SSIZET returnLen)
 {
     if (*ppRetBuf == NULL || localLen > returnLen) {
         *ppRetBuf = (char*)driver_alloc_binary(localLen);
@@ -91,8 +99,10 @@ 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)
+static COUCH_SSIZET
+couch_drv_control(ErlDrvData drv_data, unsigned int command,
+        char *pBuf, COUCH_SSIZET bufLen,
+        char **rbuf, COUCH_SSIZET rlen)
 {
 
     couch_drv_data* pData = (couch_drv_data*)drv_data;


Mime
View raw message