Return-Path: X-Original-To: apmail-couchdb-commits-archive@www.apache.org Delivered-To: apmail-couchdb-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7730D960B for ; Wed, 14 Mar 2012 22:28:09 +0000 (UTC) Received: (qmail 16973 invoked by uid 500); 14 Mar 2012 22:28:03 -0000 Delivered-To: apmail-couchdb-commits-archive@couchdb.apache.org Received: (qmail 16232 invoked by uid 500); 14 Mar 2012 22:28:02 -0000 Mailing-List: contact commits-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list commits@couchdb.apache.org Received: (qmail 15655 invoked by uid 99); 14 Mar 2012 22:28:02 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 Mar 2012 22:28:02 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 9BB7770E1; Wed, 14 Mar 2012 22:28:01 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: davisp@apache.org To: commits@couchdb.apache.org X-Mailer: ASF-Git Admin Mailer Subject: [12/50] [abbrv] git commit: Make icu_driver compatible with interface changes in R15B. Message-Id: <20120314222801.9BB7770E1@tyr.zones.apache.org> Date: Wed, 14 Mar 2012 22:28:01 +0000 (UTC) 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 Authored: Mon Feb 27 16:38:40 2012 +0100 Committer: Jan Lehnardt 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 /* 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;