-/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/execute.c,v 1.62 2006/10/04 00:30:11 momjian Exp $ */
+/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/execute.c,v 1.63 2007/02/02 08:58:23 meskes Exp $ */
/*
* The aim is to get a simpler inteface to the database routines.
}
}
-#undef APREF
-
/*
* create a list of variables
* The variables are listed with input variables preceding outputvariables
* ind_offset - indicator offset
*/
static bool
-create_statement(int lineno, int compat, int force_indicator, struct connection * connection, struct statement ** stmt, const char *query, va_list ap)
+create_statement(int lineno, int compat, int force_indicator, struct connection * connection, struct statement ** stmt, const char *query, va_list APREF)
{
struct variable **list = &((*stmt)->inlist);
enum ECPGttype type;
list = &((*stmt)->inlist);
- type = va_arg(ap, enum ECPGttype);
+ type = va_arg(APREF, enum ECPGttype);
while (type != ECPGt_EORT)
{
if (!(var = (struct variable *) ECPGalloc(sizeof(struct variable), lineno)))
return false;
-#if defined(__GNUC__) && (defined (__powerpc__) || defined(__amd64__) || defined(__x86_64__))
ECPGget_variable(ap, type, var, true);
-#else
- ECPGget_variable(&ap, type, var, true);
-#endif
/* if variable is NULL, the statement hasn't been prepared */
if (var->pointer == NULL)
ptr->next = var;
}
- type = va_arg(ap, enum ECPGttype);
+ type = va_arg(APREF, enum ECPGttype);
}
return (true);
/* construct statement in our own structure */
va_start(args, query);
+#if defined(__GNUC__) && (defined (__powerpc__) || defined(__amd64__) || defined(__x86_64__))
if (create_statement(lineno, compat, force_indicator, con, &stmt, query, args) == false)
+#else
+ if (create_statement(lineno, compat, force_indicator, con, &stmt, query, &args) == false)
+#endif
{
setlocale(LC_NUMERIC, oldlocale);
ECPGfree(oldlocale);