You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ja...@apache.org on 2012/03/02 18:44:08 UTC
[1/3] git commit: Make icu_driver compatible with interface changes
in R15B.
Updated Branches:
refs/heads/1.2.x 4cd60f3d1 -> db8335bf2
refs/heads/master 766d461ee -> ef392f31c
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/ef392f31
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/ef392f31
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/ef392f31
Branch: refs/heads/master
Commit: ef392f31c3718dc32f624d79829bb301e19113dc
Parents: 766d461
Author: Jan Lehnardt <ja...@apache.org>
Authored: Mon Feb 27 16:38:40 2012 +0100
Committer: Jan Lehnardt <ja...@apache.org>
Committed: Fri Mar 2 17:55:41 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/ef392f31/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;