]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/helpers.cpp
Changed test for INT32 to work with latest Cygwin. But might break other versions :-(
[wxWidgets.git] / wxPython / src / helpers.cpp
index b7c8510f85eac14c30fb7563ad600bae5daca792..6a196331a39b8e4aa7aee0973f53e43971c24259 100644 (file)
 
 //----------------------------------------------------------------------
 
-
+#ifdef __WXGTK__
+int  WXDLLEXPORT wxEntryStart( int& argc, char** argv );
+#else
 int  WXDLLEXPORT wxEntryStart( int argc, char** argv );
+#endif
 int  WXDLLEXPORT wxEntryInitGui();
 void WXDLLEXPORT wxEntryCleanup();
 
@@ -123,7 +126,7 @@ void __wxPreStart()
 {
 
 #ifdef __WXMSW__
-    wxCrtSetDbgFlag(_CRTDBG_LEAK_CHECK_DF);
+//    wxCrtSetDbgFlag(_CRTDBG_LEAK_CHECK_DF);
 #endif
 
 #ifdef WXP_WITH_THREAD
@@ -438,28 +441,14 @@ PyObject* wxPyConstructObject(void* ptr,
 
 //---------------------------------------------------------------------------
 
-// TODO:  This should really be wxThread::GetCurrentId(), and I will do so
-//        after I make a quick 2.3.2.1 release.
+
 #ifdef WXP_WITH_THREAD
-#ifdef __WXGTK__  // does wxGTK always use pthreads?
-#include <unistd.h>
-#include <pthread.h>
-#endif
 inline
 unsigned long wxPyGetCurrentThreadId() {
-#ifdef __WXMSW__
-    return (unsigned long)::GetCurrentThreadId();
-#endif
-#ifdef __WXGTK__  // does wxGTK always use pthreads?
-    return (unsigned long)pthread_self();
-#endif
-#ifdef __WXMAC__
-#error Fix this!
-#endif
+    return wxThread::GetCurrentId();
 }
 
 
-
 static
 PyThreadState* wxPyGetThreadState() {
     unsigned long ctid = wxPyGetCurrentThreadId();
@@ -1501,6 +1490,18 @@ PyObject* wxArrayString2PyList_helper(const wxArrayString& arr) {
 }
 
 
+PyObject* wxArrayInt2PyList_helper(const wxArrayInt& arr) {
+
+    PyObject* list = PyList_New(0);
+    for (size_t i=0; i < arr.GetCount(); i++) {
+        PyObject* number = PyInt_FromLong(arr[i]);
+        PyList_Append(list, number);
+        Py_DECREF(number);
+    }
+    return list;
+}
+
+
 //----------------------------------------------------------------------
 //----------------------------------------------------------------------