summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas J. Donovan <tdonovan@apache.org>2014-01-13 13:59:22 +0000
committerThomas J. Donovan <tdonovan@apache.org>2014-01-13 13:59:22 +0000
commit3712712f60bae4baf16ee3afb0a4c8c74842b9a0 (patch)
treea879db45b6947d6ad057fde047376dcd4225011b
parente8bd7cd65fd23a052a86f719ccfcc85932cdb151 (diff)
downloadapr-3712712f60bae4baf16ee3afb0a4c8c74842b9a0.tar.gz
Add signed type apr_intptr_t, because intptr_t is C99, and is not
recognized by MSVC6. Changed ODBC dbd driver to use apr_intptr_t. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1557720 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--CHANGES3
-rw-r--r--dbd/apr_dbd_odbc.c20
-rw-r--r--include/apr.h.in2
-rw-r--r--include/apr.hnw2
-rw-r--r--include/apr.hw2
-rw-r--r--include/apr.hwc2
6 files changed, 21 insertions, 10 deletions
diff --git a/CHANGES b/CHANGES
index 8a2ea221b..37cd4666a 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,9 @@
-*- coding: utf-8 -*-
Changes for APR 2.0.0
+ *) Added signed apr_intptr_t. Changed ODBC dbd driver to use this.
+ [Tom Donovan]
+
*) When using shmget-based shared memory, the ID used for ftok is
now an APR hash of the filename instead of the constant '1'.
PR 53996 [Jim Jagielski]
diff --git a/dbd/apr_dbd_odbc.c b/dbd/apr_dbd_odbc.c
index 974782871..653067920 100644
--- a/dbd/apr_dbd_odbc.c
+++ b/dbd/apr_dbd_odbc.c
@@ -114,9 +114,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;
+ apr_intptr_t transaction_mode;
+ apr_intptr_t dboptions; /* driver options re SQLGetData */
+ apr_intptr_t default_transaction_mode;
int can_commit; /* controls end_trans behavior */
};
@@ -359,7 +359,7 @@ static SQLRETURN odbc_set_result_column(int icol, apr_dbd_results_t *res,
SQLHANDLE stmt)
{
SQLRETURN rc;
- intptr_t maxsize, textsize, realsize, type, isunsigned = 1;
+ apr_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 +747,7 @@ static void *odbc_get(const apr_dbd_row_t *row, const int col,
SQLRETURN rc;
SQLLEN indicator;
int state = row->res->colstate[col];
- intptr_t options = row->res->apr_dbd->dboptions;
+ apr_intptr_t options = row->res->apr_dbd->dboptions;
switch (state) {
case (COL_UNAVAIL):
@@ -817,13 +817,13 @@ static apr_status_t odbc_parse_params(apr_pool_t *pool, const char *params,
int *connect, SQLCHAR **datasource,
SQLCHAR **user, SQLCHAR **password,
int *defaultBufferSize, int *nattrs,
- int **attrs, intptr_t **attrvals)
+ int **attrs, apr_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(apr_intptr_t));
*nattrs = 0;
seps = DEFAULTSEPS;
name[nparams] = apr_strtok(apr_pstrdup(pool, params), seps, &last);
@@ -1063,7 +1063,7 @@ static apr_dbd_t *odbc_open(apr_pool_t *pool, const char *params, const char **e
SQLCHAR *datasource = (SQLCHAR *)"", *user = (SQLCHAR *)"",
*password = (SQLCHAR *)"";
int nattrs = 0, *attrs = NULL, connect = 0;
- intptr_t *attrvals = NULL;
+ apr_intptr_t *attrvals = NULL;
err_step = "SQLAllocHandle (SQL_HANDLE_DBC)";
err_htype = SQL_HANDLE_ENV;
@@ -1117,10 +1117,10 @@ static apr_dbd_t *odbc_open(apr_pool_t *pool, const char *params, const char **e
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(apr_intptr_t), NULL);
handle->transaction_mode = handle->default_transaction_mode;
SQLGetInfo(hdbc, SQL_GETDATA_EXTENSIONS ,&(handle->dboptions),
- sizeof(intptr_t), NULL);
+ sizeof(apr_intptr_t), NULL);
apr_pool_cleanup_register(pool, handle, odbc_close_cleanup, apr_pool_cleanup_null);
return handle;
}
diff --git a/include/apr.h.in b/include/apr.h.in
index 9cc7e31f0..9d6ebb430 100644
--- a/include/apr.h.in
+++ b/include/apr.h.in
@@ -380,8 +380,10 @@ typedef @ino_t_value@ apr_ino_t;
#if APR_SIZEOF_VOIDP == 8
typedef apr_uint64_t apr_uintptr_t;
+typedef apr_int64_t apr_intptr_t;
#else
typedef apr_uint32_t apr_uintptr_t;
+typedef apr_int32_t apr_intptr_t;
#endif
/* Are we big endian? */
diff --git a/include/apr.hnw b/include/apr.hnw
index 7781063bc..120201bce 100644
--- a/include/apr.hnw
+++ b/include/apr.hnw
@@ -269,8 +269,10 @@ typedef apr_uint64_t apr_ino_t;
#if APR_SIZEOF_VOIDP == 8
typedef apr_uint64_t apr_uintptr_t;
+typedef apr_int64_t apr_intptr_t;
#else
typedef apr_uint32_t apr_uintptr_t;
+typedef apr_int32_t apr_intptr_t;
#endif
/* Mechanisms to properly type numeric literals */
diff --git a/include/apr.hw b/include/apr.hw
index fd34ad42c..94bf7607e 100644
--- a/include/apr.hw
+++ b/include/apr.hw
@@ -407,8 +407,10 @@ typedef apr_uint64_t apr_ino_t;
#if APR_SIZEOF_VOIDP == 8
typedef apr_uint64_t apr_uintptr_t;
+typedef apr_int64_t apr_intptr_t;
#else
typedef apr_uint32_t apr_uintptr_t;
+typedef apr_int32_t apr_intptr_t;
#endif
/* Are we big endian? */
diff --git a/include/apr.hwc b/include/apr.hwc
index ebc6ca54d..061a5299c 100644
--- a/include/apr.hwc
+++ b/include/apr.hwc
@@ -407,8 +407,10 @@ typedef apr_uint64_t apr_ino_t;
#if APR_SIZEOF_VOIDP == 8
typedef apr_uint64_t apr_uintptr_t;
+typedef apr_int64_t apr_intptr_t;
#else
typedef apr_uint32_t apr_uintptr_t;
+typedef apr_int32_t apr_intptr_t;
#endif
/* Are we big endian? */