Skip to content

Commit

Permalink
+ sync backport
Browse files Browse the repository at this point in the history
  • Loading branch information
skirpichev committed Sep 18, 2024
1 parent 9ea2130 commit 1be7e48
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/pythoncapi_compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 1be7e48

Please sign in to comment.