Skip to content

Commit

Permalink
Try to fix a compilation error on 32-bit mode OS/X.
Browse files Browse the repository at this point in the history
Fixes #2 (maybe).
  • Loading branch information
tseaver committed May 22, 2013
1 parent 41c31f7 commit a45ebca
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
6 changes: 1 addition & 5 deletions BTrees/BTreeModuleTemplate.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,7 @@ longlong_check(PyObject *ob)
static PyObject *
longlong_as_object(PY_LONG_LONG val)
{
static PY_LONG_LONG maxint = 0;

if (maxint == 0)
maxint = INT_GETMAX();
if ((val > maxint) || (val < (-maxint-1)))
if ((val > LONG_MAX) || (val < LONG_MIN))
return PyLong_FromLongLong(val);
return INT_FROM_LONG((long)val);
}
Expand Down
2 changes: 0 additions & 2 deletions BTrees/_compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#define INT_FROM_LONG(x) PyLong_FromLong(x)
#define INT_CHECK(x) PyLong_Check(x)
#define INT_AS_LONG(x) PyLong_AS_LONG(x)
#define INT_GETMAX(x) 2<<31
#define TEXT_FROM_STRING PyUnicode_FromString
#define TEXT_FORMAT PyUnicode_Format

Expand All @@ -39,7 +38,6 @@
#define INT_FROM_LONG(x) PyInt_FromLong(x)
#define INT_CHECK(x) PyInt_Check(x)
#define INT_AS_LONG(x) PyInt_AS_LONG(x)
#define INT_GETMAX(x) PyInt_GetMax(x)
#define TEXT_FROM_STRING PyString_FromString
#define TEXT_FORMAT PyString_Format

Expand Down
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
4.0.7 (unreleased)
------------------

- Issue #2: compilation error on 32-bit mode of OS/X.

- Test ``PURE_PYTHON`` environment variable support: if set, the C
extensions will not be built, imported, or tested.

Expand Down

0 comments on commit a45ebca

Please sign in to comment.