ルギア君の戯言

雑多な記事。

水魚堂の Qt-BSch3V を gcc-4.3.x でビルドできるようにするパッチ

できたぜ。ははは。ちょっと多いけど心して見てくれ。


(おそらく、全部 stdafx.h を include してるから、そこに cstdlib (stdlib.h)をいれればいいんだろうけど、dummy header というコメントがあるのと、ほとんどのプログラムで必要とされるファイルでもそれぞれ include しているから、それに従った。)


ちなみに、オリジナルの日本語の部分は KNOPPIXEUC なのか EUC です。

diff -u -r qbsv047.orig/qtbsch3v/complib.cpp qbsv047/qtbsch3v/complib.cpp
--- qbsv047.orig/qtbsch3v/complib.cpp   2006-07-08 15:02:55.000000000 +0900
+++ qbsv047/qtbsch3v/complib.cpp        2008-09-09 09:57:54.000000000 +0900
@@ -19,6 +19,7 @@                                                          
                                                                           
 //部品ライブラリに関係する3つのクラスのインプリメント                    
 #include "stdafx.h"                                                       
+#include <cstdlib>                                                        
 #include <string.h>                                                       
 #include <assert.h>                                                       
 #include <math.h>                                                         
diff -u -r qbsv047.orig/qtbsch3v/main.cpp qbsv047/qtbsch3v/main.cpp        
--- qbsv047.orig/qtbsch3v/main.cpp      2006-07-08 15:02:57.000000000 +0900
+++ qbsv047/qtbsch3v/main.cpp   2008-09-09 10:19:29.000000000 +0900        
@@ -116,9 +116,9 @@                                                        
        //QApplication::setColorSpec(QApplication::ManyColor);             
        QApplication a( argc, argv );                                      
                                                                           
-#ifdef Q_WS_X11                                                           
-       QApplication::setStyle("windows");                                 
-#endif                                                                    
+// #ifdef Q_WS_X11                                                        
+//     QApplication::setStyle("windows");                                 
+// #endif                                                                 
                                                                           
 #ifdef Q_WS_MACX                                                          
        QApplication::setStyle("plastique");    // Qt4.1.0のデフォルトスタイルのツールバーが大きすぎるため                                                          
diff -u -r qbsv047.orig/qtbsch3v/qtbsch3v.pro qbsv047/qtbsch3v/qtbsch3v.pro       
--- qbsv047.orig/qtbsch3v/qtbsch3v.pro  2006-07-08 15:02:57.000000000 +0900       
+++ qbsv047/qtbsch3v/qtbsch3v.pro       2008-09-09 09:55:47.000000000 +0900       
@@ -2,8 +2,8 @@                                                                   
 # Automatically generated by qmake (2.00a) ? 7 4 07:03:15 2006                   
 ######################################################################           
                                                                                  
-QT += qt3support                                                                 
-#CONFIG += console                                                               
+QT += qt3support                                                                 
+#CONFIG += console                                                               
 TEMPLATE = app                                                                   
 TARGET +=                                                                        
 DEPENDPATH += .                                                                  
diff -u -r qbsv047.orig/qtbsch3v/sptnobjarc.cpp qbsv047/qtbsch3v/sptnobjarc.cpp   
--- qbsv047.orig/qtbsch3v/sptnobjarc.cpp        2006-07-08 15:02:58.000000000 +0900                                                                                 
+++ qbsv047/qtbsch3v/sptnobjarc.cpp     2008-09-09 09:59:35.000000000 +0900       
@@ -21,6 +21,7 @@                                                                 
 #include "stdafx.h"                                                              
 #include "sptnobjarc.h"                                                          
 #include <math.h>                                                                
+#include <cstdlib>                                                               
                                                                                  
 #define M_PI       3.14159265358979323846                                        
                                                                                  
diff -u -r qbsv047.orig/qtbsch3v/sptnobjcircle.cpp qbsv047/qtbsch3v/sptnobjcircle.cpp                                                                               
--- qbsv047.orig/qtbsch3v/sptnobjcircle.cpp     2006-07-08 15:02:58.000000000 +0900                                                                                 
+++ qbsv047/qtbsch3v/sptnobjcircle.cpp  2008-09-09 10:00:08.000000000 +0900       
@@ -21,6 +21,7 @@                                                                 
 #include "stdafx.h"                                                              
 #include "sptnobjcircle.h"                                                       
 #include <math.h>                                                                
