diff options
| author | Mike Wey | 2012-02-15 22:03:30 +0100 |
|---|---|---|
| committer | Mike Wey | 2012-02-15 22:03:30 +0100 |
| commit | c575c1af3d6d6549fce69514eaa6de5392e5f9bf (patch) | |
| tree | bbc427dbe4096f4eb2e4c3d7a6ffd5eeecbe51ce | |
| parent | ba163e3e4621a7790f07421b53c007d83e705bbd (diff) | |
Add an opCast for Object.
This is needed for dmd 2.058 and up.
| -rw-r--r-- | GNUmakefile | 6 | ||||
| -rw-r--r-- | dmagick/Color.d | 9 |
2 files changed, 10 insertions, 5 deletions
diff --git a/GNUmakefile b/GNUmakefile index 11019ff..abfccb6 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -34,10 +34,6 @@ else output=-of$@ endif -ifeq ("$(OS)","Linux") - LDFLAGS+=$(LINKERFLAG)-ldl -endif - ifeq ("$(ARCH)", "x86_64") DCFLAGS+=-m64 LDFLAGS+=-m64 @@ -89,7 +85,7 @@ $(LIBNAME_DMAGICK): $(OBJECTS_DMAGICK) echo "void main(){}" > $@ unittest: /tmp/stubmain.d $(SOURCES_DMAGICK) - $(DC) $(DCFLAGS) $(UNITTESTFLAG) $(LINKERFLAG)-lMagickCore $^ $(output) + $(DC) $(DCFLAGS) $(UNITTESTFLAG) $(LINKERFLAG)-lMagickCore $(LDFLAGS) $^ $(output) ./$@ ####################################################################### diff --git a/dmagick/Color.d b/dmagick/Color.d index c9ea1ee..cb17cf0 100644 --- a/dmagick/Color.d +++ b/dmagick/Color.d @@ -133,6 +133,15 @@ class Color assert(color.toString() == "#0000000000000000FFFFFFFF"); } + /* + * Needed when comparing colors with dmd 2.058. + */ + Object opCast(T)() + if ( is(T == Object) ) + { + return this; + } + /** * Support casting between different colors. * You can also use std.conv.to |
