FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Update lodepng to work with 1.055?

 
Post new topic   Reply to topic     Forum Index -> Scrapple
View previous topic :: View next topic  
Author Message
JNewt



Joined: 05 Jun 2008
Posts: 69

PostPosted: Fri Feb 26, 2010 5:58 pm    Post subject: Update lodepng to work with 1.055? Reply with quote

Has anyone fixed lodepng to work with the more recent versions of DMD? I was able to build it successfully a while ago, but now, with DMD 1.055, I get lots of build errors. They seemed to be related to template mixins, so I'm guessing that either DMD regressed or tightened something up.

Sample errors:
Code:
lodepng/Decode.d(512): Error: cannot evaluate _enforce("filterType >= 0 && filterType <= 4","wrong filter byte: image corrupt?") at compile time
lodepng/Decode.d(512): Error: argument to mixin must be a string, not (_enforce("filterType >= 0 && filterType <= 4","wrong filter byte: image corrupt?"))
lodepng/Decode.d(512): Error: cannot evaluate _enforce("filterType >= 0 && filterType <= 4","wrong filter byte: image corrupt?") at compile time
Back to top
View user's profile Send private message
JNewt



Joined: 05 Jun 2008
Posts: 69

PostPosted: Mon Mar 01, 2010 12:54 pm    Post subject: Reply with quote

Replacing the _enforce function in util.d with a string mixin template fixed it for me.

Copy over the _enforce function:
Code:

template _enforce(char[] cond, char[] msg) {
        const char[] _enforce =
                `if (!(`~ cond ~`)) throw new `~ T.stringof ~` ( "`~ cond ~`: `~ msg ~ ` (in "~ __FILE__~ ")" );`;
    }
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Scrapple All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group