+#include <cstdlib>                                                               
                                                                                  
 SPtnObjCircle::SPtnObjCircle(void)                                               
 {                                                                                
diff -u -r qbsv047.orig/qtbsch3v/sptnobjline.cpp qbsv047/qtbsch3v/sptnobjline.cpp 
--- qbsv047.orig/qtbsch3v/sptnobjline.cpp       2006-07-08 15:02:58.000000000 +0900                                                                                 
+++ qbsv047/qtbsch3v/sptnobjline.cpp    2008-09-09 10:00:35.000000000 +0900       
@@ -19,6 +19,7 @@                                                                 
                                                                                  
 #include "stdafx.h"                                                              
 #include "sptnobjline.h"                                                         
+#include <cstdlib>                                                               
                                                                                  
 SPtnObjLine::SPtnObjLine(void)                                                   
 {                                                                                
diff -u -r qbsv047.orig/qtbsch3v/sptnobjpolygon.cpp qbsv047/qtbsch3v/sptnobjpolygon.cpp                                                                             
--- qbsv047.orig/qtbsch3v/sptnobjpolygon.cpp    2006-07-08 15:02:58.000000000 +0900                                                                                 
+++ qbsv047/qtbsch3v/sptnobjpolygon.cpp 2008-09-09 10:01:43.000000000 +0900       
@@ -19,6 +19,8 @@                                                                 
                                                                                  
 #include "stdafx.h"                                                              
 #include "sptnobjpolygon.h"                                                      
+#include <cstdlib>                                                               
+#include <climits>                                                               
                                                                                  
 SPtnObjPolygon::SPtnObjPolygon(void)                                             
 {                                                                                
diff -u -r qbsv047.orig/qtbsch3v/sptnobjtext.cpp qbsv047/qtbsch3v/sptnobjtext.cpp 
--- qbsv047.orig/qtbsch3v/sptnobjtext.cpp       2006-07-08 15:02:58.000000000 +0900                                                                                 
+++ qbsv047/qtbsch3v/sptnobjtext.cpp    2008-09-09 10:08:23.000000000 +0900       
@@ -19,6 +19,7 @@                                                                 
                                                                                  
 #include "stdafx.h"                                                              
 #include "sptnobjtext.h"                                                         
+#include <cstdlib>                                                               
                                                                                  
 SPtnObjText::SPtnObjText(void)                                                   
 {                                                                                
diff -u -r qbsv047.orig/qtbsch3v/xbschcomment.cpp qbsv047/qtbsch3v/xbschcomment.cpp                                                                                 
--- qbsv047.orig/qtbsch3v/xbschcomment.cpp      2006-07-08 15:02:59.000000000 +0900                                                                                 
+++ qbsv047/qtbsch3v/xbschcomment.cpp   2008-09-09 10:09:30.000000000 +0900       
@@ -24,6 +24,7 @@                                                                 
 #include <stdio.h>                                                               
 #include <assert.h>                                                              
 #include <string>                                                                
+#include <cstdlib>                                                               
 using namespace std;                                                             
 #include "ce3io.h"                                                               
 #include "xbschobj.h"                                                            
diff -u -r qbsv047.orig/qtbsch3v/xbschcomponent.cpp qbsv047/qtbsch3v/xbschcomponent.cpp                                                                             
--- qbsv047.orig/qtbsch3v/xbschcomponent.cpp    2006-07-08 15:02:59.000000000 +0900                                                                                 
+++ qbsv047/qtbsch3v/xbschcomponent.cpp 2008-09-09 10:09:59.000000000 +0900       
@@ -25,6 +25,7 @@                                                                 
 #include <assert.h>                                                              
 #include <list>                                                                  
 #include <string>                                                                
+#include <cstdlib>                                                               
 using namespace std;                                                             
 #include "ce3io.h"                                                               
 #include "xbschglobal.h"                                                         
diff -u -r qbsv047.orig/qtbsch3v/xbschdoc.cpp qbsv047/qtbsch3v/xbschdoc.cpp       
--- qbsv047.orig/qtbsch3v/xbschdoc.cpp  2006-07-08 15:02:59.000000000 +0900       
+++ qbsv047/qtbsch3v/xbschdoc.cpp       2008-09-09 10:11:13.000000000 +0900       
@@ -26,8 +26,9 @@                                                                 
 //#include <qclipboard.h>                                                        
 #include <stdio.h>                                                               
 #include <assert.h>                                                              
-#include <string>                                                                
+#include <string.h>                                                              
 #include <list>                                                                  
+#include <climits>                                                               
 using namespace std;                                                             
 #include "ce3io.h"                                                               
 //#include "xbschobj.h"                                                          
diff -u -r qbsv047.orig/qtbsch3v/xbschjunc.cpp qbsv047/qtbsch3v/xbschjunc.cpp     
--- qbsv047.orig/qtbsch3v/xbschjunc.cpp 2006-07-08 15:02:59.000000000 +0900       
+++ qbsv047/qtbsch3v/xbschjunc.cpp      2008-09-09 10:13:36.000000000 +0900       
@@ -24,6 +24,7 @@                                                                 
 #include <stdio.h>                                                               
 //#include <qnamespace.h>                                                        
 #include <string>                                                                
+#include <cstdlib>                                                               
 using namespace std;                                                             
 #include "ce3io.h"                                                               
 #include "xbschobj.h"                                                            
diff -u -r qbsv047.orig/qtbsch3v/xbschlabel.cpp qbsv047/qtbsch3v/xbschlabel.cpp   
--- qbsv047.orig/qtbsch3v/xbschlabel.cpp        2006-07-08 15:02:59.000000000 +0900                                                                                 
+++ qbsv047/qtbsch3v/xbschlabel.cpp     2008-09-09 10:14:01.000000000 +0900       
@@ -24,6 +24,7 @@                                                                 
 #include <stdio.h>                                                               
 #include <assert.h>                                                              
 #include <string>                                                                
+#include <cstdlib>                                                               
 using namespace std;                                                             
 #include "ce3io.h"                                                               
 #include "xbschobj.h"                                                            
diff -u -r qbsv047.orig/qtbsch3v/xbschline.cpp qbsv047/qtbsch3v/xbschline.cpp
--- qbsv047.orig/qtbsch3v/xbschline.cpp 2006-07-08 15:02:59.000000000 +0900
+++ qbsv047/qtbsch3v/xbschline.cpp      2008-09-09 10:14:28.000000000 +0900
@@ -25,6 +25,7 @@
 #include <assert.h>
 #include <limits.h>
 #include <string>
+#include <cstdlib>
 using namespace std;
 #include "ce3io.h"
 #include "xbschobj.h"
diff -u -r qbsv047.orig/qtbsch3v/xbschsheetinfo.cpp qbsv047/qtbsch3v/xbschsheetinfo.cpp
--- qbsv047.orig/qtbsch3v/xbschsheetinfo.cpp    2006-07-08 15:03:00.000000000 +0900
+++ qbsv047/qtbsch3v/xbschsheetinfo.cpp 2008-09-09 10:14:59.000000000 +0900
@@ -23,6 +23,7 @@
 #include "stdafx.h"
 #include <stdio.h>
 #include <string>
+#include <cstdlib>
 using namespace std;
 #include "ce3io.h"

diff -u -r qbsv047.orig/qtbsch3v/xbschtag.cpp qbsv047/qtbsch3v/xbschtag.cpp
--- qbsv047.orig/qtbsch3v/xbschtag.cpp  2006-07-08 15:03:00.000000000 +0900
+++ qbsv047/qtbsch3v/xbschtag.cpp       2008-09-09 10:15:28.000000000 +0900
@@ -24,6 +24,7 @@
 #include <stdio.h>
 #include <assert.h>
 #include <string>
+#include <cstdlib>
 using namespace std;
 #include "ce3io.h"
 #include "xbschobj.h"

KDE 4 だと windows スタイルは格好悪いので Oxygen を使うようにコメントアウトしちゃいました。
ふう。もしかして LCoV とかもこれをやらなくちゃいけないのか・・・


ちなみに、cstdlib で必要なものが全部 atoi 関数w
やっぱり、stdio.h や stdlib.h を標準で取り込まなくなるという話は本当だったんだ・・・(ぁ