Mercurial > projects > ddmd
comparison 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 |
comparison
equal
deleted
inserted
replaced
181:aa70dca07cb0 | 183:190ba98276b3 |
---|---|
11 @@ -61,7 +61,7 @@ | 11 @@ -61,7 +61,7 @@ |
12 if (id) | 12 if (id) |
13 { // Look for special class names | 13 { // Look for special class names |
14 | 14 |
15 - if (id == Id::__sizeof || id == Id::alignof || id == Id::mangleof) | 15 - if (id == Id::__sizeof || id == Id::alignof || id == Id::mangleof) |
16 + if (id == Id::__sizeof || id == Id::__alignof || id == Id::mangleof) | 16 + if (id == Id::__sizeof || id == Id::_alignof || id == Id::mangleof) |
17 error("illegal class name"); | 17 error("illegal class name"); |
18 | 18 |
19 // BUG: What if this is the wrong TypeInfo, i.e. it is nested? | 19 // BUG: What if this is the wrong TypeInfo, i.e. it is nested? |
20 diff -r 0ebf1721e4d3 -r a4ec24e030fd src/dmd/dsymbol.c | 20 diff -r 0ebf1721e4d3 -r a4ec24e030fd src/dmd/dsymbol.c |
21 --- a/src/dmd/dsymbol.c Mon Sep 13 15:46:31 2010 +0200 | 21 --- a/src/dmd/dsymbol.c Mon Sep 13 15:46:31 2010 +0200 |
23 @@ -488,7 +488,7 @@ | 23 @@ -488,7 +488,7 @@ |
24 } | 24 } |
25 if (sd->isAggregateDeclaration() || sd->isEnumDeclaration()) | 25 if (sd->isAggregateDeclaration() || sd->isEnumDeclaration()) |
26 { | 26 { |
27 - if (ident == Id::__sizeof || ident == Id::alignof || ident == Id::mangleof) | 27 - if (ident == Id::__sizeof || ident == Id::alignof || ident == Id::mangleof) |
28 + if (ident == Id::__sizeof || ident == Id::__alignof || ident == Id::mangleof) | 28 + if (ident == Id::__sizeof || ident == Id::_alignof || ident == Id::mangleof) |
29 error(".%s property cannot be redefined", ident->toChars()); | 29 error(".%s property cannot be redefined", ident->toChars()); |
30 } | 30 } |
31 return 1; | 31 return 1; |
32 diff -r 0ebf1721e4d3 -r a4ec24e030fd src/dmd/expression.c | 32 diff -r 0ebf1721e4d3 -r a4ec24e030fd src/dmd/expression.c |
33 --- a/src/dmd/expression.c Mon Sep 13 15:46:31 2010 +0200 | 33 --- a/src/dmd/expression.c Mon Sep 13 15:46:31 2010 +0200 |
35 @@ -5953,7 +5953,7 @@ | 35 @@ -5953,7 +5953,7 @@ |
36 } | 36 } |
37 else if (t1b->ty == Tpointer && | 37 else if (t1b->ty == Tpointer && |
38 ident != Id::init && ident != Id::__sizeof && | 38 ident != Id::init && ident != Id::__sizeof && |
39 - ident != Id::alignof && ident != Id::offsetof && | 39 - ident != Id::alignof && ident != Id::offsetof && |
40 + ident != Id::__alignof && ident != Id::offsetof && | 40 + ident != Id::_alignof && ident != Id::offsetof && |
41 ident != Id::mangleof && ident != Id::stringof) | 41 ident != Id::mangleof && ident != Id::stringof) |
42 { /* Rewrite: | 42 { /* Rewrite: |
43 * p.ident | 43 * p.ident |
44 diff -r 0ebf1721e4d3 -r a4ec24e030fd src/dmd/idgen.c | 44 diff -r 0ebf1721e4d3 -r a4ec24e030fd src/dmd/idgen.c |
45 --- a/src/dmd/idgen.c Mon Sep 13 15:46:31 2010 +0200 | 45 --- a/src/dmd/idgen.c Mon Sep 13 15:46:31 2010 +0200 |
47 @@ -44,7 +44,7 @@ | 47 @@ -44,7 +44,7 @@ |
48 { "init" }, | 48 { "init" }, |
49 { "size" }, | 49 { "size" }, |
50 { "__sizeof", "sizeof" }, | 50 { "__sizeof", "sizeof" }, |
51 - { "alignof" }, | 51 - { "alignof" }, |
52 + { "__alignof", "alignof" }, | 52 + { "_alignof", "alignof" }, |
53 { "mangleof" }, | 53 { "mangleof" }, |
54 { "stringof" }, | 54 { "stringof" }, |
55 { "tupleof" }, | 55 { "tupleof" }, |
56 diff -r 0ebf1721e4d3 -r a4ec24e030fd src/dmd/mtype.c | 56 diff -r 0ebf1721e4d3 -r a4ec24e030fd src/dmd/mtype.c |
57 --- a/src/dmd/mtype.c Mon Sep 13 15:46:31 2010 +0200 | 57 --- a/src/dmd/mtype.c Mon Sep 13 15:46:31 2010 +0200 |
59 @@ -1610,7 +1610,7 @@ | 59 @@ -1610,7 +1610,7 @@ |
60 error(loc, ".size property should be replaced with .sizeof"); | 60 error(loc, ".size property should be replaced with .sizeof"); |
61 e = new ErrorExp(); | 61 e = new ErrorExp(); |
62 } | 62 } |
63 - else if (ident == Id::alignof) | 63 - else if (ident == Id::alignof) |
64 + else if (ident == Id::__alignof) | 64 + else if (ident == Id::_alignof) |
65 { | 65 { |
66 e = new IntegerExp(loc, alignsize(), Type::tsize_t); | 66 e = new IntegerExp(loc, alignsize(), Type::tsize_t); |
67 } | 67 } |
68 @@ -1749,7 +1749,7 @@ | 68 @@ -1749,7 +1749,7 @@ |
69 assert(sym); | 69 assert(sym); |
70 | 70 |
71 if (ident != Id::__sizeof && | 71 if (ident != Id::__sizeof && |
72 - ident != Id::alignof && | 72 - ident != Id::alignof && |
73 + ident != Id::__alignof && | 73 + ident != Id::_alignof && |
74 ident != Id::init && | 74 ident != Id::init && |
75 ident != Id::mangleof && | 75 ident != Id::mangleof && |
76 ident != Id::stringof && | 76 ident != Id::stringof && |
77 diff -r 0ebf1721e4d3 -r a4ec24e030fd src/dmd/win32.mak | 77 diff -r 0ebf1721e4d3 -r a4ec24e030fd src/dmd/win32.mak |
78 --- a/src/dmd/win32.mak Mon Sep 13 15:46:31 2010 +0200 | 78 --- a/src/dmd/win32.mak Mon Sep 13 15:46:31 2010 +0200 |