[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gEDA: icarus verilog patch for g++ 4.0



Hi,

Here's a patch that Debian is using to build Icarus verilog 0.8 with g++
4.0. We are currently having a mass transition to gcc/g++ 4.0.

Steve, I attempted to email you this directly but your system won't
accept my mail because it comes from "pro-spam lawyers CIHost".
Does this come from one of the RBLs in particular? I do route my
outbound mail through a server rented from CIHost.

Hamish


--- verilog-0.8.orig/parse_api.h
+++ verilog-0.8/parse_api.h
@@ -35,8 +35,8 @@
  * Verilog source into pform for elaboration. The parser adds modules
  * to these maps as it compiles modules in the verilog source.
  */
-extern map<perm_string,Module*> pform_modules;
-extern map<perm_string,PUdp*>   pform_primitives;
+extern std::map<perm_string,Module*> pform_modules;
+extern std::map<perm_string,PUdp*>   pform_primitives;
 
 /*
  * This code actually invokes the parser to make modules. The first
@@ -47,7 +47,7 @@
  */
 extern int  pform_parse(const char*path, FILE*file =0);
 
-extern string vl_file;
+extern std::string vl_file;
 
 /*
  * $Log: parse_api.h,v $
--- verilog-0.8.orig/PUdp.h
+++ verilog-0.8/PUdp.h
@@ -55,20 +55,20 @@
     public:
       explicit PUdp(perm_string n, unsigned nports);
 
-      svector<string>ports;
+      svector<std::string>ports;
       unsigned find_port(const char*name);
 
       bool sequential;
 
-      svector<string>tinput;
+      svector<std::string>tinput;
       svector<char>  tcurrent;
       svector<char>  toutput;
 
       verinum::V initial;
 
-      map<string,PExpr*> attributes;
+      std::map<std::string,PExpr*> attributes;
 
-      void dump(ostream&out) const;
+      void dump(std::ostream&out) const;
 
       perm_string name_;
     private:
--- verilog-0.8.orig/StringHeap.cc
+++ verilog-0.8/StringHeap.cc
@@ -131,7 +131,7 @@
       return perm_string(add(text));
 }
 
-perm_string StringHeapLex::make(const string&text)
+perm_string StringHeapLex::make(const std::string&text)
 {
       return perm_string(add(text.c_str()));
 }
--- verilog-0.8.orig/LineInfo.cc
+++ verilog-0.8/LineInfo.cc
@@ -34,12 +34,12 @@
 {
 }
 
-string LineInfo::get_line() const
+std::string LineInfo::get_line() const
 {
-      ostringstream buf;
+      std::ostringstream buf;
       buf << (file_? file_ : "") << ":" << lineno_;
 
-      string res = buf.str();
+      std::string res = buf.str();
       return res;
 }
 
--- verilog-0.8.orig/svector.h
+++ verilog-0.8/svector.h
@@ -101,8 +101,8 @@
  * Override the implementation of the above template for the string
  * type parameter. The initialization to nil works different here.
  */
-inline svector<string>::svector<string>(unsigned size)
-: nitems_(size), items_(new string[size])
+template <> inline svector<std::string>::svector(unsigned size)
+: nitems_(size), items_(new std::string[size])
 {
 }
 
--- verilog-0.8.orig/netlist.h
+++ verilog-0.8/netlist.h
@@ -60,6 +60,9 @@
 class NetEVariable;
 class NetFuncDef;
 
+class NetRamDq;
+class NetEvTrig;
+class NetEvWait;
 
 struct target;
 struct functor_t;
--- verilog-0.8.orig/verireal.cc
+++ verilog-0.8/verireal.cc
@@ -124,7 +124,7 @@
       return res;
 }
 
-ostream& operator<< (ostream&out, const verireal&v)
+std::ostream& operator<< (std::ostream&out, const verireal&v)
 {
       out << v.value_;
       return out;
--- verilog-0.8.orig/verinum.cc
+++ verilog-0.8/verinum.cc
@@ -41,7 +41,7 @@
       }
 }
 
-verinum::verinum(const string&str)
+verinum::verinum(const std::string&str)
 : has_len_(true), has_sign_(false), string_flag_(true)
 {
       nbits_ = str.length() * 8;
@@ -257,7 +257,7 @@
       return val;
 }
 
-string verinum::as_string() const
+std::string verinum::as_string() const
 {
       assert( nbits_%8 == 0 );
       if (nbits_ == 0)
@@ -283,7 +283,7 @@
       }
 
       tmp[nbits_/8] = 0;
-      string result = string(tmp);
+      std::string result = std::string(tmp);
       delete[]tmp;
       return result;
 }
