[Python-checkins] cpython: require a long long data type (closes #27961)

benjamin.peterson python-checkins at python.org
Mon Sep 5 20:44:57 EDT 2016


https://hg.python.org/cpython/rev/9206a86f7321
changeset:   103105:9206a86f7321
user:        Benjamin Peterson <benjamin at python.org>
date:        Mon Sep 05 17:44:18 2016 -0700
summary:
  require a long long data type (closes #27961)

files:
  Doc/c-api/unicode.rst                      |    5 -
  Include/longobject.h                       |    2 -
  Include/pyport.h                           |   25 +-
  Include/pythread.h                         |    5 -
  Include/structmember.h                     |    2 -
  Lib/test/test_struct.py                    |   21 +-
  Misc/NEWS                                  |    3 +
  Modules/_ctypes/_ctypes_test.c             |    3 -
  Modules/_ctypes/callproc.c                 |    4 -
  Modules/_ctypes/cfield.c                   |   14 +-
  Modules/_ctypes/ctypes.h                   |    4 -
  Modules/_io/_iomodule.h                    |    2 +-
  Modules/_lsprof.c                          |    4 -
  Modules/_multiprocessing/multiprocessing.h |    2 +-
  Modules/_sqlite/util.c                     |   19 -
  Modules/_struct.c                          |   43 -
  Modules/_testcapimodule.c                  |   28 +-
  Modules/_tkinter.c                         |    2 -
  Modules/addrinfo.h                         |    8 -
  Modules/arraymodule.c                      |   11 -
  Modules/posixmodule.c                      |   10 +-
  Modules/resource.c                         |    4 -
  Objects/longobject.c                       |   20 -
  Objects/memoryobject.c                     |   12 -
  Objects/unicodeobject.c                    |    6 -
  Python/getargs.c                           |    4 -
  Python/modsupport.c                        |    3 +-
  Python/pytime.c                            |   16 +-
  Python/structmember.c                      |    4 -
  configure                                  |  227 ++++-----
  configure.ac                               |  128 ++---
  pyconfig.h.in                              |    3 -
  32 files changed, 179 insertions(+), 465 deletions(-)


diff --git a/Doc/c-api/unicode.rst b/Doc/c-api/unicode.rst
--- a/Doc/c-api/unicode.rst
+++ b/Doc/c-api/unicode.rst
@@ -525,11 +525,6 @@
    copied as-is to the result string, and any extra arguments discarded.
 
    .. note::
-
-      The `"%lld"` and `"%llu"` format specifiers are only available
-      when :const:`HAVE_LONG_LONG` is defined.
-
-   .. note::
       The width formatter unit is number of characters rather than bytes.
       The precision formatter unit is number of bytes for ``"%s"`` and
       ``"%V"`` (if the ``PyObject*`` argument is NULL), and a number of
diff --git a/Include/longobject.h b/Include/longobject.h
--- a/Include/longobject.h
+++ b/Include/longobject.h
@@ -85,14 +85,12 @@
 PyAPI_FUNC(PyObject *) PyLong_FromVoidPtr(void *);
 PyAPI_FUNC(void *) PyLong_AsVoidPtr(PyObject *);
 
-#ifdef HAVE_LONG_LONG
 PyAPI_FUNC(PyObject *) PyLong_FromLongLong(PY_LONG_LONG);
 PyAPI_FUNC(PyObject *) PyLong_FromUnsignedLongLong(unsigned PY_LONG_LONG);
 PyAPI_FUNC(PY_LONG_LONG) PyLong_AsLongLong(PyObject *);
 PyAPI_FUNC(unsigned PY_LONG_LONG) PyLong_AsUnsignedLongLong(PyObject *);
 PyAPI_FUNC(unsigned PY_LONG_LONG) PyLong_AsUnsignedLongLongMask(PyObject *);
 PyAPI_FUNC(PY_LONG_LONG) PyLong_AsLongLongAndOverflow(PyObject *, int *);
-#endif /* HAVE_LONG_LONG */
 
 PyAPI_FUNC(PyObject *) PyLong_FromString(const char *, char **, int);
 #ifndef Py_LIMITED_API
diff --git a/Include/pyport.h b/Include/pyport.h
--- a/Include/pyport.h
+++ b/Include/pyport.h
@@ -35,10 +35,6 @@
 Meaning:  The C9X type uintptr_t is supported by the compiler
 Used in:  Py_uintptr_t
 
-HAVE_LONG_LONG
-Meaning:  The compiler supports the C type "long long"
-Used in:  PY_LONG_LONG
-
 **************************************************************************/
 
 /* typedefs for some C9X-defined synonyms for integral types.
@@ -53,7 +49,6 @@
  * integral synonyms.  Only define the ones we actually need.
  */
 
-#ifdef HAVE_LONG_LONG
 #ifndef PY_LONG_LONG
 #define PY_LONG_LONG long long
 #if defined(LLONG_MAX)
@@ -78,7 +73,6 @@
 #define PY_ULLONG_MAX (PY_LLONG_MAX * Py_ULL(2) + 1)
 #endif /* LLONG_MAX */
 #endif
-#endif /* HAVE_LONG_LONG */
 
 /* a build with 30-bit digits for Python integers needs an exact-width
  * 32-bit unsigned integer type to store those digits.  (We could just use
@@ -161,7 +155,7 @@
 typedef unsigned long   Py_uintptr_t;
 typedef long            Py_intptr_t;
 
-#elif defined(HAVE_LONG_LONG) && (SIZEOF_VOID_P <= SIZEOF_LONG_LONG)
+#elif SIZEOF_VOID_P <= SIZEOF_LONG_LONG
 typedef unsigned PY_LONG_LONG   Py_uintptr_t;
 typedef PY_LONG_LONG            Py_intptr_t;
 
@@ -248,19 +242,16 @@
 #endif
 
 /* PY_FORMAT_LONG_LONG is analogous to PY_FORMAT_SIZE_T above, but for
- * the long long type instead of the size_t type.  It's only available
- * when HAVE_LONG_LONG is defined. The "high level" Python format
+ * the long long type instead of the size_t type. The "high level" Python format
  * functions listed above will interpret "lld" or "llu" correctly on
  * all platforms.
  */
-#ifdef HAVE_LONG_LONG
-#   ifndef PY_FORMAT_LONG_LONG
-#       ifdef MS_WINDOWS
-#           define PY_FORMAT_LONG_LONG "I64"
-#       else
-#           error "This platform's pyconfig.h needs to define PY_FORMAT_LONG_LONG"
-#       endif
-#   endif
+#ifndef PY_FORMAT_LONG_LONG
+#    ifdef MS_WINDOWS
+#       define PY_FORMAT_LONG_LONG "I64"
+#    else
+#       error "This platform's pyconfig.h needs to define PY_FORMAT_LONG_LONG"
+#    endif
 #endif
 
 /* Py_LOCAL can be used instead of static to get the fastest possible calling
diff --git a/Include/pythread.h b/Include/pythread.h
--- a/Include/pythread.h
+++ b/Include/pythread.h
@@ -37,13 +37,8 @@
    module exposes a higher-level API, with timeouts expressed in seconds
    and floating-point numbers allowed.
 */
-#if defined(HAVE_LONG_LONG)
 #define PY_TIMEOUT_T PY_LONG_LONG
 #define PY_TIMEOUT_MAX PY_LLONG_MAX
-#else
-#define PY_TIMEOUT_T long
-#define PY_TIMEOUT_MAX LONG_MAX
-#endif
 
 /* In the NT API, the timeout is a DWORD and is expressed in milliseconds */
 #if defined (NT_THREADS)
diff --git a/Include/structmember.h b/Include/structmember.h
--- a/Include/structmember.h
+++ b/Include/structmember.h
@@ -49,10 +49,8 @@
 #define T_OBJECT_EX 16  /* Like T_OBJECT, but raises AttributeError
                            when the value is NULL, instead of
                            converting to None. */
-#ifdef HAVE_LONG_LONG
 #define T_LONGLONG      17
 #define T_ULONGLONG     18
-#endif /* HAVE_LONG_LONG */
 
 #define T_PYSSIZET      19      /* Py_ssize_t */
 #define T_NONE          20      /* Value is always None */
diff --git a/Lib/test/test_struct.py b/Lib/test/test_struct.py
--- a/Lib/test/test_struct.py
+++ b/Lib/test/test_struct.py
@@ -16,22 +16,10 @@
 def iter_integer_formats(byteorders=byteorders):
     for code in integer_codes:
         for byteorder in byteorders:
-            if (byteorder in ('', '@') and code in ('q', 'Q') and
-                not HAVE_LONG_LONG):
-                continue
             if (byteorder not in ('', '@') and code in ('n', 'N')):
                 continue
             yield code, byteorder
 
-# Native 'q' packing isn't available on systems that don't have the C
-# long long type.
-try:
-    struct.pack('q', 5)
-except struct.error:
-    HAVE_LONG_LONG = False
-else:
-    HAVE_LONG_LONG = True
-
 def string_reverse(s):
     return s[::-1]
 
@@ -159,9 +147,7 @@
             self.assertEqual(size, expected_size[code])
 
         # native integer sizes
-        native_pairs = 'bB', 'hH', 'iI', 'lL', 'nN'
-        if HAVE_LONG_LONG:
-            native_pairs += 'qQ',
+        native_pairs = 'bB', 'hH', 'iI', 'lL', 'nN', 'qQ'
         for format_pair in native_pairs:
             for byteorder in '', '@':
                 signed_size = struct.calcsize(byteorder + format_pair[0])
@@ -174,9 +160,8 @@
         self.assertLessEqual(4, struct.calcsize('l'))
         self.assertLessEqual(struct.calcsize('h'), struct.calcsize('i'))
         self.assertLessEqual(struct.calcsize('i'), struct.calcsize('l'))
-        if HAVE_LONG_LONG:
-            self.assertLessEqual(8, struct.calcsize('q'))
-            self.assertLessEqual(struct.calcsize('l'), struct.calcsize('q'))
+        self.assertLessEqual(8, struct.calcsize('q'))
+        self.assertLessEqual(struct.calcsize('l'), struct.calcsize('q'))
         self.assertGreaterEqual(struct.calcsize('n'), struct.calcsize('i'))
         self.assertGreaterEqual(struct.calcsize('n'), struct.calcsize('P'))
 
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -10,6 +10,9 @@
 Core and Builtins
 -----------------
 
+- Issue #27961?: Require platforms to support ``long long``. Python hasn't
+  compiled without ``long long`` for years, so this is basically a formality.
+
 - Issue #27355: Removed support for Windows CE.  It was never finished,
   and Windows CE is no longer a relevant platform for Python.
 
diff --git a/Modules/_ctypes/_ctypes_test.c b/Modules/_ctypes/_ctypes_test.c
--- a/Modules/_ctypes/_ctypes_test.c
+++ b/Modules/_ctypes/_ctypes_test.c
@@ -233,7 +233,6 @@
     return (*func)(table);
 }
 
-#ifdef HAVE_LONG_LONG
 EXPORT(PY_LONG_LONG) _testfunc_q_bhilfdq(signed char b, short h, int i, long l, float f,
                                      double d, PY_LONG_LONG q)
 {
@@ -267,8 +266,6 @@
     return sum;
 }
 
-#endif
-
 typedef struct {
     char *name;
     char *value;
diff --git a/Modules/_ctypes/callproc.c b/Modules/_ctypes/callproc.c
--- a/Modules/_ctypes/callproc.c
+++ b/Modules/_ctypes/callproc.c
@@ -474,7 +474,6 @@
             self->tag, self->value.l);
         break;
 
-#ifdef HAVE_LONG_LONG
     case 'q':
     case 'Q':
         sprintf(buffer,
@@ -485,7 +484,6 @@
 #endif
             self->tag, self->value.q);
         break;
-#endif
     case 'd':
         sprintf(buffer, "<cparam '%c' (%f)>",
             self->tag, self->value.d);
@@ -593,9 +591,7 @@
     short h;
     int i;
     long l;
-#ifdef HAVE_LONG_LONG
     PY_LONG_LONG q;
-#endif
     long double D;
     double d;
     float f;
diff --git a/Modules/_ctypes/cfield.c b/Modules/_ctypes/cfield.c
--- a/Modules/_ctypes/cfield.c
+++ b/Modules/_ctypes/cfield.c
@@ -379,8 +379,6 @@
     return 0;
 }
 
