root/dmdpatch.patch

Revision 183:190ba98276b3, 5.5 kB (checked in by Jacob Carlborg <doob@me.com>, 2 years ago)

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.

  • a/src/dmd/class.c

    old new  
    6161    if (id) 
    6262    {   // Look for special class names 
    6363 
    64     if (id == Id::__sizeof || id == Id::alignof || id == Id::mangleof) 
     64    if (id == Id::__sizeof || id == Id::_alignof || id == Id::mangleof) 
    6565        error("illegal class name"); 
    6666 
    6767    // BUG: What if this is the wrong TypeInfo, i.e. it is nested? 
  • a/src/dmd/dsymbol.c

    old new  
    488488    } 
    489489    if (sd->isAggregateDeclaration() || sd->isEnumDeclaration()) 
    490490    { 
    491         if (ident == Id::__sizeof || ident == Id::alignof || ident == Id::mangleof) 
     491        if (ident == Id::__sizeof || ident == Id::_alignof || ident == Id::mangleof) 
    492492        error(".%s property cannot be redefined", ident->toChars()); 
    493493    } 
    494494    return 1; 
  • a/src/dmd/expression.c

    old new  
    59535953    } 
    59545954    else if (t1b->ty == Tpointer && 
    59555955         ident != Id::init && ident != Id::__sizeof && 
    5956          ident != Id::alignof && ident != Id::offsetof && 
     5956         ident != Id::_alignof && ident != Id::offsetof && 
    59575957         ident != Id::mangleof && ident != Id::stringof) 
    59585958    {   /* Rewrite: 
    59595959         *   p.ident 
  • a/src/dmd/idgen.c

    old new  
    4444    { "init" }, 
    4545    { "size" }, 
    4646    { "__sizeof", "sizeof" }, 
    47     { "alignof" }, 
     47    { "_alignof", "alignof" }, 
    4848    { "mangleof" }, 
    4949    { "stringof" }, 
    5050    { "tupleof" }, 
  • a/src/dmd/mtype.c

    old new  
    16101610    error(loc, ".size property should be replaced with .sizeof"); 
    16111611    e = new ErrorExp(); 
    16121612    } 
    1613     else if (ident == Id::alignof) 
     1613    else if (ident == Id::_alignof) 
    16141614    { 
    16151615    e = new IntegerExp(loc, alignsize(), Type::tsize_t); 
    16161616    } 
     
    17491749    assert(sym); 
    17501750 
    17511751    if (ident != Id::__sizeof && 
    1752     ident != Id::alignof && 
     1752    ident != Id::_alignof && 
    17531753    ident != Id::init && 
    17541754    ident != Id::mangleof && 
    17551755    ident != Id::stringof && 
  • a/src/dmd/win32.mak

    old new  
    88DMDSVN=\svnproj\dmd\trunk\src 
    99SCROOT=$D\dm 
    1010INCLUDE=$(SCROOT)\include 
    11 CC=\dm\bin\dmc 
     11CC=$(SCROOT)\bin\dmc 
     12LIB=$(SCROOT)\bin\lib 
    1213LIBNT=$(SCROOT)\lib 
    1314SNN=$(SCROOT)\lib\snn 
    1415DIR=\dmd2 
     
    2425XFLG= 
    2526MODEL=n 
    2627OPT= 
    27 DEBUG=-gl -D 
     28DEBUG=-g -D 
    2829#PREC=-H -HItotal.h -HO 
    2930PREC= 
    3031LFLAGS= 
     
    5960    $(MAKE) OPT=-o "DEBUG=" LFLAGS=-L/delexe dmd.exe 
    6061#   $(MAKE) OPT=-o "DEBUG=" LFLAGS=-L/ma/co/delexe dmd.exe 
    6162 
     63lib: 
     64    $(MAKE) OPT=-o "DEBUG=" dmd.lib 
     65 
    6266################ NT COMMAND LINE DEBUG ######################### 
    6367 
    6468debdmd: 
    6569    $(MAKE) OPT= "DEBUG=-D -g" LFLAGS=-L/ma/co dmd.exe 
    6670 
     71deblib: 
     72    $(MAKE) OPT= "DEBUG=-D -g" dmd.lib 
     73 
    6774######################################### 
    6875 
    6976# D front end 
     
    155162######################################### 
    156163 
    157164$(TARGET).exe : $(OBJS) win32.mak 
    158     dmc -o$(TARGET).exe $(OBJS) -cpp -mn -Ar $(LFLAGS) 
     165    $(CC) -o$(TARGET).exe $(OBJS) -cpp -mn -Ar $(LFLAGS) 
    159166 
     167$(TARGET).lib : $(OBJS) win32.mak 
     168    $(LIB) -c -p128 $(TARGET).lib $(OBJ8) $(ROOTOBJS) msc.obj tk.obj util.obj entity.obj ph.obj eh.obj 
     169    $(LIB) -d $(TARGET).lib iasm.obj 
    160170 
    161171##################### INCLUDE MACROS ##################### 
    162172 
     
    171181    msgsx 
    172182 
    173183msgsx.exe : msgsx.c 
    174     dmc msgsx -mn -D$(TARGET) $(DEFINES) $(WINLIBS) 
     184    $(CC) msgsx -mn -D$(TARGET) $(DEFINES) $(WINLIBS) 
    175185 
    176186elxxx.c cdxxx.c optab.c debtab.c fltables.c tytab.c : \ 
    177187    $C\cdef.h $C\cc.h $C\oper.h $C\ty.h $C\optabgen.c 
    178     dmc -cpp -ooptabgen.exe $C\optabgen -DMARS -I$(TK) $(WINLIBS) #-L$(LINKS) 
     188    $(CC) -cpp -ooptabgen.exe $C\optabgen -DMARS -I$(TK) $(WINLIBS) #-L$(LINKS) 
    179189    optabgen 
    180190 
    181191impcnvtab.c : impcnvgen.c 
     
    183193    impcnvgen 
    184194 
    185195id.h id.c : idgen.c 
    186     dmc -cpp idgen 
     196    $(CC) -cpp idgen 
    187197    idgen 
    188198 
    189199##################### SPECIAL BUILDS ##################### 
  • a/src/druntime/win32.mak

    old new  
    11 
    2 DMD=dmd 
     2DMD=..\..\windows\bin\dmd 
    33 
    44CC=dmc 
    55 
     
    300300# NOTE: a pre-compiled minit.obj has been provided in dmd for Win32 and 
    301301#       minit.asm is not used by dmd for Linux 
    302302 
    303 OBJS= errno_c.obj complex.obj critical.obj deh.obj monitor.obj src\rt\minit.obj 
     303OBJS= errno_c.obj complex.obj critical.obj deh.obj monitor.obj minit.obj 
    304304OBJS_TO_DELETE= errno_c.obj complex.obj critical.obj deh.obj monitor.obj 
    305305 
    306306DOCS=\ 
  • a/src/phobos/win32.mak

    old new  
    5151 
    5252DMD=$(DIR)\bin\dmd 
    5353#DMD=..\dmd 
    54 DMD=dmd 
     54DMD=..\..\windows\bin\dmd 
    5555 
    5656## Location of where to write the html documentation files 
    5757 
Note: See TracBrowser for help on using the browser.