Fix [-Wundef] warning in PDO PostgreSQL extension

This commit is contained in:
George Peter Banyard 2020-05-20 15:41:30 +02:00
parent 50af36a8aa
commit c85ded7632
2 changed files with 3 additions and 3 deletions

View file

@ -156,7 +156,7 @@ static int pgsql_lob_seek(php_stream *stream, zend_off_t offset, int whence,
zend_off_t *newoffset) zend_off_t *newoffset)
{ {
struct pdo_pgsql_lob_self *self = (struct pdo_pgsql_lob_self*)stream->abstract; struct pdo_pgsql_lob_self *self = (struct pdo_pgsql_lob_self*)stream->abstract;
#if HAVE_PG_LO64 && ZEND_ENABLE_ZVAL_LONG64 #if defined(HAVE_PG_LO64) && defined(ZEND_ENABLE_ZVAL_LONG64)
zend_off_t pos = lo_lseek64(self->conn, self->lfd, offset, whence); zend_off_t pos = lo_lseek64(self->conn, self->lfd, offset, whence);
#else #else
zend_off_t pos = lo_lseek(self->conn, self->lfd, offset, whence); zend_off_t pos = lo_lseek(self->conn, self->lfd, offset, whence);
@ -1060,7 +1060,7 @@ static PHP_METHOD(PDO, pgsqlGetNotify)
if (ms_timeout < 0) { if (ms_timeout < 0) {
php_error_docref(NULL, E_WARNING, "Invalid timeout"); php_error_docref(NULL, E_WARNING, "Invalid timeout");
RETURN_FALSE; RETURN_FALSE;
#if ZEND_ENABLE_ZVAL_LONG64 #ifdef ZEND_ENABLE_ZVAL_LONG64
} else if (ms_timeout > INT_MAX) { } else if (ms_timeout > INT_MAX) {
php_error_docref(NULL, E_WARNING, "Timeout was shrunk to %d", INT_MAX); php_error_docref(NULL, E_WARNING, "Timeout was shrunk to %d", INT_MAX);
ms_timeout = INT_MAX; ms_timeout = INT_MAX;

View file

@ -27,7 +27,7 @@
#include "pdo/php_pdo_driver.h" #include "pdo/php_pdo_driver.h"
#include "php_pdo_pgsql.h" #include "php_pdo_pgsql.h"
#include "php_pdo_pgsql_int.h" #include "php_pdo_pgsql_int.h"
#if HAVE_NETINET_IN_H #ifdef HAVE_NETINET_IN_H
#include <netinet/in.h> #include <netinet/in.h>
#endif #endif