-#ifdef HAVE_LONG_LONG
-
 /* Same, but handling native long long. */
 
 static int
@@ -417,8 +415,6 @@
     return 0;
 }
 
-#endif
-
 /*****************************************************************
  * Integer fields, with bitfield support
  */
@@ -888,7 +884,6 @@
     return PyLong_FromUnsignedLong(val);
 }
 
-#ifdef HAVE_LONG_LONG
 static PyObject *
 q_set(void *ptr, PyObject *value, Py_ssize_t size)
 {
@@ -982,7 +977,6 @@
     GET_BITFIELD(val, size);
     return PyLong_FromUnsignedLongLong(val);
 }
-#endif
 
 /*****************************************************************
  * non-integer accessor methods, not supporting bit fields
@@ -1490,9 +1484,7 @@
 #if SIZEOF_VOID_P <= SIZEOF_LONG
     v = (void *)PyLong_AsUnsignedLongMask(value);
 #else
-#ifndef HAVE_LONG_LONG
-#   error "PyLong_AsVoidPtr: sizeof(void*) > sizeof(long), but no long long"
-#elif SIZEOF_LONG_LONG < SIZEOF_VOID_P
+#if SIZEOF_LONG_LONG < SIZEOF_VOID_P
 #   error "PyLong_AsVoidPtr: sizeof(PY_LONG_LONG) < sizeof(void*)"
 #endif
     v = (void *)PyLong_AsUnsignedLongLongMask(value);
@@ -1538,14 +1530,12 @@
 #else
 # error
 #endif
-#ifdef HAVE_LONG_LONG
 #if SIZEOF_LONG_LONG == 8
     { 'q', q_set, q_get, &ffi_type_sint64, q_set_sw, q_get_sw},
     { 'Q', Q_set, Q_get, &ffi_type_uint64, Q_set_sw, Q_get_sw},
 #else
 # error
 #endif
-#endif
     { 'P', P_set, P_get, &ffi_type_pointer},
     { 'z', z_set, z_get, &ffi_type_pointer},
 #ifdef CTYPES_UNICODE
@@ -1635,10 +1625,8 @@
 #endif
 */
 
-#ifdef HAVE_LONG_LONG
 typedef struct { char c; PY_LONG_LONG x; } s_long_long;
 #define LONG_LONG_ALIGN (sizeof(s_long_long) - sizeof(PY_LONG_LONG))
-#endif
 
 /* from ffi.h:
 typedef struct _ffi_type
diff --git a/Modules/_ctypes/ctypes.h b/Modules/_ctypes/ctypes.h
--- a/Modules/_ctypes/ctypes.h
+++ b/Modules/_ctypes/ctypes.h
@@ -31,9 +31,7 @@
                 long l;
                 float f;
                 double d;
-#ifdef HAVE_LONG_LONG
                 PY_LONG_LONG ll;
-#endif
                 long double D;
 };
 
@@ -303,9 +301,7 @@
         short h;
         int i;
         long l;
-#ifdef HAVE_LONG_LONG
         PY_LONG_LONG q;
-#endif
         long double D;
         double d;
         float f;
diff --git a/Modules/_io/_iomodule.h b/Modules/_io/_iomodule.h
--- a/Modules/_io/_iomodule.h
+++ b/Modules/_io/_iomodule.h
@@ -104,7 +104,7 @@
 # define PY_OFF_T_MIN       PY_SSIZE_T_MIN
 # define PY_OFF_T_COMPAT    Py_ssize_t
 # define PY_PRIdOFF         "zd"
-#elif (HAVE_LONG_LONG && SIZEOF_OFF_T == SIZEOF_LONG_LONG)
+#elif (SIZEOF_OFF_T == SIZEOF_LONG_LONG)
 # define PyLong_AsOff_t     PyLong_AsLongLong
 # define PyLong_FromOff_t   PyLong_FromLongLong
 # define PY_OFF_T_MAX       PY_LLONG_MAX
diff --git a/Modules/_lsprof.c b/Modules/_lsprof.c
--- a/Modules/_lsprof.c
+++ b/Modules/_lsprof.c
@@ -2,10 +2,6 @@
 #include "frameobject.h"
 #include "rotatingtree.h"
 
-#if !defined(HAVE_LONG_LONG)
-#error "This module requires long longs!"
-#endif
-
 /*** Selection of a high-precision timer ***/
 
 #ifdef MS_WINDOWS
