From 9704dff93b394a5302c4c652c94dcb81a160fa86 Mon Sep 17 00:00:00 2001 From: Justin Charlong Date: Tue, 28 Jan 2020 15:14:34 -0500 Subject: [PATCH] Define "_POSIX_C_SOURCE" before "limits.h" will define "_POSIX_C_SOURCE" to a sensible value if it is not defined when it is included. Including "Python.h" will always define it, so it should be included first. --- cbitstruct/_cbitstruct.c | 7 +++---- setup.py | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/cbitstruct/_cbitstruct.c b/cbitstruct/_cbitstruct.c index 78648ef..5755416 100644 --- a/cbitstruct/_cbitstruct.c +++ b/cbitstruct/_cbitstruct.c @@ -1,12 +1,11 @@ +#define PY_SSIZE_T_CLEAN +#include + #include #include #include #include -#define PY_SSIZE_T_CLEAN - -#include - #define BIT_MASK(__TYPE__, __ONE_COUNT__) \ (((__TYPE__)(-((__ONE_COUNT__) != 0))) \ & (((__TYPE__)-1) >> ((sizeof(__TYPE__) * CHAR_BIT) - (__ONE_COUNT__)))) diff --git a/setup.py b/setup.py index a4eae69..c368336 100644 --- a/setup.py +++ b/setup.py @@ -27,7 +27,7 @@ setup( name="cbitstruct", - version="1.0.3", + version="1.0.4", author="Quentin CHATEAU", author_email="quentin.chateau@gmail.com", license="GPLv3",