Import params.h on FreeBSD if needed to establish version

Fix #755
This commit is contained in:
Daniele Varrazzo 2018-09-05 16:36:58 +01:00
parent 3cdc0bc6e5
commit 0bea06f513
2 changed files with 6 additions and 0 deletions

1
NEWS
View File

@ -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

View File

@ -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__)) \