diff --git a/Modules/_multiprocessing/multiprocessing.h b/Modules/_multiprocessing/multiprocessing.h
--- a/Modules/_multiprocessing/multiprocessing.h
+++ b/Modules/_multiprocessing/multiprocessing.h
@@ -60,7 +60,7 @@
 #if SIZEOF_VOID_P == SIZEOF_LONG
 #  define F_POINTER "k"
 #  define T_POINTER T_ULONG
-#elif defined(HAVE_LONG_LONG) && (SIZEOF_VOID_P == SIZEOF_LONG_LONG)
+#elif SIZEOF_VOID_P == SIZEOF_LONG_LONG
 #  define F_POINTER "K"
 #  define T_POINTER T_ULONGLONG
 #else
diff --git a/Modules/_sqlite/util.c b/Modules/_sqlite/util.c
--- a/Modules/_sqlite/util.c
+++ b/Modules/_sqlite/util.c
@@ -113,7 +113,6 @@
 PyObject *
 _pysqlite_long_from_int64(sqlite_int64 value)
 {
-#ifdef HAVE_LONG_LONG
 # if SIZEOF_LONG_LONG < 8
     if (value > PY_LLONG_MAX || value < PY_LLONG_MIN) {
         return _PyLong_FromByteArray(&value, sizeof(value),
@@ -124,14 +123,6 @@
     if (value > LONG_MAX || value < LONG_MIN)
         return PyLong_FromLongLong(value);
 # endif
-#else
-# if SIZEOF_LONG < 8
-    if (value > LONG_MAX || value < LONG_MIN) {
-        return _PyLong_FromByteArray(&value, sizeof(value),
-                                     IS_LITTLE_ENDIAN, 1 /* signed */);
-    }
-# endif
-#endif
     return PyLong_FromLong(Py_SAFE_DOWNCAST(value, sqlite_int64, long));
 }
 
@@ -139,23 +130,13 @@
 _pysqlite_long_as_int64(PyObject * py_val)
 {
     int overflow;
-#ifdef HAVE_LONG_LONG
     PY_LONG_LONG value = PyLong_AsLongLongAndOverflow(py_val, &overflow);
-#else
-    long value = PyLong_AsLongAndOverflow(py_val, &overflow);
-#endif
     if (value == -1 && PyErr_Occurred())
         return -1;
     if (!overflow) {
-#ifdef HAVE_LONG_LONG
 # if SIZEOF_LONG_LONG > 8
         if (-0x8000000000000000LL <= value && value <= 0x7FFFFFFFFFFFFFFFLL)
 # endif
-#else
-# if SIZEOF_LONG > 8
-        if (-0x8000000000000000L <= value && value <= 0x7FFFFFFFFFFFFFFFL)
-# endif
-#endif
             return value;
     }
     else if (sizeof(value) < sizeof(sqlite_int64)) {
diff --git a/Modules/_struct.c b/Modules/_struct.c
--- a/Modules/_struct.c
+++ b/Modules/_struct.c
@@ -71,10 +71,8 @@
 
 /* We can't support q and Q in native mode unless the compiler does;
    in std mode, they're 8 bytes on all platforms. */
-#ifdef HAVE_LONG_LONG
 typedef struct { char c; PY_LONG_LONG x; } s_long_long;
 #define LONG_LONG_ALIGN (sizeof(s_long_long) - sizeof(PY_LONG_LONG))
-#endif
 
 #ifdef HAVE_C99_BOOL
 #define BOOL_TYPE _Bool
@@ -164,8 +162,6 @@
     return 0;
 }
 
-#ifdef HAVE_LONG_LONG
-
 /* Same, but handling native long long. */
 
 static int
@@ -212,8 +208,6 @@
     return 0;
 }
 
-#endif
-
 /* Same, but handling Py_ssize_t */
 
 static int
@@ -463,8 +457,6 @@
 /* Native mode doesn't support q or Q unless the platform C supports
    long long (or, on Windows, __int64). */
 
-#ifdef HAVE_LONG_LONG
-
 static PyObject *
 nu_longlong(const char *p, const formatdef *f)
 {
@@ -485,8 +477,6 @@
     return PyLong_FromUnsignedLongLong(x);
 }
 
-#endif
-
 static PyObject *
 nu_bool(const char *p, const formatdef *f)
 {
@@ -680,8 +670,6 @@
     return 0;
 }
 
-#ifdef HAVE_LONG_LONG
-
 static int
 np_longlong(char *p, PyObject *v, const formatdef *f)
 {
@@ -701,7 +689,6 @@
     memcpy(p, (char *)&x, sizeof x);
     return 0;
 }
-#endif
 
 
 static int
@@ -785,10 +772,8 @@
     {'L',       sizeof(long),   LONG_ALIGN,     nu_ulong,       np_ulong},
     {'n',       sizeof(size_t), SIZE_T_ALIGN,   nu_ssize_t,     np_ssize_t},
     {'N',       sizeof(size_t), SIZE_T_ALIGN,   nu_size_t,      np_size_t},
-#ifdef HAVE_LONG_LONG
     {'q',       sizeof(PY_LONG_LONG), LONG_LONG_ALIGN, nu_longlong, np_longlong},
     {'Q',       sizeof(PY_LONG_LONG), LONG_LONG_ALIGN, nu_ulonglong,np_ulonglong},
-#endif
     {'?',       sizeof(BOOL_TYPE),      BOOL_ALIGN,     nu_bool,        np_bool},
     {'e',       sizeof(short),  SHORT_ALIGN,    nu_halffloat,   np_halffloat},
     {'f',       sizeof(float),  FLOAT_ALIGN,    nu_float,       np_float},
@@ -831,7 +816,6 @@
 static PyObject *
 bu_longlong(const char *p, const formatdef *f)
 {
-#ifdef HAVE_LONG_LONG
     PY_LONG_LONG x = 0;
     Py_ssize_t i = f->size;
     const unsigned char *bytes = (const unsigned char *)p;
@@ -844,18 +828,11 @@
     if (x >= LONG_MIN && x <= LONG_MAX)
         return PyLong_FromLong(Py_SAFE_DOWNCAST(x, PY_LONG_LONG, long));
     return PyLong_FromLongLong(x);
-#else
-    return _PyLong_FromByteArray((const unsigned char *)p,
-                                  8,
-                                  0, /* little-endian */
-                      1  /* signed */);
-#endif
 }
 
 static PyObject *
 bu_ulonglong(const char *p, const formatdef *f)
 {
-#ifdef HAVE_LONG_LONG
     unsigned PY_LONG_LONG x = 0;
     Py_ssize_t i = f->size;
     const unsigned char *bytes = (const unsigned char *)p;
@@ -865,12 +842,6 @@
     if (x <= LONG_MAX)
         return PyLong_FromLong(Py_SAFE_DOWNCAST(x, unsigned PY_LONG_LONG, long));
     return PyLong_FromUnsignedLongLong(x);
-#else
-    return _PyLong_FromByteArray((const unsigned char *)p,
-                                  8,
-                                  0, /* little-endian */
-                      0  /* signed */);
-#endif
 }
 
 static PyObject *
@@ -1072,7 +1043,6 @@
 static PyObject *
 lu_longlong(const char *p, const formatdef *f)
 {
-#ifdef HAVE_LONG_LONG
     PY_LONG_LONG x = 0;
     Py_ssize_t i = f->size;
     const unsigned char *bytes = (const unsigned char *)p;
@@ -1085,18 +1055,11 @@
     if (x >= LONG_MIN && x <= LONG_MAX)
         return PyLong_FromLong(Py_SAFE_DOWNCAST(x, PY_LONG_LONG, long));
     return PyLong_FromLongLong(x);
-#else
-    return _PyLong_FromByteArray((const unsigned char *)p,
-                                  8,
-                                  1, /* little-endian */
-                      1  /* signed */);
-#endif
 }
 
 static PyObject *
 lu_ulonglong(const char *p, const formatdef *f)
 {
-#ifdef HAVE_LONG_LONG
     unsigned PY_LONG_LONG x = 0;
     Py_ssize_t i = f->size;
     const unsigned char *bytes = (const unsigned char *)p;
@@ -1106,12 +1069,6 @@
     if (x <= LONG_MAX)
         return PyLong_FromLong(Py_SAFE_DOWNCAST(x, unsigned PY_LONG_LONG, long));
     return PyLong_FromUnsignedLongLong(x);
-#else
-    return _PyLong_FromByteArray((const unsigned char *)p,
-                                  8,
-                                  1, /* little-endian */
-                      0  /* signed */);
-#endif
 }
 
 static PyObject *
diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c
--- a/Modules/_testcapimodule.c
+++ b/Modules/_testcapimodule.c
@@ -60,9 +60,7 @@
     CHECK_SIZEOF(SIZEOF_LONG, long);
     CHECK_SIZEOF(SIZEOF_VOID_P, void*);
     CHECK_SIZEOF(SIZEOF_TIME_T, time_t);
-#ifdef HAVE_LONG_LONG
     CHECK_SIZEOF(SIZEOF_LONG_LONG, PY_LONG_LONG);
-#endif
 
 #undef CHECK_SIZEOF
 
@@ -357,7 +355,7 @@
 }
 
 
-/* Tests of PyLong_{As, From}{Unsigned,}Long(), and (#ifdef HAVE_LONG_LONG)
+/* Tests of PyLong_{As, From}{Unsigned,}Long(), and
    PyLong_{As, From}{Unsigned,}LongLong().
 
    Note that the meat of the test is contained in testcapi_long.h.
@@ -402,8 +400,6 @@
 #undef F_U_TO_PY
 #undef F_PY_TO_U
 
-#ifdef HAVE_LONG_LONG
-
 static PyObject *
 raise_test_longlong_error(const char* msg)
 {
@@ -870,8 +866,6 @@
     return Py_None;
 }
 
-#endif  /* ifdef HAVE_LONG_LONG */
-
 static PyObject *
 return_none(void *unused)
 {
@@ -1136,7 +1130,6 @@
     return PyLong_FromLong(value);
 }
 
-#ifdef HAVE_LONG_LONG
 static PyObject *
 getargs_L(PyObject *self, PyObject *args)
 {
@@ -1154,7 +1147,6 @@
         return NULL;
     return PyLong_FromUnsignedLongLong(value);
 }
-#endif
 
 /* This function not only tests the 'k' getargs code, but also the
    PyLong_AsUnsignedLongMask() and PyLong_AsUnsignedLongMask() functions. */
@@ -2279,10 +2271,8 @@
     CHECK_1_FORMAT("%zu", size_t);
 
     /* "%lld" and "%llu" support added in Python 2.7. */
-#ifdef HAVE_LONG_LONG
     CHECK_1_FORMAT("%llu", unsigned PY_LONG_LONG);
     CHECK_1_FORMAT("%lld", PY_LONG_LONG);
-#endif
 
     Py_RETURN_NONE;
 
@@ -3991,14 +3981,12 @@
     {"getargs_l",               getargs_l,                       METH_VARARGS},
     {"getargs_n",               getargs_n,                       METH_VARARGS},
     {"getargs_p",               getargs_p,                       METH_VARARGS},
-#ifdef HAVE_LONG_LONG
     {"getargs_L",               getargs_L,                       METH_VARARGS},
     {"getargs_K",               getargs_K,                       METH_VARARGS},
     {"test_longlong_api",       test_longlong_api,               METH_NOARGS},
     {"test_long_long_and_overflow",
         (PyCFunction)test_long_long_and_overflow, METH_NOARGS},
     {"test_L_code",             (PyCFunction)test_L_code,        METH_NOARGS},
-#endif
     {"getargs_f",               getargs_f,                       METH_VARARGS},
     {"getargs_d",               getargs_d,                       METH_VARARGS},
     {"getargs_D",               getargs_D,                       METH_VARARGS},
@@ -4153,10 +4141,8 @@
     float float_member;
     double double_member;
     char inplace_member[6];
-#ifdef HAVE_LONG_LONG
     PY_LONG_LONG longlong_member;
     unsigned PY_LONG_LONG ulonglong_member;
-#endif
 } all_structmembers;
 
 typedef struct {
@@ -4178,10 +4164,8 @@
     {"T_FLOAT", T_FLOAT, offsetof(test_structmembers, structmembers.float_member), 0, NULL},
     {"T_DOUBLE", T_DOUBLE, offsetof(test_structmembers, structmembers.double_member), 0, NULL},
     {"T_STRING_INPLACE", T_STRING_INPLACE, offsetof(test_structmembers, structmembers.inplace_member), 0, NULL},
-#ifdef HAVE_LONG_LONG
     {"T_LONGLONG", T_LONGLONG, offsetof(test_structmembers, structmembers.longlong_member), 0, NULL},
     {"T_ULONGLONG", T_ULONGLONG, offsetof(test_structmembers, structmembers.ulonglong_member), 0, NULL},
-#endif
     {NULL}
 };
 