@@ -370,7 +370,7 @@
       return tmp;
 }
 
-ostream& operator<< (ostream&o, verinum::V v)
+std::ostream& operator<< (std::ostream&o, verinum::V v)
 {
       switch (v) {
 	  case verinum::V0:
@@ -393,7 +393,7 @@
  * This operator is used by various dumpers to write the verilog
  * number in a Verilog format.
  */
-ostream& operator<< (ostream&o, const verinum&v)
+std::ostream& operator<< (std::ostream&o, const verinum&v)
 {
       if (v.is_string()) {
 	    o << "\"" << v.as_string() << "\"";
--- verilog-0.8.orig/LineInfo.h
+++ verilog-0.8/LineInfo.h
@@ -38,7 +38,7 @@
       LineInfo();
       ~LineInfo();
 
-      string get_line() const;
+      std::string get_line() const;
 
       void set_line(const LineInfo&that);
 
--- verilog-0.8.orig/verireal.h
+++ verilog-0.8/verireal.h
@@ -39,7 +39,7 @@
 
 class verireal {
 
-      friend ostream& operator<< (ostream&, const verireal&);
+      friend std::ostream& operator<< (std::ostream&, const verireal&);
       friend verireal operator* (const verireal&, const verireal&);
       friend verireal operator/ (const verireal&, const verireal&);
       friend verireal operator/ (const verireal&, const verinum&);
@@ -68,7 +68,7 @@
       double value_;
 };
 
-extern ostream& operator<< (ostream&, const verireal&);
+extern std::ostream& operator<< (std::ostream&, const verireal&);
 extern verireal operator* (const verireal&, const verireal&);
 extern verireal operator/ (const verireal&, const verireal&);
 extern verireal operator/ (const verireal&, const verinum&);
--- verilog-0.8.orig/util.h
+++ verilog-0.8/util.h
@@ -44,7 +44,7 @@
       verinum val;
 };
 
-extern attrib_list_t* evaluate_attributes(const map<perm_string,PExpr*>&att,
+extern attrib_list_t* evaluate_attributes(const std::map<perm_string,PExpr*>&att,
 					  unsigned&natt,
 					  const Design*des,
 					  const NetScope*scope);
--- verilog-0.8.orig/StringHeap.h
+++ verilog-0.8/StringHeap.h
@@ -101,7 +101,7 @@
 
       const char*add(const char*);
       perm_string make(const char*);
-      perm_string make(const string&);
+      perm_string make(const std::string&);
 
       unsigned add_count() const;
       unsigned add_hit_count() const;
--- verilog-0.8.orig/verinum.h
+++ verilog-0.8/verinum.h
@@ -43,7 +43,7 @@
       enum V { V0 = 0, V1, Vx, Vz };
 
       verinum();
-      verinum(const string&str);
+      verinum(const std::string&);
       verinum(const V*v, unsigned nbits, bool has_len =true);
       verinum(V, unsigned nbits =1, bool has_len =true);
       verinum(unsigned long val, unsigned bits);
@@ -90,7 +90,7 @@
 
       unsigned long as_ulong() const;
       signed long   as_long() const;
-      string as_string() const;
+      std::string as_string() const;
 
     private:
       V* bits_;
@@ -107,8 +107,8 @@
    needed to accurately represent the contained value, signed or not. */
 extern verinum trim_vnum(const verinum&);
 
-extern ostream& operator<< (ostream&, const verinum&);
-extern ostream& operator<< (ostream&, verinum::V);
+extern std::ostream& operator<< (std::ostream&, const verinum&);
+extern std::ostream& operator<< (std::ostream&, verinum::V);
 
 extern verinum::V operator | (verinum::V l, verinum::V r);
 extern verinum::V operator & (verinum::V l, verinum::V r);
--- verilog-0.8.orig/PTask.h
+++ verilog-0.8/PTask.h
@@ -70,7 +70,7 @@
 	// Elaborate the statement to finish off the task definition.
       void elaborate(Design*des, NetScope*scope) const;
 
-      void dump(ostream&, unsigned) const;
+      void dump(std::ostream&, unsigned) const;
 
     private:
       svector<PWire*>*ports_;
@@ -106,7 +106,7 @@
 	/* Elaborate the behavioral statement. */
       void elaborate(Design *des, NetScope*) const;
 
-      void dump(ostream&, unsigned) const;
+      void dump(std::ostream&, unsigned) const;
 
     private:
       perm_string name_;
-- 
Hamish Moffatt VK3SB <hamish@debian.org> <hamish@cloud.net.au>