aboutsummaryrefslogtreecommitdiffstats
path: root/libsdl/libsdl-qpe-1.2.7/pygame.patch
blob: f13a945ee29dd79da120a1c0b89de498fb8825da (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
--- SDL-1.2.7/src/main/qtopia/SDL_qtopia_main.cc~pygame.patch	2003-12-14 16:55:53.000000000 +1030
+++ SDL-1.2.7/src/main/qtopia/SDL_qtopia_main.cc	2004-05-11 01:20:46.000000000 +0930
@@ -16,7 +16,7 @@
 // some issues in Qtopia where there are left-over qcop files in /tmp/.
 // I'm guessing this will also clean up the taskbar in the Sharp version
 // of Qtopia.
-static inline void cleanupQCop() {
+static void cleanupQCop() {
   QString appname(qApp->argv()[0]);
   int slash = appname.findRev("/");
   if(slash != -1) {  appname = appname.mid(slash+1); }
@@ -27,19 +27,25 @@
 }
 
 static QPEApplication *app;
+
+extern "C" void initQCop(int argc, char *argv[]) {
+
+  app = new QPEApplication(argc, argv);
+  QWidget dummy;
+  app->showMainWidget(&dummy);
+  atexit(cleanupQCop);
+}
+
 #endif
 
 extern int SDL_main(int argc, char *argv[]);
 
-int main(int argc, char *argv[])
+extern "C" int main(int argc, char *argv[])
 {
 #ifdef QWS
   // This initializes the Qtopia application. It needs to be done here
   // because it parses command line options.
-  app = new QPEApplication(argc, argv);
-  QWidget dummy;
-  app->showMainWidget(&dummy);
-  atexit(cleanupQCop);
+  initQCop(argc, argv);
 #endif
   // Exit here because if return is used, the application
   // doesn't seem to quit correctly.