summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>2018-09-05 16:36:58 +0100
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>2018-09-05 16:36:58 +0100
commit0bea06f51375e9781b27d67436a0b42b69a62e02 (patch)
tree8d0de0a4a80cfe4d28b7ca6df781e8205c3bc076
parent3cdc0bc6e5e6b8761e49349ae75ab0349fd7301c (diff)
downloadpsycopg2-fix-bsd-version.tar.gz
Import params.h on FreeBSD if needed to establish versionfix-bsd-version
Fix #755
-rw-r--r--NEWS1
-rw-r--r--psycopg/config.h5
2 files changed, 6 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index 5ed2c12..e9408c5 100644
--- a/NEWS
+++ b/NEWS
@@ -6,6 +6,7 @@ What's new in psycopg 2.7.6
- Close named cursors if exist, even if `~cursor.execute()` wasn't called
(:ticket:`#746`).
+- Fixed building on modern FreeBSD versions with Python 3.7 (:ticket:`#755`)
What's new in psycopg 2.7.5
diff --git a/psycopg/config.h b/psycopg/config.h
index a96864f..780bb97 100644
--- a/psycopg/config.h
+++ b/psycopg/config.h
@@ -153,6 +153,11 @@ typedef unsigned __int64 uint64_t;
#include "win32_support.h"
#endif
+/* Use params.h for __FreeBSD_version (only needed from a certain version on) */
+#if defined(__FreeBSD__) && !defined(__FreeBSD_version)
+#include <sys/param.h>
+#endif
+
/* what's this, we have no round function either? */
#if (defined(__FreeBSD__) && __FreeBSD_version < 503000) \
|| (defined(_WIN32) && !defined(__GNUC__)) \