Skip to content

Instantly share code, notes, and snippets.

@msabramo
Created May 18, 2012 19:02
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save msabramo/2727063 to your computer and use it in GitHub Desktop.
Save msabramo/2727063 to your computer and use it in GitHub Desktop.
Patch to solve sqlite3_int64 error when building Python 2.7.3 on RHEL/CentOS
diff --git a/Modules/_sqlite/connection.c b/Modules/_sqlite/connection.c
index 26678c7..a646513 100644
--- a/Modules/_sqlite/connection.c
+++ b/Modules/_sqlite/connection.c
@@ -549,7 +549,7 @@ void _pysqlite_set_result(sqlite3_context* context, PyObject* py_val)
} else if (py_val == Py_None) {
sqlite3_result_null(context);
} else if (PyInt_Check(py_val)) {
- sqlite3_result_int64(context, (sqlite3_int64)PyInt_AsLong(py_val));
+ sqlite3_result_int64(context, (sqlite_int64)PyInt_AsLong(py_val));
} else if (PyLong_Check(py_val)) {
sqlite3_result_int64(context, PyLong_AsLongLong(py_val));
} else if (PyFloat_Check(py_val)) {
@@ -580,7 +580,7 @@ PyObject* _pysqlite_build_py_params(sqlite3_context *context, int argc, sqlite3_
sqlite3_value* cur_value;
PyObject* cur_py_value;
const char* val_str;
- sqlite3_int64 val_int;
+ sqlite_int64 val_int;
Py_ssize_t buflen;
void* raw_buffer;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment