]> granicus.if.org Git - python/commitdiff
Issue #17857: Prevent build failures with pre-3.5.0 versions of sqlite3,
authorSerhiy Storchaka <storchaka@gmail.com>
Sun, 28 Apr 2013 11:10:27 +0000 (14:10 +0300)
committerSerhiy Storchaka <storchaka@gmail.com>
Sun, 28 Apr 2013 11:10:27 +0000 (14:10 +0300)
such as was shipped with Centos 5 and Mac OS X 10.4.

Misc/NEWS
Modules/_sqlite/cursor.c
Modules/_sqlite/util.c
Modules/_sqlite/util.h

index 8710c105c8e9229520f6f772ed5c82c0243788ef..cdf4f375c53d6d68a8e5d3740ec17ed7471d2e95 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -19,6 +19,12 @@ Library
 - Issue #15535: Fix namedtuple pickles which were picking up the OrderedDict
   instead of just the underlying tuple.
 
+Build
+-----
+
+- Issue #17857: Prevent build failures with pre-3.5.0 versions of sqlite3,
+  such as was shipped with Centos 5 and Mac OS X 10.4.
+
 Tests
 -----
 
index fc4b608abfa33515b5afb241bf281c97ceccbd2e..30c2206ae65158a8c0db2c56f9ca5b2551c83225 100644 (file)
@@ -716,7 +716,7 @@ PyObject* _pysqlite_query_execute(pysqlite_Cursor* self, int multiple, PyObject*
 
         Py_DECREF(self->lastrowid);
         if (!multiple && statement_type == STATEMENT_INSERT) {
-            sqlite3_int64 lastrowid;
+            sqlite_int64 lastrowid;
             Py_BEGIN_ALLOW_THREADS
             lastrowid = sqlite3_last_insert_rowid(self->connection->db);
             Py_END_ALLOW_THREADS
index a1a462c8e5fddf4df689086d2ed16846afd9156a..d88bc3fc535d69bf1b028032a7b6a91a3426619b 100644 (file)
@@ -111,7 +111,7 @@ int _pysqlite_seterror(sqlite3* db, sqlite3_stmt* st)
 #endif
 
 PyObject *
-_pysqlite_long_from_int64(sqlite3_int64 value)
+_pysqlite_long_from_int64(sqlite_int64 value)
 {
 #ifdef HAVE_LONG_LONG
 # if SIZEOF_LONG_LONG < 8
@@ -135,7 +135,7 @@ _pysqlite_long_from_int64(sqlite3_int64 value)
     return PyLong_FromLong(value);
 }
 
-sqlite3_int64
+sqlite_int64
 _pysqlite_long_as_int64(PyObject * py_val)
 {
     int overflow;
@@ -158,8 +158,8 @@ _pysqlite_long_as_int64(PyObject * py_val)
 #endif
             return value;
     }
-    else if (sizeof(value) < sizeof(sqlite3_int64)) {
-        sqlite3_int64 int64val;
+    else if (sizeof(value) < sizeof(sqlite_int64)) {
+        sqlite_int64 int64val;
         if (_PyLong_AsByteArray((PyLongObject *)py_val,
                                 (unsigned char *)&int64val, sizeof(int64val),
                                 IS_LITTLE_ENDIAN, 1 /* signed */) >= 0) {
index ca02149352803a7745faf63c73ff788e55aa0156..88ea90689d518c0e92f771b635acb9e763c822fa 100644 (file)
@@ -36,7 +36,7 @@ int pysqlite_step(sqlite3_stmt* statement, pysqlite_Connection* connection);
  */
 int _pysqlite_seterror(sqlite3* db, sqlite3_stmt* st);
 
-PyObject * _pysqlite_long_from_int64(sqlite3_int64 value);
-sqlite3_int64 _pysqlite_long_as_int64(PyObject * value);
+PyObject * _pysqlite_long_from_int64(sqlite_int64 value);
+sqlite_int64 _pysqlite_long_as_int64(PyObject * value);
 
 #endif