[Uml-devel] KDE/kdesdk/umbrello/umbrello

Ralf Habacker Ralf.Habacker at freenet.de
Sun Nov 23 11:54:57 UTC 2008


SVN commit 887978 by habacker:

fixed long standing boost/stl/QChar compile problem for msvc


 M  +4 -4      CMakeLists.txt  
 M  +7 -3      codeimport/cppimport.cpp  
 M  +16 -0     codeimport/kdevcppparser/position.h  
 M  +2 -1      codeimport/kdevcppparser/preprocesslexer.h  


--- trunk/KDE/kdesdk/umbrello/umbrello/CMakeLists.txt #887977:887978
@@ -224,8 +224,8 @@
     codeimport/pythonimport.cpp
 )
 
-if (WIN32)
-    # Both MSVC and SunPRO CC have a problem with position.h; we try to put a
+if (WIN32 AND NOT MSVC)
+    # SunPRO CC have a problem with position.h; we try to put a
     # QChar into a spirit iterator, which, after a bunch of futzing, ends up in
     # the STL string_ref templates, which use
     #
@@ -238,7 +238,7 @@
     #
     add_definitions(-DDISABLE_CPP_IMPORT)
     set(libkdevcppparser_SRCS)
-else (WIN32)
+else (WIN32 AND NOT MSVC)
     list(APPEND libcodeimport_SRCS
         codeimport/cppimport.cpp
     )
@@ -255,7 +255,7 @@
         codeimport/kdevcppparser/ast_utils.cpp
         codeimport/kdevcppparser/cpptree2uml.cpp
     )
-endif(WIN32)
+endif(WIN32 AND NOT MSVC)
 
 set(libclipboard_SRCS
     clipboard/umldragdata.cpp
--- trunk/KDE/kdesdk/umbrello/umbrello/codeimport/cppimport.cpp #887977:887978
@@ -14,6 +14,12 @@
 // qt/kde includes
 #include <QMap>
 #include <kdebug.h>
+
+// must be located here for win32 msvc (see kdevcppparser/position.h)
+#include "kdevcppparser/lexer.h"
+#include "kdevcppparser/driver.h"
+#include "kdevcppparser/cpptree2uml.h"
+
 // app includes
 #include "import_utils.h"
 #include "../umlobject.h"
@@ -25,10 +31,8 @@
 #include "../attribute.h"
 #include "../template.h"
 #include "../association.h"
-#include "kdevcppparser/lexer.h"
-#include "kdevcppparser/driver.h"
-#include "kdevcppparser/cpptree2uml.h"
 
+
 // static members
 CppDriver * CppImport::ms_driver;
 QStringList CppImport::ms_seenFiles;
--- trunk/KDE/kdesdk/umbrello/umbrello/codeimport/kdevcppparser/position.h #887977:887978
@@ -20,6 +20,22 @@
 #ifndef POSITION_H
 #define POSITION_H
 
+#ifdef _MSC_VER //Q_CC_MSVC isn't defined here
+/*
+workaround for the following msvc error 
+...\Microsoft Visual Studio 8\VC\INCLUDE\xstring(2044) : error C2620: 
+    member 'std::basic_string<_Elem>::_Bxty::_Buf ' of union 'std::basic_string<_Elem>::_Bxty' 
+    has user-defined constructor or non-trivial default constructor with [  _Elem=QChar]
+...\Microsoft Visual Studio 8\VC\INCLUDE\xstring(2046) : see reference to class 
+    template instantiation 'std::basic_string<_Elem>::_Bxty' being compiled with [  _Elem=QChar]
+..\umbrello\umbrello\codeimport\kdevcppparser\position.h(49) : see reference to class 
+    template instantiation 'std::basic_string<_Elem>' being compiled with [  _Elem=QChar]
+*/
+#define union struct 
+#include <xstring>
+#undef union 
+#endif
+
 #include <limits.h>
 #include <boost/version.hpp>
 #include <boost/spirit.hpp>
--- trunk/KDE/kdesdk/umbrello/umbrello/codeimport/kdevcppparser/preprocesslexer.h #887977:887978
@@ -29,8 +29,9 @@
   bool isdigit_( QChar const& c);
 }}}
 
+// must be first for msvc (see position.h for more informations)
+#include "position.h"
 #include "driver.h"
-#include "position.h"
 #include "skip_rule.hpp"
 
 #include <QtCore/QString>




More information about the umbrello-devel mailing list