Skip to content

Commit

Permalink
Add support for DMD 2.094 -preview=in switch
Browse files Browse the repository at this point in the history
This will allow users to use -preview=in as soon as it's released.
Of course this had to uncovered a DMD bug in the process.
  • Loading branch information
Geod24 authored and dlang-bot committed Aug 31, 2020
1 parent 6f62236 commit a027c23
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion source/eventcore/driver.d
Original file line number Diff line number Diff line change
Expand Up @@ -996,7 +996,19 @@ alias EventCallback = void delegate(EventID);
alias SignalCallback = void delegate(SignalListenID, SignalStatus, int);
alias TimerCallback = void delegate(TimerID);
alias TimerCallback2 = void delegate(TimerID, bool fired);
alias FileChangesCallback = void delegate(WatcherID, in ref FileChange change);
// Support for `-preview=in`
// Using template because of https://issues.dlang.org/show_bug.cgi?id=21207
private template FileChangesCallbackWorkaround ()
{
static if (!is(typeof(mixin(q{(in ref int a) => a}))))
alias FileChangesCallbackWorkaround = void delegate(WatcherID, in FileChange change);
else
mixin(q{
alias FileChangesCallbackWorkaround = void delegate(WatcherID, in ref FileChange change);
});
}
alias FileChangesCallback = FileChangesCallbackWorkaround!();

alias ProcessWaitCallback = void delegate(ProcessID, int);
@system alias DataInitializer = void function(void*) @nogc;

Expand Down

0 comments on commit a027c23

Please sign in to comment.