@@ -4193,15 +4177,9 @@
         "T_BOOL", "T_BYTE", "T_UBYTE", "T_SHORT", "T_USHORT",
         "T_INT", "T_UINT", "T_LONG", "T_ULONG", "T_PYSSIZET",
         "T_FLOAT", "T_DOUBLE", "T_STRING_INPLACE",
-#ifdef HAVE_LONG_LONG
         "T_LONGLONG", "T_ULONGLONG",
-#endif
         NULL};
-    static const char fmt[] = "|bbBhHiIlknfds#"
-#ifdef HAVE_LONG_LONG
-        "LK"
-#endif
-        ;
+    static const char fmt[] = "|bbBhHiIlknfds#LK";
     test_structmembers *ob;
     const char *s = NULL;
     Py_ssize_t string_len = 0;
@@ -4223,10 +4201,8 @@
                                      &ob->structmembers.float_member,
                                      &ob->structmembers.double_member,
                                      &s, &string_len
-#ifdef HAVE_LONG_LONG
                                      , &ob->structmembers.longlong_member,
                                      &ob->structmembers.ulonglong_member
-#endif
         )) {
         Py_DECREF(ob);
         return NULL;
diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c
--- a/Modules/_tkinter.c
+++ b/Modules/_tkinter.c
@@ -1182,10 +1182,8 @@
 {
         Tcl_WideInt wideValue;
         if (Tcl_GetWideIntFromObj(Tkapp_Interp(tkapp), value, &wideValue) == TCL_OK) {
-#ifdef HAVE_LONG_LONG
             if (sizeof(wideValue) <= SIZEOF_LONG_LONG)
                 return PyLong_FromLongLong(wideValue);
-#endif
             return _PyLong_FromByteArray((unsigned char *)(void *)&wideValue,
                                          sizeof(wideValue),
                                          PY_LITTLE_ENDIAN,
diff --git a/Modules/addrinfo.h b/Modules/addrinfo.h
--- a/Modules/addrinfo.h
+++ b/Modules/addrinfo.h
@@ -141,11 +141,7 @@
  * RFC 2553: protocol-independent placeholder for socket addresses
  */
 #define _SS_MAXSIZE     128
-#ifdef HAVE_LONG_LONG
 #define _SS_ALIGNSIZE   (sizeof(PY_LONG_LONG))
-#else
-#define _SS_ALIGNSIZE   (sizeof(double))
-#endif /* HAVE_LONG_LONG */
 #define _SS_PAD1SIZE    (_SS_ALIGNSIZE - sizeof(u_char) * 2)
 #define _SS_PAD2SIZE    (_SS_MAXSIZE - sizeof(u_char) * 2 - \
                 _SS_PAD1SIZE - _SS_ALIGNSIZE)
@@ -158,11 +154,7 @@
     unsigned short ss_family;           /* address family */
 #endif /* HAVE_SOCKADDR_SA_LEN */
     char        __ss_pad1[_SS_PAD1SIZE];
-#ifdef HAVE_LONG_LONG
     PY_LONG_LONG __ss_align;            /* force desired structure storage alignment */
-#else
-    double __ss_align;          /* force desired structure storage alignment */
-#endif /* HAVE_LONG_LONG */
     char        __ss_pad2[_SS_PAD2SIZE];
 };
 #endif /* !HAVE_SOCKADDR_STORAGE */
diff --git a/Modules/arraymodule.c b/Modules/arraymodule.c
--- a/Modules/arraymodule.c
+++ b/Modules/arraymodule.c
@@ -418,8 +418,6 @@
     return 0;
 }
 
-#ifdef HAVE_LONG_LONG
-
 static PyObject *
 q_getitem(arrayobject *ap, Py_ssize_t i)
 {
@@ -469,7 +467,6 @@
         ((unsigned PY_LONG_LONG *)ap->ob_item)[i] = x;
     return 0;
 }
-#endif
 
 static PyObject *
 f_getitem(arrayobject *ap, Py_ssize_t i)
@@ -521,10 +518,8 @@
     {'I', sizeof(int), II_getitem, II_setitem, "I", 1, 0},
     {'l', sizeof(long), l_getitem, l_setitem, "l", 1, 1},
     {'L', sizeof(long), LL_getitem, LL_setitem, "L", 1, 0},
-#ifdef HAVE_LONG_LONG
     {'q', sizeof(PY_LONG_LONG), q_getitem, q_setitem, "q", 1, 1},
     {'Q', sizeof(PY_LONG_LONG), QQ_getitem, QQ_setitem, "Q", 1, 0},
-#endif
     {'f', sizeof(float), f_getitem, f_setitem, "f", 0, 0},
     {'d', sizeof(double), d_getitem, d_setitem, "d", 0, 0},
     {'\0', 0, 0, 0, 0, 0, 0} /* Sentinel */
@@ -1814,7 +1809,6 @@
         intsize = sizeof(long);
         is_signed = 0;
         break;
-#if HAVE_LONG_LONG
     case 'q':
         intsize = sizeof(PY_LONG_LONG);
         is_signed = 1;
@@ -1823,7 +1817,6 @@
         intsize = sizeof(PY_LONG_LONG);
         is_signed = 0;
         break;
-#endif
     default:
         return UNKNOWN_FORMAT;
     }
