Skip to content

Commit

Permalink
Fix compilation on DMD 2.066.1.
Browse files Browse the repository at this point in the history
  • Loading branch information
s-ludwig committed Apr 5, 2016
1 parent 0337714 commit c2aae40
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
11 changes: 8 additions & 3 deletions source/dub/internal/sdlang/lexer.d
Original file line number Diff line number Diff line change
Expand Up @@ -1260,15 +1260,20 @@ class Lexer
else
{
auto timezone = new immutable SimpleTimeZone(offset.get());
mixin(accept!("Value", "SysTime(dateTimeFrac.dateTime, dateTimeFrac.fracSecs, timezone)"));
static if (__VERSION__ >= 2067) auto fsecs = dateTimeFrac.fracSecs;
else auto fsecs = FracSec.from!"hnsecs"(dateTimeFrac.fracSecs.total!"hnsecs");
mixin(accept!("Value", "SysTime(dateTimeFrac.dateTime, fsecs, timezone)"));
}
}

try
{
auto timezone = TimeZone.getTimeZone(timezoneStr);
if(timezone)
mixin(accept!("Value", "SysTime(dateTimeFrac.dateTime, dateTimeFrac.fracSecs, timezone)"));
if(timezone) {
static if (__VERSION__ >= 2067) auto fsecs = dateTimeFrac.fracSecs;
else auto fsecs = FracSec.from!"hnsecs"(dateTimeFrac.fracSecs.total!"hnsecs");
mixin(accept!("Value", "SysTime(dateTimeFrac.dateTime, fsecs, timezone)"));
}
}
catch(TimeException e)
{
Expand Down
3 changes: 3 additions & 0 deletions source/dub/internal/sdlang/token.d
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ import dub.internal.sdlang.util;
/// So this is needed for any SDL "Date Time" that doesn't include a time zone.
struct DateTimeFrac
{
this(DateTime dt, Duration fs) { this.dateTime = dt; this.fracSecs = fs; }
this(DateTime dt, FracSec fs) { this.dateTime = dt; this.fracSecs = fs.hnsecs.hnsecs; }

DateTime dateTime;
Duration fracSecs;
deprecated("Use fracSecs instead.") {
Expand Down

0 comments on commit c2aae40

Please sign in to comment.