1- /* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/execute.c,v 1.62 2006/10/04 00:30:11 momjian Exp $ */
1+ /* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/execute.c,v 1.63 2007/02/02 08:58:23 meskes Exp $ */
22
33/*
44 * The aim is to get a simpler inteface to the database routines.
@@ -135,8 +135,6 @@ ECPGget_variable(va_list APREF, enum ECPGttype type, struct variable * var, bool
135135}
136136}
137137
138- #undef APREF
139-
140138/*
141139 * create a list of variables
142140 * The variables are listed with input variables preceding outputvariables
@@ -156,7 +154,7 @@ ECPGget_variable(va_list APREF, enum ECPGttype type, struct variable * var, bool
156154 * ind_offset - indicator offset
157155 */
158156static bool
159- create_statement (int lineno ,int compat ,int force_indicator ,struct connection * connection ,struct statement * * stmt ,const char * query ,va_list ap )
157+ create_statement (int lineno ,int compat ,int force_indicator ,struct connection * connection ,struct statement * * stmt ,const char * query ,va_list APREF )
160158{
161159struct variable * * list = & ((* stmt )-> inlist );
162160enum ECPGttype type ;
@@ -172,7 +170,7 @@ create_statement(int lineno, int compat, int force_indicator, struct connection
172170
173171list = & ((* stmt )-> inlist );
174172
175- type = va_arg (ap ,enum ECPGttype );
173+ type = va_arg (APREF ,enum ECPGttype );
176174
177175while (type != ECPGt_EORT )
178176{
@@ -186,11 +184,7 @@ create_statement(int lineno, int compat, int force_indicator, struct connection
186184if (!(var = (struct variable * )ECPGalloc (sizeof (struct variable ),lineno )))
187185return false;
188186
189- #if defined(__GNUC__ )&& (defined (__powerpc__ )|| defined(__amd64__ )|| defined(__x86_64__ ))
190187ECPGget_variable (ap ,type ,var , true);
191- #else
192- ECPGget_variable (& ap ,type ,var , true);
193- #endif
194188
195189/* if variable is NULL, the statement hasn't been prepared */
196190if (var -> pointer == NULL )
@@ -208,7 +202,7 @@ create_statement(int lineno, int compat, int force_indicator, struct connection
208202ptr -> next = var ;
209203}
210204
211- type = va_arg (ap ,enum ECPGttype );
205+ type = va_arg (APREF ,enum ECPGttype );
212206}
213207
214208return (true);
@@ -1545,7 +1539,11 @@ ECPGdo(int lineno, int compat, int force_indicator, const char *connection_name,
15451539
15461540/* construct statement in our own structure */
15471541va_start (args ,query );
1542+ #if defined(__GNUC__ )&& (defined (__powerpc__ )|| defined(__amd64__ )|| defined(__x86_64__ ))
15481543if (create_statement (lineno ,compat ,force_indicator ,con ,& stmt ,query ,args )== false)
1544+ #else
1545+ if (create_statement (lineno ,compat ,force_indicator ,con ,& stmt ,query ,& args )== false)
1546+ #endif
15491547{
15501548setlocale (LC_NUMERIC ,oldlocale );
15511549ECPGfree (oldlocale );