New linker error with xml2

ollie ollie at home.net
Wed Aug 28 14:39:25 PDT 2013


If anyone is interested, here is the patch I use to compile xml2:

diff --git a/alt/zstring.d b/alt/zstring.d
index 356cfda..e021cca 100644
--- a/alt/zstring.d
+++ b/alt/zstring.d
@@ -674,7 +674,7 @@ struct Array(T)
     }
 
     /// Return  unwriteable slice of the buffer.
-    const(T[]) toConstArray() const @safe @property nothrow
+    const(T[]) toConstArray() const @trusted @property nothrow
     {
 		if (ptr_ !is null)
 			return ptr_[0..length_];
@@ -1350,7 +1350,8 @@ struct PackedArray(T)
 /// Element of sortable array of pairs on key
 struct KeyValRec(K,V)
 {
-	alias KeyValRec!(K,V) SameType;
+//	alias KeyValRec!(K,V) SameType;
+    alias SameType = KeyValRec!(K,V);
 
     K id;
     V value;
@@ -1723,4 +1724,4 @@ unittest
     put(cd["standalone"]);
     put(cd["encoding"]);
 
-}
\ No newline at end of file
+}
diff --git a/build.bat b/build.bat
index 4be9aaf..052d670 100644
--- a/build.bat
+++ b/build.bat
@@ -1,7 +1,7 @@
 rem Delete all outputs
 del xmlp.lib sxmltest.exe bookstest.exe conformance.exe 2>NUL
 
-dmd -property -lib -ofxmlp.lib -O -noboundscheck -release -w ^
+dmd -lib -ofxmlp.lib -O -noboundscheck -release -w ^
 	"alt/zstring.d" "std/xml1.d" "std/xml2.d" ^
 	"std/xmlp/arraydom.d" "std/xmlp/arraydombuild.d"  "std/xmlp/builder.d" ^
 	"std/xmlp/domparse.d" "std/xmlp/dtdtype.d" ^
@@ -17,15 +17,15 @@ dmd -property -lib -ofxmlp.lib -O -noboundscheck -release -w ^
 
 IF ERRORLEVEL 1 exit /B
 
-dmd -property -ofsxmltest -O -noboundscheck -release "./test/sxml"  xmlp.lib
+dmd -ofsxmltest -O -noboundscheck -release "./test/sxml"  xmlp.lib
 
 IF ERRORLEVEL 1 exit /B
 
-dmd -property -ofbookstest -O -noboundscheck -release "./test/books" xmlp.lib
+dmd -ofbookstest -O -noboundscheck -release "./test/books" xmlp.lib
 
 IF ERRORLEVEL 1 exit /B
 
-dmd -property -ofconformance -O -noboundscheck -release ^
+dmd -ofconformance -O -noboundscheck -release ^
 	"./test/conformance.d"  std/xmlp/jisx0208.d xmlp.lib
 
 IF ERRORLEVEL 1 exit /B
diff --git a/std/xml1.d b/std/xml1.d
index 941c373..3799474 100644
--- a/std/xml1.d
+++ b/std/xml1.d
@@ -905,7 +905,7 @@ class Tag
 		if (tag_.attr.length > 0)
 			tag_.attr.explode(del);
 		if (del)
-			delete this;
+			this.destroy();
 	}
 
 }
@@ -1398,7 +1398,7 @@ abstract class Item
 	void explode(bool del)
 	{
 		if (del)
-			delete this;
+			this.destroy();
 	}
 
 }
@@ -1663,7 +1663,7 @@ public:
 
 		init();
 		if (del)
-			delete this;
+			this.destroy();
 	}
 
 	/**
@@ -2130,4 +2130,4 @@ void UnitTest1()
 unittest
 {
 	UnitTest1();
-}
\ No newline at end of file
+}
diff --git a/std/xmlp/arraydom.d b/std/xmlp/arraydom.d
index 0b7a34c..75e23da 100644
--- a/std/xmlp/arraydom.d
+++ b/std/xmlp/arraydom.d
@@ -62,7 +62,7 @@ abstract class Item
 	void explode(bool del)
 	{
 		if (del)
-			delete this;
+			this.destroy();
 	}
 
     /// This item as text
diff --git a/std/xmlp/builder.d b/std/xmlp/builder.d
index 98cc176..3274d63 100644
--- a/std/xmlp/builder.d
+++ b/std/xmlp/builder.d
@@ -69,7 +69,7 @@ abstract class Builder {
 	void explode(bool del)
 	{
 		if (del)
-			delete this;
+			this.destroy();
 	}	
 }
 
diff --git a/std/xmlp/coreprint.d b/std/xmlp/coreprint.d
index 1a81011..6cf191a 100644
--- a/std/xmlp/coreprint.d
+++ b/std/xmlp/coreprint.d
@@ -204,7 +204,7 @@ struct XmlPrinter
         uintptr_t i = indent;
         buf[i++] = '<';
         buf[i++] = '/';
-        buf[i .. i + taglen] = tag;
+        buf[i .. i + taglen] = tag[];
         i += taglen;
         buf[i] = '>';
     }
@@ -384,7 +384,7 @@ struct XmlPrinter
         uintptr_t i = indent;
         if(i > 0)
             buf[0..i] = ' ';
-        buf[i .. $] = s;
+        buf[i .. $] = s[];
         options.putDg(buf);
     }
 }
diff --git a/std/xmlp/linkdom.d b/std/xmlp/linkdom.d
index 582fb9b..678c2a7 100644
--- a/std/xmlp/linkdom.d
+++ b/std/xmlp/linkdom.d
@@ -1319,7 +1319,7 @@ public:
 	void explode(bool del)
 	{
 		if (del)
-			delete this;
+			this.destroy();
 	}
 
     /// Not supported
diff --git a/test/Conformance.d b/test/Conformance.d
index 68dd9a6..ab7518b 100644
--- a/test/Conformance.d
+++ b/test/Conformance.d
@@ -755,7 +755,7 @@ int main(string[] args)
         }
     }
     string dinp;
-    stdin.readln(dinp);
+    dinp = stdin.readln();
     return 0;
 }
 
diff --git a/test/books.d b/test/books.d
index 6c14403..7c6bd71 100644
--- a/test/books.d
+++ b/test/books.d
@@ -182,7 +182,8 @@ void std_xml1(string s)
 		Book[] books;
 
 		auto xml = new DocumentParser(s);
-		auto doc = new Document(TagData("catalog"));
+        auto td = TagData("catalog");
+		auto doc = new Document(td);
 
 		scope(exit)
 		{
diff --git a/test/sxml.d b/test/sxml.d
index e3dad14..319698d 100644
--- a/test/sxml.d
+++ b/test/sxml.d
@@ -17,7 +17,7 @@ import ard = std.xmlp.arraydom;
 import lnk = std.xmlp.linkdom;
 import ardb = std.xmlp.arraydombuild;
 import std.xmlp.builder;
-import alt.zstring;
+//import alt.zstring;
 
 version(GC_STATS)
 {
@@ -255,7 +255,8 @@ void xml1_books(string s)
 		xml.explode(true);
 
 		// Put it back together again;
-		auto doc = new Document(TagData("catalog"));
+        auto td = TagData("catalog");
+		auto doc = new Document(td);
 		foreach(book;books)
 		{
 			auto element = new Element("book");
@@ -979,7 +980,7 @@ void testDomAssembly()
 
     writeln("Dom construction. <Enter to exit>");
     string dinp;
-    stdin.readln(dinp);
+    dinp = stdin.readln;
 
 
 }




More information about the Digitalmars-d mailing list