Good luck everybody! 
 
I made build of Monotone 0.19 with STLport (5.0, CVS) (STL implementation, 
http://www.stlport.org/cgi-bin/forum/dcboard.cgi) 
and found some C++-standard incompatibilities in Monotone's code. The patch is 
suggested here. 
 
General problem was absent of direct #include <cstdio> for EOF and some 
libstd++ implementation-specific 
constructions. 
 
I hope this patch will help to make Monotone compilable by different compilers 
on different platforms. 
 
Bests, 
 
   - ptr 
 
diff -urN monotone-0.19.orig/basic_io.hh monotone-0.19/basic_io.hh
--- monotone-0.19.orig/basic_io.hh	Tue Apr 26 00:39:11 2005
+++ monotone-0.19/basic_io.hh	Tue May 24 07:49:02 2005
@@ -15,6 +15,7 @@
 #include <string>
 #include <vector>
 #include <map>
+#include <cstdio>
 
 namespace basic_io
 {
diff -urN monotone-0.19.orig/change_set.cc monotone-0.19/change_set.cc
--- monotone-0.19.orig/change_set.cc	Fri Apr 29 13:01:36 2005
+++ monotone-0.19/change_set.cc	Sat May 14 00:14:29 2005
@@ -13,7 +13,11 @@
 #include <iostream>
 #include <list>
 #include <vector>
+#ifndef _STLPORT_VERSION
 #include <ext/hash_map>
+#else
+#include <hash_map>
+#endif
 
 #include <boost/filesystem/path.hpp>
 #include <boost/shared_ptr.hpp>
diff -urN monotone-0.19.orig/cryptopp/files.cpp monotone-0.19/cryptopp/files.cpp
--- monotone-0.19.orig/cryptopp/files.cpp	Sun Mar 20 14:05:47 2005
+++ monotone-0.19/cryptopp/files.cpp	Wed May 11 20:14:19 2005
@@ -1,6 +1,7 @@
 // files.cpp - written and placed in the public domain by Wei Dai
 
 #include "pch.h"
+#include <cstdio>
 
 #ifndef CRYPTOPP_IMPORTS
 
diff -urN monotone-0.19.orig/interner.hh monotone-0.19/interner.hh
--- monotone-0.19.orig/interner.hh	Sun Mar 20 14:05:48 2005
+++ monotone-0.19/interner.hh	Sat May 14 00:16:47 2005
@@ -7,7 +7,11 @@
 // see the file COPYING for details
 
 #include <string>
+#ifndef _STLPORT_VERSION
 #include <ext/hash_map>
+#else
+#include <hash_map>
+#endif
 
 #include "sanity.hh"
 
@@ -15,7 +19,11 @@
 {
   size_t operator()(std::string const & s) const
   {
+#ifndef _STLPORT_VERSION
     return __gnu_cxx::__stl_hash_string(s.c_str());
+#else
+    return std::__stl_hash_string(s.c_str());
+#endif
   }
 };
 
@@ -32,9 +40,16 @@
 struct 
 interner 
 {
+#ifndef _STLPORT_VERSION
   typedef typename __gnu_cxx::hash_map<std::string, T, 
                                        string_hash, 
                                        string_eq> hmap;
+#else
+  typedef typename std::hash_map<std::string, T,
+                                       string_hash,
+                                       string_eq> hmap;
+#endif
+
 
   hmap fwd;
   std::vector<std::string> rev;
diff -urN monotone-0.19.orig/lua.cc monotone-0.19/lua.cc
--- monotone-0.19.orig/lua.cc	Wed Apr 27 23:06:37 2005
+++ monotone-0.19/lua.cc	Mon May 23 23:45:24 2005
@@ -15,6 +15,7 @@
 #include <string.h>
 #include <stdarg.h>
 #include <signal.h>
+#include <cstdio>
 #include <boost/lexical_cast.hpp>
 #include <boost/filesystem/path.hpp>
 #include <boost/filesystem/operations.hpp>
diff -urN monotone-0.19.orig/monotone.cc monotone-0.19/monotone.cc
--- monotone-0.19.orig/monotone.cc	Tue May  3 04:51:27 2005
+++ monotone-0.19/monotone.cc	Tue May 24 14:54:49 2005
@@ -12,6 +12,7 @@
 #include <iostream>
 #include <fstream>
 #include <sstream>
+#include <clocale>
 
 #include <stdlib.h>
 #ifdef WIN32
diff -urN monotone-0.19.orig/rcs_file.cc monotone-0.19/rcs_file.cc
--- monotone-0.19.orig/rcs_file.cc	Sun Mar 20 14:05:48 2005
+++ monotone-0.19/rcs_file.cc	Tue May 24 07:18:01 2005
@@ -7,6 +7,7 @@
 #include <iostream>
 #include <string>
 #include <vector>
+#include <cstdio>
 
 #ifdef WIN32
 #include <windows.h>
diff -urN monotone-0.19.orig/rcs_import.cc monotone-0.19/rcs_import.cc
--- monotone-0.19.orig/rcs_import.cc	Tue May  3 04:23:49 2005
+++ monotone-0.19/rcs_import.cc	Tue May 24 07:53:36 2005
@@ -13,6 +13,7 @@
 #include <stdexcept>
 #include <string>
 #include <vector>
+#include <cstdio>
 
 #include <unistd.h>
 
diff -urN monotone-0.19.orig/work.cc monotone-0.19/work.cc
--- monotone-0.19.orig/work.cc	Sat Apr 30 09:08:33 2005
+++ monotone-0.19/work.cc	Tue May 24 00:20:57 2005
@@ -4,6 +4,7 @@
 // see the file COPYING for details
 
 #include <sstream>
+#include <cstdio>
 
 #include "app_state.hh"
 #include "basic_io.hh"
diff -urN monotone-0.19.orig/xdelta.cc monotone-0.19/xdelta.cc
--- monotone-0.19.orig/xdelta.cc	Sun Mar 20 14:05:50 2005
+++ monotone-0.19/xdelta.cc	Tue May 24 07:20:04 2005
@@ -20,8 +20,12 @@
 // if you want to *read* a patch, you will like unidiff format much better.
 // take a look in diff_patch.(cc|hh) for a nice interface to that.
 
-#include <ext/hash_map>
 #include <algorithm>
+#ifndef _STLPORT_VERSION
+#include <ext/hash_map>
+#else
+#include <hash_map>
+#endif
 #include <vector>
 #include <set>
 #include <string>
@@ -36,11 +40,13 @@
 #include "xdelta.hh"
 
 using namespace std;
+#ifndef _STLPORT_VERSION
 using namespace __gnu_cxx;
+#endif
 
 struct identity {size_t operator()(u32 const & v) const { return static_cast<size_t>(v);}};
 typedef pair<string::size_type, string::size_type> extent;
-typedef hash_map<u32, extent, identity> match_table;
+typedef hash_map<u32, extent, ::identity> match_table;
 
 struct 
 insn
_______________________________________________
Monotone-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/monotone-devel

Reply via email to