#endif
#ifdef WXP_WITH_THREAD
+#if 0 // OLD THREAD STUFF
PyEval_InitThreads();
wxPyEventThreadState = PyThreadState_Get();
+#else
+ PyEval_InitThreads();
+ wxPyEventThreadState = PyThreadState_New(PyThreadState_Get()->interp);
+#endif
#endif
// Bail out if there is already windows created. This means that the
// already have the lock. (I hope!)
//
#ifdef WXP_WITH_THREAD
+#if 0 // OLD THREAD STUFF
if (wxPyEventThreadState != myPyThreadState_Get()) {
PyEval_RestoreThread(wxPyEventThreadState);
return TRUE;
}
else
+#else
+ if (wxPyEventThreadState != myPyThreadState_Get()) {
+ PyEval_AcquireThread(wxPyEventThreadState);
+ return TRUE;
+ }
+ else
+#endif
#endif
return FALSE;
}
void wxPySaveThread(bool doSave) {
#ifdef WXP_WITH_THREAD
+#if 0 // OLD THREAD STUFF
if (doSave) {
wxPyEventThreadState = PyEval_SaveThread();
}
+#else
+ if (doSave) {
+ PyEval_ReleaseThread(wxPyEventThreadState);
+ }
+#endif
#endif
}
// otherwise a string is expected
else if (PyString_Check(source)) {
wxString spec = PyString_AS_STRING(source);
- if (spec[0] == '#' && spec.Length() == 7) { // It's #RRGGBB
+ if (spec[0U] == '#' && spec.Length() == 7) { // It's #RRGGBB
char* junk;
int red = strtol(spec.Mid(1,2), &junk, 16);
int green = strtol(spec.Mid(3,2), &junk, 16);