Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c8bb9eb

Browse files
committed
Patch #494047: removes 64-bit ?: to cope on plan9.
1 parent 27761f3 commit c8bb9eb

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

Objects/longobject.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,11 @@ PyLong_AsLongLong(PyObject *vv)
694694
(PyLongObject *)vv, (unsigned char *)&bytes,
695695
SIZEOF_LONG_LONG, IS_LITTLE_ENDIAN, 1);
696696

697-
return res < 0 ? (LONG_LONG)res : bytes;
697+
/* Plan 9 can't handle LONG_LONG in ? : expressions */
698+
if (res < 0)
699+
return (LONG_LONG)res;
700+
else
701+
return bytes;
698702
}
699703

700704
/* Get a C unsigned LONG_LONG int from a long int object.
@@ -716,7 +720,11 @@ PyLong_AsUnsignedLongLong(PyObject *vv)
716720
(PyLongObject *)vv, (unsigned char *)&bytes,
717721
SIZEOF_LONG_LONG, IS_LITTLE_ENDIAN, 0);
718722

719-
return res < 0 ? (unsigned LONG_LONG)res : bytes;
723+
/* Plan 9 can't handle LONG_LONG in ? : expressions */
724+
if (res < 0)
725+
return (unsigned LONG_LONG)res;
726+
else
727+
return bytes;
720728
}
721729

722730
#undef IS_LITTLE_ENDIAN

0 commit comments

Comments
 (0)