libgtk3: bump version to 3.22.11
[buildroot-gz.git] / package / python / 0013-sqlite3-fix-build-when-threads-are-not-used-availabl.patch
blobdfc11efc7eceb9ec4fbcb5d27fd80628a49c32bd
1 From 0f0be88526ece7d2f6ee21c1f59b1546ec6dc7c0 Mon Sep 17 00:00:00 2001
2 From: "Yann E. MORIN" <yann.morin.1998@free.fr>
3 Date: Tue, 7 Mar 2017 22:25:14 +0100
4 Subject: [PATCH] sqlite3: fix build when threads are not used/available
6 When threads are not used/available, a function in the sqlite3 extension
7 ends up with a label at the end:
9 void _pysqlite_final_callback(sqlite3_context* context)
11 PyObject* function_result;
12 PyObject** aggregate_instance;
13 int ok;
15 #ifdef WITH_THREAD
16 PyGILState_STATE threadstate;
18 threadstate = PyGILState_Ensure();
19 #endif
21 aggregate_instance = (PyObject**)sqlite3_aggregate_context(context, sizeof(PyObject*));
22 if (!*aggregate_instance) {
23 goto error;
26 [......]
28 error:
29 #ifdef WITH_THREAD
30 PyGILState_Release(threadstate);
31 #endif
34 This is not valid, and gcc complains.
36 Fix that by adding a dummy statement after the label, so that the label
37 is never the last statement of the function.
39 Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
40 ---
41 Modules/_sqlite/connection.c | 1 +
42 1 file changed, 1 insertion(+)
44 diff --git a/Modules/_sqlite/connection.c b/Modules/_sqlite/connection.c
45 index 237d6e4..cdf69ab 100644
46 --- a/Modules/_sqlite/connection.c
47 +++ b/Modules/_sqlite/connection.c
48 @@ -794,6 +794,7 @@ error:
49 #ifdef WITH_THREAD
50 PyGILState_Release(threadstate);
51 #endif
52 + ; /* Make gcc happy: a label can't be at the end of a function */
55 static void _pysqlite_drop_unused_statement_references(pysqlite_Connection* self)
56 --
57 2.7.4