+2009-09-22 Tom Tromey <tromey@redhat.com>
+
+ PR gdb/10583:
+ * python/py-value.c (valpy_int): Use PyLong_FromLongLong.
+ (valpy_long): Likewise.
+
2009-09-22 Tom Tromey <tromey@redhat.com>
PR python/10680:
}
GDB_PY_HANDLE_EXCEPTION (except);
+#ifdef HAVE_LONG_LONG /* Defined by Python. */
+ /* If we have 'long long', and the value overflows a 'long', use a
+ Python Long; otherwise use a Python Int. */
+ if (sizeof (l) > sizeof (long) && (l > PyInt_GetMax ()
+ || l < (- (LONGEST) PyInt_GetMax ()) - 1))
+ return PyLong_FromLongLong (l);
+#endif
return PyInt_FromLong (l);
}
}
GDB_PY_HANDLE_EXCEPTION (except);
+#ifdef HAVE_LONG_LONG /* Defined by Python. */
+ return PyLong_FromLongLong (l);
+#else
return PyLong_FromLong (l);
+#endif
}
/* Implements conversion to float. */