Return-Path: X-Original-To: apmail-apr-commits-archive@www.apache.org Delivered-To: apmail-apr-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 A442010493 for ; Mon, 3 Feb 2014 18:42:22 +0000 (UTC) Received: (qmail 57727 invoked by uid 500); 3 Feb 2014 18:42:21 -0000 Delivered-To: apmail-apr-commits-archive@apr.apache.org Received: (qmail 57622 invoked by uid 500); 3 Feb 2014 18:42:20 -0000 Mailing-List: contact commits-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: Reply-To: dev@apr.apache.org List-Id: Delivered-To: mailing list commits@apr.apache.org Received: (qmail 57613 invoked by uid 99); 3 Feb 2014 18:42:20 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Feb 2014 18:42:20 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Feb 2014 18:42:17 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 0A1A02388906; Mon, 3 Feb 2014 18:41:56 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1563992 - in /apr/apr-util/branches/1.5.x: CHANGES dbd/apr_dbd_odbc.c Date: Mon, 03 Feb 2014 18:41:55 -0000 To: commits@apr.apache.org From: tdonovan@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20140203184156.0A1A02388906@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: tdonovan Date: Mon Feb 3 18:41:55 2014 New Revision: 1563992 URL: http://svn.apache.org/r1563992 Log: Like r1557720 in trunk. MSVC6 has no intptr_t (a C99 type) and there is no signed inptr type in APR 1.5. This change is local to the odbc driver to avoid introducing a new apr type in a patch release. Modified: apr/apr-util/branches/1.5.x/CHANGES apr/apr-util/branches/1.5.x/dbd/apr_dbd_odbc.c Modified: apr/apr-util/branches/1.5.x/CHANGES URL: http://svn.apache.org/viewvc/apr/apr-util/branches/1.5.x/CHANGES?rev=1563992&r1=1563991&r2=1563992&view=diff ============================================================================== --- apr/apr-util/branches/1.5.x/CHANGES [utf-8] (original) +++ apr/apr-util/branches/1.5.x/CHANGES [utf-8] Mon Feb 3 18:41:55 2014 @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes with APR-util 1.5.4 + *) Fix to let ODBC driver build with MSVC6, which does not have intptr_t + [Tom Donovan] + *) Windows cmake build: Fix an incompatiblity with Visual Studio generators. [Jeff Trawick, Bert Huijben] Modified: apr/apr-util/branches/1.5.x/dbd/apr_dbd_odbc.c URL: http://svn.apache.org/viewvc/apr/apr-util/branches/1.5.x/dbd/apr_dbd_odbc.c?rev=1563992&r1=1563991&r2=1563992&view=diff ============================================================================== --- apr/apr-util/branches/1.5.x/dbd/apr_dbd_odbc.c (original) +++ apr/apr-util/branches/1.5.x/dbd/apr_dbd_odbc.c Mon Feb 3 18:41:55 2014 @@ -47,6 +47,21 @@ #include #endif +/* +* MSVC6 does not support intptr_t (C99) +* APR does not have a signed inptr type until 2.0 (r1557720) +*/ +#if defined(_MSC_VER) && _MSC_VER < 1400 +#if APR_SIZEOF_VOIDP == 8 +#define ODBC_INTPTR_T apr_int64_t +#else +#define ODBC_INTPTR_T apr_int32_t +#endif +#else +#define ODBC_INTPTR_T intptr_t +#endif + + /* Driver name is "odbc" and the entry point is 'apr_dbd_odbc_driver' * unless ODBC_DRIVER_NAME is defined and it is linked with another db library which * is ODBC source-compatible. e.g. DB2, Informix, TimesTen, mysql. @@ -114,9 +129,9 @@ struct apr_dbd_t char lastError[MAX_ERROR_STRING]; int defaultBufferSize; /* used for CLOBs in text mode, * and when fld size is indeterminate */ - intptr_t transaction_mode; - intptr_t dboptions; /* driver options re SQLGetData */ - intptr_t default_transaction_mode; + ODBC_INTPTR_T transaction_mode; + ODBC_INTPTR_T dboptions; /* driver options re SQLGetData */ + ODBC_INTPTR_T default_transaction_mode; int can_commit; /* controls end_trans behavior */ }; @@ -359,7 +374,7 @@ static SQLRETURN odbc_set_result_column( SQLHANDLE stmt) { SQLRETURN rc; - intptr_t maxsize, textsize, realsize, type, isunsigned = 1; + ODBC_INTPTR_T maxsize, textsize, realsize, type, isunsigned = 1; /* discover the sql type */ rc = SQLColAttribute(stmt, icol + 1, SQL_DESC_UNSIGNED, NULL, 0, NULL, @@ -747,7 +762,7 @@ static void *odbc_get(const apr_dbd_row_ SQLRETURN rc; SQLLEN indicator; int state = row->res->colstate[col]; - intptr_t options = row->res->apr_dbd->dboptions; + ODBC_INTPTR_T options = row->res->apr_dbd->dboptions; switch (state) { case (COL_UNAVAIL): @@ -817,13 +832,13 @@ static apr_status_t odbc_parse_params(ap int *connect, SQLCHAR **datasource, SQLCHAR **user, SQLCHAR **password, int *defaultBufferSize, int *nattrs, - int **attrs, intptr_t **attrvals) + int **attrs, ODBC_INTPTR_T **attrvals) { char *seps, *last, *next, *name[MAX_PARAMS], *val[MAX_PARAMS]; int nparams = 0, i, j; *attrs = apr_pcalloc(pool, MAX_PARAMS * sizeof(char *)); - *attrvals = apr_pcalloc(pool, MAX_PARAMS * sizeof(intptr_t)); + *attrvals = apr_pcalloc(pool, MAX_PARAMS * sizeof(ODBC_INTPTR_T)); *nattrs = 0; seps = DEFAULTSEPS; name[nparams] = apr_strtok(apr_pstrdup(pool, params), seps, &last); @@ -1063,7 +1078,7 @@ static apr_dbd_t *odbc_open(apr_pool_t * SQLCHAR *datasource = (SQLCHAR *)"", *user = (SQLCHAR *)"", *password = (SQLCHAR *)""; int nattrs = 0, *attrs = NULL, connect = 0; - intptr_t *attrvals = NULL; + ODBC_INTPTR_T *attrvals = NULL; err_step = "SQLAllocHandle (SQL_HANDLE_DBC)"; err_htype = SQL_HANDLE_ENV; @@ -1117,10 +1132,10 @@ static apr_dbd_t *odbc_open(apr_pool_t * handle->default_transaction_mode = 0; handle->can_commit = APR_DBD_TRANSACTION_IGNORE_ERRORS; SQLGetInfo(hdbc, SQL_DEFAULT_TXN_ISOLATION, - &(handle->default_transaction_mode), sizeof(intptr_t), NULL); + &(handle->default_transaction_mode), sizeof(ODBC_INTPTR_T), NULL); handle->transaction_mode = handle->default_transaction_mode; SQLGetInfo(hdbc, SQL_GETDATA_EXTENSIONS ,&(handle->dboptions), - sizeof(intptr_t), NULL); + sizeof(ODBC_INTPTR_T), NULL); apr_pool_cleanup_register(pool, handle, odbc_close_cleanup, apr_pool_cleanup_null); return handle; }