diff -r a45cb181e4d0 Objects/longobject.c --- a/Objects/longobject.c Wed Oct 17 20:29:07 2012 -0700 +++ b/Objects/longobject.c Thu Oct 18 14:45:56 2012 +0300 @@ -935,17 +935,17 @@ PyObject * PyLong_FromVoidPtr(void *p) { +#if SIZEOF_VOID_P <= SIZEOF_LONG + return PyLong_FromUnsignedLong((unsigned long)(Py_uintptr_t)p); +#else #ifndef HAVE_LONG_LONG # error "PyLong_FromVoidPtr: sizeof(void*) > sizeof(long), but no long long" #endif #if SIZEOF_LONG_LONG < SIZEOF_VOID_P # error "PyLong_FromVoidPtr: sizeof(PY_LONG_LONG) < sizeof(void*)" #endif - /* special-case null pointer */ - if (!p) - return PyLong_FromLong(0); return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)(Py_uintptr_t)p); - +#endif /* SIZEOF_VOID_P <= SIZEOF_LONG */ } /* Get a C pointer from a long int object. */