summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Vandenberg <jayvdb@gmail.com>2021-12-03 10:22:58 +0800
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>2021-12-03 11:29:39 +0100
commit4d4d2bc444e858741a7d3f753e01cd0ae37425b7 (patch)
tree548d0e95d7cb001a1d1c33d52339390cbfa7f307
parent4b637ec34af3774e70cdeee450e2e904d6d1ca35 (diff)
downloadpsycopg2-4d4d2bc444e858741a7d3f753e01cd0ae37425b7.tar.gz
Include sys/time.h for gettimeofday
Fixes https://github.com/psycopg/psycopg2/issues/1397
-rw-r--r--psycopg/libpq_support.c1
-rw-r--r--psycopg/replication_cursor_type.c3
2 files changed, 4 insertions, 0 deletions
diff --git a/psycopg/libpq_support.c b/psycopg/libpq_support.c
index d259eca..712102e 100644
--- a/psycopg/libpq_support.c
+++ b/psycopg/libpq_support.c
@@ -38,6 +38,7 @@
#include "psycopg/win32_support.h"
#else
#include <arpa/inet.h>
+#include <sys/time.h>
#endif
/* support routines taken from pg_basebackup/streamutil.c */
diff --git a/psycopg/replication_cursor_type.c b/psycopg/replication_cursor_type.c
index ab3ad3c..76f7563 100644
--- a/psycopg/replication_cursor_type.c
+++ b/psycopg/replication_cursor_type.c
@@ -34,6 +34,9 @@
#include <string.h>
#include <stdlib.h>
+#ifndef _WIN32
+#include <sys/time.h>
+#endif
/* python */
#include "datetime.h"