Skip to content

Commit

Permalink
Fix compile errors on non-Linux systems.
Browse files Browse the repository at this point in the history
  • Loading branch information
s-ludwig committed Mar 7, 2023
1 parent 2cbc272 commit 7a0cd28
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 15 deletions.
4 changes: 2 additions & 2 deletions source/eventcore/drivers/posix/driver.d
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import eventcore.drivers.posix.sockets;
import eventcore.drivers.posix.watchers;
import eventcore.drivers.posix.processes;
import eventcore.drivers.posix.pipes;
import eventcore.drivers.posix.io_uring.io_uring : UringEventLoop, NoRing;
import eventcore.drivers.posix.io_uring.files : UringDriverFiles;
import eventcore.drivers.posix.io_uring.io_uring;
import eventcore.drivers.posix.io_uring.files;
import eventcore.drivers.timer;
import eventcore.drivers.threadedfile;
import eventcore.internal.consumablequeue : ConsumableQueue;
Expand Down
2 changes: 2 additions & 0 deletions source/eventcore/drivers/posix/io_uring/files.d
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
module eventcore.drivers.posix.io_uring.files;

version (linux):

import eventcore.internal.utils;

import eventcore.driver;
Expand Down
27 changes: 14 additions & 13 deletions source/eventcore/drivers/posix/io_uring/io_uring.d
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,25 @@
*/
module eventcore.drivers.posix.io_uring.io_uring;

version (linux):

import eventcore.driver;
import eventcore.internal.utils;

import core.time : Duration;


/// substitue for UringCore that does nothing for
/// non-uring posix event loops
final class NoRing
{
void registerEventID(EventID id) nothrow @trusted @nogc { }
void submit() nothrow @trusted @nogc { }
@property size_t waiterCount() const nothrow @safe { return 0; }
bool doProcessEvents(Duration timeout, bool dontWait = true) nothrow @trusted { return false; }
}


version (linux):

import during;
import std.stdio;

Expand Down Expand Up @@ -111,17 +123,6 @@ private struct UserData
}


/// substitue for UringCore that does nothing for
/// non-uring posix event loops
final class NoRing
{
void registerEventID(EventID id) nothrow @trusted @nogc { }
void submit() nothrow @trusted @nogc { }
@property size_t waiterCount() const nothrow @safe { return 0; }
bool doProcessEvents(Duration timeout, bool dontWait = true) nothrow @trusted { return false; }
}


///
final class UringEventLoop
{
Expand Down

0 comments on commit 7a0cd28

Please sign in to comment.