diff --git a/src/pythoncapi_compat.h b/src/pythoncapi_compat.h index ccbd1a34..d78a78ac 100644 --- a/src/pythoncapi_compat.h +++ b/src/pythoncapi_compat.h @@ -1268,10 +1268,9 @@ PyLong_Export(PyObject *obj, PyLongExport *export_long) int overflow; #if SIZEOF_LONG == 8 long value = PyLong_AsLongAndOverflow(obj, &overflow); -#elif SIZEOF_LONG_LONG == 8 - long long value = PyLong_AsLongLongAndOverflow(obj, &overflow); #else -# error "unable to convert a long to int64_t" + // Windows has 32-bit long, so use 64-bit long long instead + long long value = PyLong_AsLongLongAndOverflow(obj, &overflow); #endif if (!overflow) {