@@ -2685,11 +2678,7 @@
         }
     }
     PyErr_SetString(PyExc_ValueError,
-#ifdef HAVE_LONG_LONG
         "bad typecode (must be b, B, u, h, H, i, I, l, L, q, Q, f or d)");
-#else
-        "bad typecode (must be b, B, u, h, H, i, I, l, L, f or d)");
-#endif
     return NULL;
 }
 
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -640,22 +640,14 @@
 #endif /* MS_WINDOWS */
 
 
-#ifdef HAVE_LONG_LONG
-#  define _PyLong_FromDev PyLong_FromLongLong
-#else
-#  define _PyLong_FromDev PyLong_FromLong
-#endif
+#define _PyLong_FromDev PyLong_FromLongLong
 
 
 #if defined(HAVE_MKNOD) && defined(HAVE_MAKEDEV)
 static int
 _Py_Dev_Converter(PyObject *obj, void *p)
 {
-#ifdef HAVE_LONG_LONG
     *((dev_t *)p) = PyLong_AsUnsignedLongLong(obj);
-#else
-    *((dev_t *)p) = PyLong_AsUnsignedLong(obj);
-#endif
     if (PyErr_Occurred())
         return 0;
     return 1;
diff --git a/Modules/resource.c b/Modules/resource.c
--- a/Modules/resource.c
+++ b/Modules/resource.c
@@ -135,13 +135,11 @@
 static PyObject*
 rlimit2py(struct rlimit rl)
 {
-#if defined(HAVE_LONG_LONG)
     if (sizeof(rl.rlim_cur) > sizeof(long)) {
         return Py_BuildValue("LL",
                              (PY_LONG_LONG) rl.rlim_cur,
                              (PY_LONG_LONG) rl.rlim_max);
     }
-#endif
     return Py_BuildValue("ll", (long) rl.rlim_cur, (long) rl.rlim_max);
 }
 
@@ -438,11 +436,9 @@
     PyModule_AddIntMacro(m, RLIMIT_NPTS);
 #endif
 
-#if defined(HAVE_LONG_LONG)
     if (sizeof(RLIM_INFINITY) > sizeof(long)) {
         v = PyLong_FromLongLong((PY_LONG_LONG) RLIM_INFINITY);
     } else
-#endif
     {
         v = PyLong_FromLong((long) RLIM_INFINITY);
     }
diff --git a/Objects/longobject.c b/Objects/longobject.c
--- a/Objects/longobject.c
+++ b/Objects/longobject.c
@@ -992,9 +992,6 @@
     return PyLong_FromUnsignedLong((unsigned long)(Py_uintptr_t)p);
 #else
 
-#ifndef HAVE_LONG_LONG
-#   error "PyLong_FromVoidPtr: sizeof(void*) > sizeof(long), but no long long"
-#endif
 #if SIZEOF_LONG_LONG < SIZEOF_VOID_P
 #   error "PyLong_FromVoidPtr: sizeof(PY_LONG_LONG) < sizeof(void*)"
 #endif
@@ -1017,9 +1014,6 @@
         x = PyLong_AsUnsignedLong(vv);
 #else
 
-#ifndef HAVE_LONG_LONG
-#   error "PyLong_AsVoidPtr: sizeof(void*) > sizeof(long), but no long long"
-#endif
 #if SIZEOF_LONG_LONG < SIZEOF_VOID_P
 #   error "PyLong_AsVoidPtr: sizeof(PY_LONG_LONG) < sizeof(void*)"
 #endif
@@ -1037,8 +1031,6 @@
     return (void *)x;
 }
 
-#ifdef HAVE_LONG_LONG
-
 /* Initial PY_LONG_LONG support by Chris Herborth (chrish at qnx.com), later
  * rewritten to use the newer PyLong_{As,From}ByteArray API.
  */
@@ -1417,8 +1409,6 @@
     return res;
 }
 
