diff dmdpatch.patch @ 183:190ba98276b3

Several changes to make it build on posix systems. I've only tried to build on Mac OS X but it should build on Linux now as well. This should also fix ticket #9.
author Jacob Carlborg <doob@me.com>
date Mon, 25 Oct 2010 15:36:13 +0200
parents 31c086f76669
children
line wrap: on
line diff
--- a/dmdpatch.patch	Mon Oct 18 00:36:44 2010 +0400
+++ b/dmdpatch.patch	Mon Oct 25 15:36:13 2010 +0200
@@ -13,7 +13,7 @@
      {	// Look for special class names
  
 -	if (id == Id::__sizeof || id == Id::alignof || id == Id::mangleof)
-+	if (id == Id::__sizeof || id == Id::__alignof || id == Id::mangleof)
++	if (id == Id::__sizeof || id == Id::_alignof || id == Id::mangleof)
  	    error("illegal class name");
  
  	// BUG: What if this is the wrong TypeInfo, i.e. it is nested?
@@ -25,7 +25,7 @@
  	if (sd->isAggregateDeclaration() || sd->isEnumDeclaration())
  	{
 -	    if (ident == Id::__sizeof || ident == Id::alignof || ident == Id::mangleof)
-+	    if (ident == Id::__sizeof || ident == Id::__alignof || ident == Id::mangleof)
++	    if (ident == Id::__sizeof || ident == Id::_alignof || ident == Id::mangleof)
  		error(".%s property cannot be redefined", ident->toChars());
  	}
  	return 1;
@@ -37,7 +37,7 @@
      else if (t1b->ty == Tpointer &&
  	     ident != Id::init && ident != Id::__sizeof &&
 -	     ident != Id::alignof && ident != Id::offsetof &&
-+	     ident != Id::__alignof && ident != Id::offsetof &&
++	     ident != Id::_alignof && ident != Id::offsetof &&
  	     ident != Id::mangleof && ident != Id::stringof)
      {	/* Rewrite:
           *   p.ident
@@ -49,7 +49,7 @@
      { "size" },
      { "__sizeof", "sizeof" },
 -    { "alignof" },
-+    { "__alignof", "alignof" },
++    { "_alignof", "alignof" },
      { "mangleof" },
      { "stringof" },
      { "tupleof" },
@@ -61,7 +61,7 @@
  	e = new ErrorExp();
      }
 -    else if (ident == Id::alignof)
-+    else if (ident == Id::__alignof)
++    else if (ident == Id::_alignof)
      {
  	e = new IntegerExp(loc, alignsize(), Type::tsize_t);
      }
@@ -70,7 +70,7 @@
  
      if (ident != Id::__sizeof &&
 -	ident != Id::alignof &&
-+	ident != Id::__alignof &&
++	ident != Id::_alignof &&
  	ident != Id::init &&
  	ident != Id::mangleof &&
  	ident != Id::stringof &&