Fold PQresultErrorField() into a macro

This commit is contained in:
Edin Kadribasic 2005-07-01 22:30:55 +00:00
parent 5d65789877
commit 7ef1a91508
3 changed files with 11 additions and 25 deletions

View file

@ -22,6 +22,7 @@
#define PHP_PDO_PGSQL_INT_H
#include <libpq-fe.h>
#include <php.h>
#define PHP_PDO_PGSQL_CONNECTION_FAILURE_SQLSTATE "08006"
@ -71,6 +72,12 @@ extern int _pdo_pgsql_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, int errcode, const
extern struct pdo_stmt_methods pgsql_stmt_methods;
#ifdef HAVE_PQRESULTERRORFIELD
#define pdo_pgsql_sqlstate(r) PQresultErrorField(r, PG_DIAG_SQLSTATE)
#else
#define pdo_pgsql_sqlstate(r) (const char *)NULL
#endif
#endif /* PHP_PDO_PGSQL_INT_H */
/*