-#endif /* HAVE_LONG_LONG */
-
 #define CHECK_BINOP(v,w)                                \
     do {                                                \
         if (!PyLong_Check(v) || !PyLong_Check(w))       \
@@ -3491,17 +3481,7 @@
     /* fast path for single-digit multiplication */
     if (Py_ABS(Py_SIZE(a)) <= 1 && Py_ABS(Py_SIZE(b)) <= 1) {
         stwodigits v = (stwodigits)(MEDIUM_VALUE(a)) * MEDIUM_VALUE(b);
-#ifdef HAVE_LONG_LONG
         return PyLong_FromLongLong((PY_LONG_LONG)v);
-#else
-        /* if we don't have long long then we're almost certainly
-           using 15-bit digits, so v will fit in a long.  In the
-           unlikely event that we're using 30-bit digits on a platform
-           without long long, a large v will just cause us to fall
-           through to the general multiplication code below. */
-        if (v >= LONG_MIN && v <= LONG_MAX)
-            return PyLong_FromLong((long)v);
-#endif
     }
 
     z = k_mul(a, b);
diff --git a/Objects/memoryobject.c b/Objects/memoryobject.c
--- a/Objects/memoryobject.c
+++ b/Objects/memoryobject.c
@@ -1111,9 +1111,7 @@
     case 'h': case 'H': size = sizeof(short); break;
     case 'i': case 'I': size = sizeof(int); break;
     case 'l': case 'L': size = sizeof(long); break;
-    #ifdef HAVE_LONG_LONG
     case 'q': case 'Q': size = sizeof(PY_LONG_LONG); break;
-    #endif
     case 'n': case 'N': size = sizeof(Py_ssize_t); break;
     case 'f': size = sizeof(float); break;
     case 'd': size = sizeof(double); break;
@@ -1158,10 +1156,8 @@
     case 'I': RETURN("I");
     case 'l': RETURN("l");
     case 'L': RETURN("L");
-    #ifdef HAVE_LONG_LONG
     case 'q': RETURN("q");
     case 'Q': RETURN("Q");
-    #endif
     case 'n': RETURN("n");
     case 'N': RETURN("N");
     case 'f': RETURN("f");
@@ -1581,7 +1577,6 @@
     return lu;
 }
 
-#ifdef HAVE_LONG_LONG
 static PY_LONG_LONG
 pylong_as_lld(PyObject *item)
 {
@@ -1611,7 +1606,6 @@
     Py_DECREF(tmp);
     return llu;
 }
-#endif
 
 static Py_ssize_t
 pylong_as_zd(PyObject *item)
@@ -1691,10 +1685,8 @@
     case 'L': UNPACK_SINGLE(lu, ptr, unsigned long); goto convert_lu;
 
     /* native 64-bit */
-    #ifdef HAVE_LONG_LONG
     case 'q': UNPACK_SINGLE(lld, ptr, PY_LONG_LONG); goto convert_lld;
     case 'Q': UNPACK_SINGLE(llu, ptr, unsigned PY_LONG_LONG); goto convert_llu;
-    #endif
 
     /* ssize_t and size_t */
     case 'n': UNPACK_SINGLE(zd, ptr, Py_ssize_t); goto convert_zd;
@@ -1806,7 +1798,6 @@
         break;
 
     /* native 64-bit */
-    #ifdef HAVE_LONG_LONG
     case 'q':
         lld = pylong_as_lld(item);
         if (lld == -1 && PyErr_Occurred())
@@ -1819,7 +1810,6 @@
             goto err_occurred;
         PACK_SINGLE(ptr, llu, unsigned PY_LONG_LONG);
         break;
-    #endif
 
     /* ssize_t and size_t */
     case 'n':
@@ -2656,10 +2646,8 @@
     case 'L': CMP_SINGLE(p, q, unsigned long); return equal;
 
     /* native 64-bit */
-    #ifdef HAVE_LONG_LONG
     case 'q': CMP_SINGLE(p, q, PY_LONG_LONG); return equal;
     case 'Q': CMP_SINGLE(p, q, unsigned PY_LONG_LONG); return equal;
-    #endif
 
     /* ssize_t and size_t */
     case 'n': CMP_SINGLE(p, q, Py_ssize_t); return equal;
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -2636,13 +2636,11 @@
             longflag = 1;
             ++f;
         }
-#ifdef HAVE_LONG_LONG
         else if (f[1] == 'l' &&
                  (f[2] == 'd' || f[2] == 'u' || f[2] == 'i')) {
             longlongflag = 1;
             f += 2;
         }
-#endif
     }
     /* handle the size_t flag. */
     else if (*f == 'z' && (f[1] == 'd' || f[1] == 'u' || f[1] == 'i')) {
@@ -2680,11 +2678,9 @@
             if (longflag)
                 len = sprintf(buffer, "%lu",
                         va_arg(*vargs, unsigned long));
-#ifdef HAVE_LONG_LONG
             else if (longlongflag)
                 len = sprintf(buffer, "%" PY_FORMAT_LONG_LONG "u",
                         va_arg(*vargs, unsigned PY_LONG_LONG));
-#endif
             else if (size_tflag)
                 len = sprintf(buffer, "%" PY_FORMAT_SIZE_T "u",
                         va_arg(*vargs, size_t));
@@ -2699,11 +2695,9 @@
             if (longflag)
                 len = sprintf(buffer, "%li",
                         va_arg(*vargs, long));
-#ifdef HAVE_LONG_LONG
             else if (longlongflag)
                 len = sprintf(buffer, "%" PY_FORMAT_LONG_LONG "i",
                         va_arg(*vargs, PY_LONG_LONG));
-#endif
             else if (size_tflag)
                 len = sprintf(buffer, "%" PY_FORMAT_SIZE_T "i",
                         va_arg(*vargs, Py_ssize_t));
diff --git a/Python/getargs.c b/Python/getargs.c
--- a/Python/getargs.c
+++ b/Python/getargs.c
@@ -769,7 +769,6 @@
         break;
     }
 
-#ifdef HAVE_LONG_LONG
     case 'L': {/* PY_LONG_LONG */
         PY_LONG_LONG *p = va_arg( *p_va, PY_LONG_LONG * );
         PY_LONG_LONG ival;
@@ -793,7 +792,6 @@
         *p = ival;
         break;
     }
-#endif
 
     case 'f': {/* float */
         float *p = va_arg(*p_va, float *);
@@ -2088,10 +2086,8 @@
     case 'I': /* int sized bitfield */
     case 'l': /* long int */
     case 'k': /* long int sized bitfield */
-#ifdef HAVE_LONG_LONG
     case 'L': /* PY_LONG_LONG */
     case 'K': /* PY_LONG_LONG sized bitfield */
-#endif
     case 'n': /* Py_ssize_t */
     case 'f': /* float */
     case 'd': /* double */
diff --git a/Python/modsupport.c b/Python/modsupport.c
--- a/Python/modsupport.c
+++ b/Python/modsupport.c
@@ -260,13 +260,12 @@
             return PyLong_FromUnsignedLong(n);
         }
 
-#ifdef HAVE_LONG_LONG
         case 'L':
             return PyLong_FromLongLong((PY_LONG_LONG)va_arg(*p_va, PY_LONG_LONG));
 
         case 'K':
             return PyLong_FromUnsignedLongLong((PY_LONG_LONG)va_arg(*p_va, unsigned PY_LONG_LONG));
