The cirros image was rebuilt against the 3.13.0-83 kernel, drivers e1000e, igbvf...
[packages/trusty/cirros-testvm.git] / cirros-testvm / src-cirros / buildroot-2015.05 / package / python / 015-fix-sqlite-without-threads.patch
1 sqlite3: fix build when threads are not used/available
2
3 When threads are not used/available, a function in the sqlite3 extension
4 ends up with a label at the end:
5
6     void _pysqlite_final_callback(sqlite3_context* context)
7     {
8         PyObject* function_result;
9         PyObject** aggregate_instance;
10         int ok;
11
12     #ifdef WITH_THREAD
13         PyGILState_STATE threadstate;
14
15         threadstate = PyGILState_Ensure();
16     #endif
17
18         aggregate_instance = (PyObject**)sqlite3_aggregate_context(context, sizeof(PyObject*));
19         if (!*aggregate_instance) {
20             goto error;
21         }
22
23         [......]
24
25     error:
26     #ifdef WITH_THREAD
27         PyGILState_Release(threadstate);
28     #endif
29     }
30
31 This is not valid, and gcc complains.
32
33 Fix that by adding a dummy statement after the label, so that the label
34 is never the last statement of the function.
35
36 Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
37
38 Index: b/Modules/_sqlite/connection.c
39 ===================================================================
40 --- a/Modules/_sqlite/connection.c
41 +++ b/Modules/_sqlite/connection.c
42 @@ -786,6 +786,7 @@
43  #ifdef WITH_THREAD
44      PyGILState_Release(threadstate);
45  #endif
46 +    ;   /* Make gcc happy: a label can't be at the end of a function */
47  }
48  
49  static void _pysqlite_drop_unused_statement_references(pysqlite_Connection* self)