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

Skip to content

Commit a9217a4

Browse files
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.
1 parent ba2f8be commit a9217a4

4 files changed

Lines changed: 13 additions & 7 deletions

File tree

Misc/NEWS

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ Library
1919
- Issue #15535: Fix namedtuple pickles which were picking up the OrderedDict
2020
instead of just the underlying tuple.
2121

22+
Build
23+
-----
24+
25+
- Issue #17857: Prevent build failures with pre-3.5.0 versions of sqlite3,
26+
such as was shipped with Centos 5 and Mac OS X 10.4.
27+
2228
Tests
2329
-----
2430

Modules/_sqlite/cursor.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,7 @@ PyObject* _pysqlite_query_execute(pysqlite_Cursor* self, int multiple, PyObject*
716716

717717
Py_DECREF(self->lastrowid);
718718
if (!multiple && statement_type == STATEMENT_INSERT) {
719-
sqlite3_int64 lastrowid;
719+
sqlite_int64 lastrowid;
720720
Py_BEGIN_ALLOW_THREADS
721721
lastrowid = sqlite3_last_insert_rowid(self->connection->db);
722722
Py_END_ALLOW_THREADS

Modules/_sqlite/util.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ int _pysqlite_seterror(sqlite3* db, sqlite3_stmt* st)
111111
#endif
112112

113113
PyObject *
114-
_pysqlite_long_from_int64(sqlite3_int64 value)
114+
_pysqlite_long_from_int64(sqlite_int64 value)
115115
{
116116
#ifdef HAVE_LONG_LONG
117117
# if SIZEOF_LONG_LONG < 8
@@ -135,7 +135,7 @@ _pysqlite_long_from_int64(sqlite3_int64 value)
135135
return PyLong_FromLong(value);
136136
}
137137

138-
sqlite3_int64
138+
sqlite_int64
139139
_pysqlite_long_as_int64(PyObject * py_val)
140140
{
141141
int overflow;
@@ -158,8 +158,8 @@ _pysqlite_long_as_int64(PyObject * py_val)
158158
#endif
159159
return value;
160160
}
161-
else if (sizeof(value) < sizeof(sqlite3_int64)) {
162-
sqlite3_int64 int64val;
161+
else if (sizeof(value) < sizeof(sqlite_int64)) {
162+
sqlite_int64 int64val;
163163
if (_PyLong_AsByteArray((PyLongObject *)py_val,
164164
(unsigned char *)&int64val, sizeof(int64val),
165165
IS_LITTLE_ENDIAN, 1 /* signed */) >= 0) {

Modules/_sqlite/util.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ int pysqlite_step(sqlite3_stmt* statement, pysqlite_Connection* connection);
3636
*/
3737
int _pysqlite_seterror(sqlite3* db, sqlite3_stmt* st);
3838

39-
PyObject * _pysqlite_long_from_int64(sqlite3_int64 value);
40-
sqlite3_int64 _pysqlite_long_as_int64(PyObject * value);
39+
PyObject * _pysqlite_long_from_int64(sqlite_int64 value);
40+
sqlite_int64 _pysqlite_long_as_int64(PyObject * value);
4141

4242
#endif

0 commit comments

Comments
 (0)