-#endif
+
         case 'u':
         {
             PyObject *v;
diff --git a/Python/pytime.c b/Python/pytime.c
--- a/Python/pytime.c
+++ b/Python/pytime.c
@@ -38,7 +38,7 @@
 time_t
 _PyLong_AsTime_t(PyObject *obj)
 {
-#if defined(HAVE_LONG_LONG) && SIZEOF_TIME_T == SIZEOF_LONG_LONG
+#if SIZEOF_TIME_T == SIZEOF_LONG_LONG
     PY_LONG_LONG val;
     val = PyLong_AsLongLong(obj);
 #else
@@ -57,7 +57,7 @@
 PyObject *
 _PyLong_FromTime_t(time_t t)
 {
-#if defined(HAVE_LONG_LONG) && SIZEOF_TIME_T == SIZEOF_LONG_LONG
+#if SIZEOF_TIME_T == SIZEOF_LONG_LONG
     return PyLong_FromLongLong((PY_LONG_LONG)t);
 #else
     Py_BUILD_ASSERT(sizeof(time_t) <= sizeof(long));
@@ -304,17 +304,10 @@
         return _PyTime_FromFloatObject(t, d, round, unit_to_ns);
     }
     else {
-#ifdef HAVE_LONG_LONG
         PY_LONG_LONG sec;
         Py_BUILD_ASSERT(sizeof(PY_LONG_LONG) <= sizeof(_PyTime_t));
 
         sec = PyLong_AsLongLong(obj);
-#else
-        long sec;
-        Py_BUILD_ASSERT(sizeof(PY_LONG_LONG) <= sizeof(_PyTime_t));
-
-        sec = PyLong_AsLong(obj);
-#endif
         if (sec == -1 && PyErr_Occurred()) {
             if (PyErr_ExceptionMatches(PyExc_OverflowError))
                 _PyTime_overflow();
@@ -365,13 +358,8 @@
 PyObject *
 _PyTime_AsNanosecondsObject(_PyTime_t t)
 {
-#ifdef HAVE_LONG_LONG
     Py_BUILD_ASSERT(sizeof(PY_LONG_LONG) >= sizeof(_PyTime_t));
     return PyLong_FromLongLong((PY_LONG_LONG)t);
-#else
-    Py_BUILD_ASSERT(sizeof(long) >= sizeof(_PyTime_t));
-    return PyLong_FromLong((long)t);
-#endif
 }
 
 static _PyTime_t
diff --git a/Python/structmember.c b/Python/structmember.c
--- a/Python/structmember.c
+++ b/Python/structmember.c
@@ -74,14 +74,12 @@
             PyErr_SetString(PyExc_AttributeError, l->name);
         Py_XINCREF(v);
         break;
-#ifdef HAVE_LONG_LONG
     case T_LONGLONG:
         v = PyLong_FromLongLong(*(PY_LONG_LONG *)addr);
         break;
     case T_ULONGLONG:
         v = PyLong_FromUnsignedLongLong(*(unsigned PY_LONG_LONG *)addr);
         break;
-#endif /* HAVE_LONG_LONG */
     case T_NONE:
         v = Py_None;
         Py_INCREF(v);
@@ -266,7 +264,6 @@
     case T_STRING_INPLACE:
         PyErr_SetString(PyExc_TypeError, "readonly attribute");
         return -1;
-#ifdef HAVE_LONG_LONG
     case T_LONGLONG:{
         PY_LONG_LONG value;
         *(PY_LONG_LONG*)addr = value = PyLong_AsLongLong(v);
@@ -286,7 +283,6 @@
             return -1;
         break;
         }
-#endif /* HAVE_LONG_LONG */
     default:
         PyErr_Format(PyExc_SystemError,
                      "bad memberdescr type for %s", l->name);
diff --git a/configure b/configure
--- a/configure
+++ b/configure
@@ -775,6 +775,7 @@
 docdir
 oldincludedir
 includedir
+runstatedir
 localstatedir
 sharedstatedir
 sysconfdir
@@ -885,6 +886,7 @@
 sysconfdir='${prefix}/etc'
 sharedstatedir='${prefix}/com'
 localstatedir='${prefix}/var'
+runstatedir='${localstatedir}/run'
 includedir='${prefix}/include'
 oldincludedir='/usr/include'
 docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
@@ -1137,6 +1139,15 @@
   | -silent | --silent | --silen | --sile | --sil)
     silent=yes ;;
 
+  -runstatedir | --runstatedir | --runstatedi | --runstated \
+  | --runstate | --runstat | --runsta | --runst | --runs \
+  | --run | --ru | --r)
+    ac_prev=runstatedir ;;
+  -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
+  | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
+  | --run=* | --ru=* | --r=*)
+    runstatedir=$ac_optarg ;;
+
   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
     ac_prev=sbindir ;;
   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@@ -1274,7 +1285,7 @@
 for ac_var in	exec_prefix prefix bindir sbindir libexecdir datarootdir \
 		datadir sysconfdir sharedstatedir localstatedir includedir \
 		oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
-		libdir localedir mandir
+		libdir localedir mandir runstatedir
 do
   eval ac_val=\$$ac_var
   # Remove trailing slashes.
@@ -1427,6 +1438,7 @@
   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
+  --runstatedir=DIR       modifiable per-process data [LOCALSTATEDIR/run]
   --libdir=DIR            object code libraries [EPREFIX/lib]
   --includedir=DIR        C header files [PREFIX/include]
   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
@@ -8294,6 +8306,39 @@
 # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
 # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
 # This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long long" >&5
+$as_echo_n "checking size of long long... " >&6; }
+if ${ac_cv_sizeof_long_long+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long long))" "ac_cv_sizeof_long_long"        "$ac_includes_default"; then :
+
+else
+  if test "$ac_cv_type_long_long" = yes; then
+     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (long long)
+See \`config.log' for more details" "$LINENO" 5; }
+   else
+     ac_cv_sizeof_long_long=0
+   fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_long" >&5
+$as_echo "$ac_cv_sizeof_long_long" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long
+_ACEOF
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of void *" >&5
 $as_echo_n "checking size of void *... " >&6; }
 if ${ac_cv_sizeof_void_p+:} false; then :
@@ -8522,67 +8567,6 @@
 
 
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for long long support" >&5
-$as_echo_n "checking for long long support... " >&6; }
-have_long_long=no
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-long long x; x = (long long)0;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-
-$as_echo "#define HAVE_LONG_LONG 1" >>confdefs.h
-
-  have_long_long=yes
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_long_long" >&5
-$as_echo "$have_long_long" >&6; }
-if test "$have_long_long" = yes ; then
-# The cast to long int works around a bug in the HP C Compiler
-# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-# This bug is HP SR number 8606223364.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long long" >&5
-$as_echo_n "checking size of long long... " >&6; }
-if ${ac_cv_sizeof_long_long+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long long))" "ac_cv_sizeof_long_long"        "$ac_includes_default"; then :
-
-else
-  if test "$ac_cv_type_long_long" = yes; then
-     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error 77 "cannot compute sizeof (long long)
-See \`config.log' for more details" "$LINENO" 5; }
-   else
-     ac_cv_sizeof_long_long=0
-   fi
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_long" >&5
-$as_echo "$ac_cv_sizeof_long_long" >&6; }
-
-
-
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long
-_ACEOF
-
-
-fi
-
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for long double support" >&5
 $as_echo_n "checking for long double support... " >&6; }
 have_long_double=no
@@ -8796,8 +8780,6 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable large file support" >&5
 $as_echo_n "checking whether to enable large file support... " >&6; }
-if test "$have_long_long" = yes
-then
 if test "$ac_cv_sizeof_off_t" -gt "$ac_cv_sizeof_long" -a \
 	"$ac_cv_sizeof_long_long" -ge "$ac_cv_sizeof_off_t"; then
 
@@ -8809,10 +8791,6 @@
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
 
 # The cast to long int works around a bug in the HP C Compiler
 # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
@@ -15853,32 +15831,30 @@
 
 fi
 
-if test "$have_long_long" = yes
-then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for %lld and %llu printf() format support" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for %lld and %llu printf() format support" >&5
 $as_echo_n "checking for %lld and %llu printf() format support... " >&6; }
-  if ${ac_cv_have_long_long_format+:} false; then :
+if ${ac_cv_have_long_long_format+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test "$cross_compiling" = yes; then :
   ac_cv_have_long_long_format="cross -- assuming no"
-   if test x$GCC = xyes; then
-    save_CFLAGS=$CFLAGS
-    CFLAGS="$CFLAGS -Werror -Wformat"
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-        #include <stdio.h>
-        #include <stddef.h>
-
-int
-main ()
-{
-
-      char *buffer;
-      sprintf(buffer, "%lld", (long long)123);
-      sprintf(buffer, "%lld", (long long)-123);
-      sprintf(buffer, "%llu", (unsigned long long)123);
+if test x$GCC = xyes; then
+save_CFLAGS=$CFLAGS
+CFLAGS="$CFLAGS -Werror -Wformat"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <stdio.h>
+#include <stddef.h>
+
+int
+main ()
+{
+
+char *buffer;
+sprintf(buffer, "%lld", (long long)123);
+sprintf(buffer, "%lld", (long long)-123);
+sprintf(buffer, "%llu", (unsigned long long)123);
 
   ;
   return 0;
@@ -15889,41 +15865,41 @@
 
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-    CFLAGS=$save_CFLAGS
-   fi
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-  #include <stdio.h>
-  #include <stddef.h>
-  #include <string.h>
-
-  #ifdef HAVE_SYS_TYPES_H
-  #include <sys/types.h>
-  #endif
-
-  int main()
-  {
-      char buffer[256];
-
-      if (sprintf(buffer, "%lld", (long long)123) < 0)
-          return 1;
-      if (strcmp(buffer, "123"))
-          return 1;
-
-      if (sprintf(buffer, "%lld", (long long)-123) < 0)
-          return 1;
-      if (strcmp(buffer, "-123"))
-          return 1;
-
-      if (sprintf(buffer, "%llu", (unsigned long long)123) < 0)
-          return 1;
-      if (strcmp(buffer, "123"))
-          return 1;
-
-      return 0;
-  }
+CFLAGS=$save_CFLAGS
+fi
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <stdio.h>
+#include <stddef.h>
+#include <string.h>
+
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+
+int main()
+{
+char buffer[256];
+
+if (sprintf(buffer, "%lld", (long long)123) < 0)
+return 1;
+if (strcmp(buffer, "123"))
+return 1;
+
+if (sprintf(buffer, "%lld", (long long)-123) < 0)
+return 1;
+if (strcmp(buffer, "-123"))
+return 1;
+
+if (sprintf(buffer, "%llu", (unsigned long long)123) < 0)
+return 1;
+if (strcmp(buffer, "123"))
+return 1;
+
+return 0;
+}
 
 _ACEOF
 if ac_fn_c_try_run "$LINENO"; then :
@@ -15938,9 +15914,8 @@
 
 fi
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_long_long_format" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_long_long_format" >&5
 $as_echo "$ac_cv_have_long_long_format" >&6; }
-fi
 
 if test "$ac_cv_have_long_long_format" = yes
 then
diff --git a/configure.ac b/configure.ac
--- a/configure.ac
+++ b/configure.ac
@@ -2092,6 +2092,7 @@
 # ANSI C requires sizeof(char) == 1, so no need to check it
 AC_CHECK_SIZEOF(int, 4)
 AC_CHECK_SIZEOF(long, 4)
+AC_CHECK_SIZEOF(long long, 8)
 AC_CHECK_SIZEOF(void *, 4)
 AC_CHECK_SIZEOF(short, 2)
 AC_CHECK_SIZEOF(float, 4)
@@ -2100,17 +2101,6 @@
 AC_CHECK_SIZEOF(size_t, 4)
 AC_CHECK_SIZEOF(pid_t, 4)
 
-AC_MSG_CHECKING(for long long support)
-have_long_long=no
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[long long x; x = (long long)0;]])],[
-  AC_DEFINE(HAVE_LONG_LONG, 1, [Define this if you have the type long long.])
-  have_long_long=yes
-],[])
-AC_MSG_RESULT($have_long_long)
-if test "$have_long_long" = yes ; then
-AC_CHECK_SIZEOF(long long, 8)
-fi
-
 AC_MSG_CHECKING(for long double support)
 have_long_double=no
 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[long double x; x = (long double)0;]])],[
@@ -2150,8 +2140,6 @@
 ])
 
 AC_MSG_CHECKING(whether to enable large file support)
-if test "$have_long_long" = yes
-then
 if test "$ac_cv_sizeof_off_t" -gt "$ac_cv_sizeof_long" -a \
 	"$ac_cv_sizeof_long_long" -ge "$ac_cv_sizeof_off_t"; then
   AC_DEFINE(HAVE_LARGEFILE_SUPPORT, 1,
@@ -2163,9 +2151,6 @@
 else
   AC_MSG_RESULT(no)
 fi
-else
-  AC_MSG_RESULT(no)
-fi
 
 AC_CHECK_SIZEOF(time_t, [], [
 #ifdef HAVE_SYS_TYPES_H
@@ -4925,63 +4910,60 @@
   [Define to 1 if you have the /dev/ptc device file.])
 fi
 
-if test "$have_long_long" = yes
-then
-  AC_MSG_CHECKING(for %lld and %llu printf() format support)
-  AC_CACHE_VAL(ac_cv_have_long_long_format,
-  AC_RUN_IFELSE([AC_LANG_SOURCE([[[
-  #include <stdio.h>
-  #include <stddef.h>
-  #include <string.h>
-
-  #ifdef HAVE_SYS_TYPES_H
-  #include <sys/types.h>
-  #endif
-
-  int main()
-  {
-      char buffer[256];
-
-      if (sprintf(buffer, "%lld", (long long)123) < 0)
-          return 1;
-      if (strcmp(buffer, "123"))
-          return 1;
-
-      if (sprintf(buffer, "%lld", (long long)-123) < 0)
-          return 1;
-      if (strcmp(buffer, "-123"))
-          return 1;
-
-      if (sprintf(buffer, "%llu", (unsigned long long)123) < 0)
-          return 1;
-      if (strcmp(buffer, "123"))
-          return 1;
-
-      return 0;
-  }
-  ]]])],
-  [ac_cv_have_long_long_format=yes],
-  [ac_cv_have_long_long_format=no],
-  [ac_cv_have_long_long_format="cross -- assuming no"
-   if test x$GCC = xyes; then
-    save_CFLAGS=$CFLAGS
-    CFLAGS="$CFLAGS -Werror -Wformat"
-    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-        #include <stdio.h>
-        #include <stddef.h>
-      ]], [[
-      char *buffer;
-      sprintf(buffer, "%lld", (long long)123);
-      sprintf(buffer, "%lld", (long long)-123);
-      sprintf(buffer, "%llu", (unsigned long long)123);
-      ]])],
-      ac_cv_have_long_long_format=yes
-    )
-    CFLAGS=$save_CFLAGS
-   fi])
-  )
-  AC_MSG_RESULT($ac_cv_have_long_long_format)
-fi
+AC_MSG_CHECKING(for %lld and %llu printf() format support)
+AC_CACHE_VAL(ac_cv_have_long_long_format,
+AC_RUN_IFELSE([AC_LANG_SOURCE([[[
+#include <stdio.h>
+#include <stddef.h>
+#include <string.h>
+
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+
+int main()
+{
+char buffer[256];
+
+if (sprintf(buffer, "%lld", (long long)123) < 0)
+return 1;
+if (strcmp(buffer, "123"))
+return 1;
+
+if (sprintf(buffer, "%lld", (long long)-123) < 0)
+return 1;
+if (strcmp(buffer, "-123"))
+return 1;
+
+if (sprintf(buffer, "%llu", (unsigned long long)123) < 0)
+return 1;
+if (strcmp(buffer, "123"))
+return 1;
+
+return 0;
+}
+]]])],
+[ac_cv_have_long_long_format=yes],
+[ac_cv_have_long_long_format=no],
+[ac_cv_have_long_long_format="cross -- assuming no"
+if test x$GCC = xyes; then
+save_CFLAGS=$CFLAGS
+CFLAGS="$CFLAGS -Werror -Wformat"
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#include <stdio.h>
+#include <stddef.h>
+]], [[
+char *buffer;
+sprintf(buffer, "%lld", (long long)123);
+sprintf(buffer, "%lld", (long long)-123);
+sprintf(buffer, "%llu", (unsigned long long)123);
+]])],
+ac_cv_have_long_long_format=yes
+)
+CFLAGS=$save_CFLAGS
+fi])
+)
+AC_MSG_RESULT($ac_cv_have_long_long_format)
 
 if test "$ac_cv_have_long_long_format" = yes
 then
diff --git a/pyconfig.h.in b/pyconfig.h.in
--- a/pyconfig.h.in
+++ b/pyconfig.h.in
@@ -592,9 +592,6 @@
 /* Define this if you have the type long double. */
 #undef HAVE_LONG_DOUBLE
 
-/* Define this if you have the type long long. */
-#undef HAVE_LONG_LONG
-
 /* Define to 1 if you have the `lstat' function. */
 #undef HAVE_LSTAT
 

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list