From c575c1af3d6d6549fce69514eaa6de5392e5f9bf Mon Sep 17 00:00:00 2001 From: Mike Wey Date: Wed, 15 Feb 2012 22:03:30 +0100 Subject: Add an opCast for Object. This is needed for dmd 2.058 and up. --- GNUmakefile | 6 +----- 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 -- cgit v1.2.3