[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    [PATCH] Fix for kdebase/nsplugins error build
From:       fenix <fenix () club-internet ! fr>
Date:       2002-07-05 17:42:19
[Download RAW message or body]

I have checked out kdebase from 20 minutes ago.. there is a compile
problem...

bin/sh ../libtool --silent --mode=compile --tag=CXX g++ -DHAVE_CONFIG_H
-I. -I. -I.. -I../libltdl -I/home/kde3/kde3/include
-I/home/kde3/CVS/qt-copy/include -I/usr/X11R6/include  
-DQT_THREAD_SUPPORT  -D_REENTRANT  -Wnon-virtual-dtor -Wno-long-long
-Wbad-function-cast -Wundef -Wall -pedantic -W -Wpointer-arith
-Wmissing-prototypes -Wwrite-strings -ansi -D_XOPEN_SOURCE=500
-D_BSD_SOURCE -Wcast-align -Wconversion -DNDEBUG -DNO_DEBUG -O2
-fno-exceptions -fno-check-new -DQT_CLEAN_NAMESPACE -DQT_NO_COMPAT
-DQT_NO_ASCII_CAST -D_GNU_SOURCE  -c -o libnsplugin_la.all_cpp.lo `test
-f libnsplugin_la.all_cpp.cpp || echo './'`libnsplugin_la.all_cpp.cpp
objprelink .libs/libnsplugin_la.all_cpp.o
objprelink .libs/libnsplugin_la.all_cpp.o
In file included from libnsplugin_la.all_cpp.cpp:5:
kqeventutil.cpp: In static member function `static QString
KQEventUtil::getQtEventName(QEvent*)':
kqeventutil.cpp:31: parse error before numeric constant
In file included from libnsplugin_la.all_cpp.cpp:5:
kqeventutil.cpp:33: warning: unreachable code at beginning of switch
statement
make[1]: *** [libnsplugin_la.all_cpp.lo] Erreur 1
make[1]: Quitte le répertoire `/home/kde3/CVS/kde/kdebase/nsplugins'
make: *** [all-recursive] Erreur 1


its another name clashes between X and Qt (None and QEvent::None)
i have attached an ugly patch for this but a kdelibs header who avoid
X-Qt name clashes must be the right solution

 FeniX



["nsplug.patch" (nsplug.patch)]

? test.cpp
Index: knspluginembed.cpp
===================================================================
RCS file: /home/kde/kdebase/nsplugins/knspluginembed.cpp,v
retrieving revision 1.5
diff -u -u -r1.5 knspluginembed.cpp
--- knspluginembed.cpp	5 Jul 2002 01:16:01 -0000	1.5
+++ knspluginembed.cpp	5 Jul 2002 15:59:41 -0000
@@ -31,15 +31,31 @@
 #include <X11/Xutil.h>
 #include <X11/Xatom.h>
 // avoid name clashes between X and Qt
-const int XFocusOut = FocusOut;
-const int XFocusIn = FocusIn;
-const int XKeyPress = KeyPress;
-const int XKeyRelease = KeyRelease;
-#undef KeyRelease
-#undef KeyPress
-#undef FocusOut
-#undef FocusIn
-
+#if !defined( XFocusOut ) && defined( FocusOut )
+const int _XFocusOut = FocusOut;
+# define XFocusOut _XFocusOut
+# undef FocusOut
+#endif
+#if !defined( XFocusIn ) && defined( FocusIn )
+const int _XFocusIn = FocusIn;
+# define XFocusIn _XFocusIn
+# undef FocusIn
+#endif
+#if !defined( XKeyPress ) && defined( KeyPress )
+const int _XKeyPress = KeyPress;
+# define XKeyPress _XKeyPress
+# undef KeyPress
+#endif
+#if !defined( XKeyRelease ) && defined( KeyRelease )
+const int _XKeyRelease = KeyRelease;
+# define XKeyRelease _XKeyRelease
+# undef KeyRelease
+#endif
+#if !defined( XNone ) && defined( None )
+const int _XNone = None;
+# define XNone _XNone
+# undef None
+#endif
 
 #include "kqeventutil.h"
 #include "kxeventutil.h"
@@ -328,7 +344,7 @@
         c.width = width();
         c.height = height();
         c.border_width = 0;
-        c.above = None;
+        c.above = XNone;
         c.override_redirect = 0;
         XSendEvent( qt_xdisplay(), c.event, TRUE, StructureNotifyMask, (XEvent*)&c );
     }
Index: kxeventutil.cpp
===================================================================
RCS file: /home/kde/kdebase/nsplugins/kxeventutil.cpp,v
retrieving revision 1.1
diff -u -u -r1.1 kxeventutil.cpp
--- kxeventutil.cpp	5 Jul 2002 01:16:02 -0000	1.1
+++ kxeventutil.cpp	5 Jul 2002 15:59:41 -0000
@@ -25,6 +25,32 @@
 #include <X11/Xatom.h>
 #include <qstring.h>
 #include <qstringlist.h>
+// avoid name clashes between X and Qt
+#if !defined( XFocusOut ) && defined( FocusOut )
+const int _XFocusOut = FocusOut;
+# define XFocusOut _XFocusOut
+# undef FocusOut
+#endif
+#if !defined( XFocusIn ) && defined( FocusIn )
+const int _XFocusIn = FocusIn;
+# define XFocusIn _XFocusIn
+# undef FocusIn
+#endif
+#if !defined( XKeyPress ) && defined( KeyPress )
+const int _XKeyPress = KeyPress;
+# define XKeyPress _XKeyPress
+# undef KeyPress
+#endif
+#if !defined( XKeyRelease ) && defined( KeyRelease )
+const int _XKeyRelease = KeyRelease;
+# define XKeyRelease _XKeyRelease
+# undef KeyRelease
+#endif
+#if !defined( XNone ) && defined( None )
+const int _XNone = None;
+# define XNone _XNone
+//# undef None
+#endif
 
 #include "kxeventutil.h"
 
@@ -276,11 +302,11 @@
     QString s;
     switch( e->type )
     {
-        case KeyPress:
+        case XKeyPress:
             s = "KeyPress";
             info = getXKeyEventInfo(e);
             break;
-        case KeyRelease:
+        case XKeyRelease:
             s = "KeyRelease";
             info = getXKeyEventInfo(e);
             break;
@@ -304,11 +330,11 @@
             s = "LeaveNotify";
             info = getXCrossingEventInfo(e);
             break;
-        case FocusIn:
+        case XFocusIn:
             s = "FocusIn";
             info = getXFocusChangeEventInfo(e);
             break;
-        case FocusOut:
+        case XFocusOut:
             s = "FocusOut";
             info = getXFocusChangeEventInfo(e);
             break;


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic