Fix the build of this module on 64-bit platforms

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78488 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1.4
Russell Bryant 18 years ago
parent dcfb651931
commit 0db2a076e1

@ -57,7 +57,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
struct custom_prepare_struct { struct custom_prepare_struct {
const char *sql; const char *sql;
const char *extra; const char *extra;
va_list *ap; va_list ap;
}; };
static SQLHSTMT custom_prepare(struct odbc_obj *obj, void *data) static SQLHSTMT custom_prepare(struct odbc_obj *obj, void *data)
@ -67,7 +67,8 @@ static SQLHSTMT custom_prepare(struct odbc_obj *obj, void *data)
const char *newparam, *newval; const char *newparam, *newval;
SQLHSTMT stmt; SQLHSTMT stmt;
va_list ap; va_list ap;
va_copy(ap, *(cps->ap));
va_copy(ap, cps->ap);
res = SQLAllocHandle(SQL_HANDLE_STMT, obj->con, &stmt); res = SQLAllocHandle(SQL_HANDLE_STMT, obj->con, &stmt);
if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) { if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
@ -115,8 +116,9 @@ static struct ast_variable *realtime_odbc(const char *database, const char *tabl
SQLSMALLINT nullable; SQLSMALLINT nullable;
SQLLEN indicator; SQLLEN indicator;
va_list aq; va_list aq;
struct custom_prepare_struct cps = { .sql = sql, .ap = &ap }; struct custom_prepare_struct cps = { .sql = sql };
va_copy(cps.ap, ap);
va_copy(aq, ap); va_copy(aq, ap);
if (!table) if (!table)
@ -240,9 +242,10 @@ static struct ast_config *realtime_multi_odbc(const char *database, const char *
SQLSMALLINT decimaldigits; SQLSMALLINT decimaldigits;
SQLSMALLINT nullable; SQLSMALLINT nullable;
SQLLEN indicator; SQLLEN indicator;
struct custom_prepare_struct cps = { .sql = sql, .ap = &ap }; struct custom_prepare_struct cps = { .sql = sql };
va_list aq; va_list aq;
va_copy(cps.ap, ap);
va_copy(aq, ap); va_copy(aq, ap);
if (!table) if (!table)
@ -357,8 +360,9 @@ static int update_odbc(const char *database, const char *table, const char *keyf
const char *newparam, *newval; const char *newparam, *newval;
int res; int res;
va_list aq; va_list aq;
struct custom_prepare_struct cps = { .sql = sql, .ap = &ap, .extra = lookup }; struct custom_prepare_struct cps = { .sql = sql, .extra = lookup };
va_copy(cps.ap, ap);
va_copy(aq, ap); va_copy(aq, ap);
if (!table) if (!table)

Loading…
Cancel
Save