Commit c349b076 authored by Stefan Behnel's avatar Stefan Behnel

minor portability tweak: mark non-tiny integer literals as C longs with "L"...

minor portability tweak: mark non-tiny integer literals as C longs with "L" suffix when passing them into PyInt_FromLong()
parent e2c5c9fc
......@@ -1272,6 +1272,8 @@ class GlobalState(object):
function = 'PyLong_FromString((char *)"%s", 0, 0)'
elif Utils.long_literal(value):
function = 'PyInt_FromString((char *)"%s", 0, 0)'
elif len(value.lstrip('-')) > 4:
function = "PyInt_FromLong(%sL)"
else:
function = "PyInt_FromLong(%s)"
init_globals.putln('%s = %s; %s' % (
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment