mirror of https://github.com/adamdruppe/arsd.git
patch it up so it builds again
This commit is contained in:
parent
1ea5517916
commit
2a1ca7d1ec
56
core.d
56
core.d
|
@ -28,6 +28,8 @@ else version(BSD)
|
||||||
version=Arsd_core_kqueue;
|
version=Arsd_core_kqueue;
|
||||||
else version(Darwin)
|
else version(Darwin)
|
||||||
version=Arsd_core_kqueue;
|
version=Arsd_core_kqueue;
|
||||||
|
else version(OSX)
|
||||||
|
version=Arsd_core_kqueue;
|
||||||
|
|
||||||
|
|
||||||
/+
|
/+
|
||||||
|
@ -1450,6 +1452,9 @@ AsyncOperationRequest waitForFirstToComplete(AsyncOperationRequest[] requests...
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/++
|
||||||
|
This meant to be used in a foreach loop.
|
||||||
|
+/
|
||||||
int asTheyComplete(AsyncOperationRequest[] requests...) {
|
int asTheyComplete(AsyncOperationRequest[] requests...) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -1466,6 +1471,20 @@ struct PendingOperation {
|
||||||
// and then i could even recycle completed Task objects similarly.
|
// and then i could even recycle completed Task objects similarly.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/+
|
||||||
|
Tasks:
|
||||||
|
startTask()
|
||||||
|
startSubTask() - what if it just did this when it knows it is being run from inside a task?
|
||||||
|
runHelperFunction() - whomever it reports to is the parent
|
||||||
|
+/
|
||||||
|
|
||||||
|
private class CoreEventLoopImplementation : ICoreEventLoop {
|
||||||
|
|
||||||
|
version(Arsd_core_kqueue) {
|
||||||
|
void runOnce() { }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
version(Windows)
|
version(Windows)
|
||||||
extern(Windows)
|
extern(Windows)
|
||||||
void overlappedCompletionRoutine(DWORD dwErrorCode, DWORD dwNumberOfBytesTransferred, LPOVERLAPPED lpOverlapped) {
|
void overlappedCompletionRoutine(DWORD dwErrorCode, DWORD dwNumberOfBytesTransferred, LPOVERLAPPED lpOverlapped) {
|
||||||
|
@ -1492,15 +1511,15 @@ void overlappedCompletionRoutine(DWORD dwErrorCode, DWORD dwNumberOfBytesTransfe
|
||||||
those could of course just take the value type things
|
those could of course just take the value type things
|
||||||
+/
|
+/
|
||||||
|
|
||||||
PendingOperation read(Object source, ubyte[] buffer) {
|
Object a_read(Object source, ubyte[] buffer) {
|
||||||
version(Windows) {
|
version(Windows) {
|
||||||
auto ret = ReadFileEx(source, buffer.ptr, buffer.length, &overlapped, &overlappedCompletionRoutine);
|
//auto ret = ReadFileEx(source, buffer.ptr, buffer.length, &overlapped, &overlappedCompletionRoutine);
|
||||||
// need to check GetLastError
|
// need to check GetLastError
|
||||||
|
|
||||||
// ReadFileEx always queues, even if it completed synchronously. I *could* check the get overlapped result and sleepex here but i'm prolly better off just letting the event loop do its thing anyway.
|
// ReadFileEx always queues, even if it completed synchronously. I *could* check the get overlapped result and sleepex here but i'm prolly better off just letting the event loop do its thing anyway.
|
||||||
} else version(Posix) {
|
} else version(Posix) {
|
||||||
// first try to just do it
|
// first try to just do it
|
||||||
auto ret = read(source, buffer.ptr, buffer.length);
|
//auto ret = read(source, buffer.ptr, buffer.length);
|
||||||
// then if it doesn't complete synchronously, need to event loop register
|
// then if it doesn't complete synchronously, need to event loop register
|
||||||
|
|
||||||
// if we are inside a fiber task, it can simply yield and call the fiber in the callback
|
// if we are inside a fiber task, it can simply yield and call the fiber in the callback
|
||||||
|
@ -1511,24 +1530,23 @@ PendingOperation read(Object source, ubyte[] buffer) {
|
||||||
|
|
||||||
// generally, the callback must satisfy the read somehow they set the callback to trigger the result object's completion handler
|
// generally, the callback must satisfy the read somehow they set the callback to trigger the result object's completion handler
|
||||||
}
|
}
|
||||||
return PendingOperation(null);
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/++
|
/++
|
||||||
Once an operation is complete and you're sure you are done with it, you can issue a repeated read
|
Once an operation is complete and you're sure you are done with it, you can issue a repeated read
|
||||||
+/
|
+/
|
||||||
PendingOperation read(PendingOperation recyclable, Object source, ubyte[] buffer) {
|
Object a_read(Object recyclable, Object source, ubyte[] buffer) {
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/+
|
|
||||||
Tasks:
|
|
||||||
startTask()
|
|
||||||
startSubTask() - what if it just did this when it knows it is being run from inside a task?
|
|
||||||
runHelperFunction() - whomever it reports to is the parent
|
|
||||||
+/
|
|
||||||
|
|
||||||
private class CoreEventLoopImplementation : ICoreEventLoop {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
version(Arsd_core_windows) {
|
version(Arsd_core_windows) {
|
||||||
// all event loops share the one iocp, Windows
|
// all event loops share the one iocp, Windows
|
||||||
// manages how to do it
|
// manages how to do it
|
||||||
|
@ -2353,7 +2371,7 @@ unittest {
|
||||||
+/
|
+/
|
||||||
class ExternalProcess {
|
class ExternalProcess {
|
||||||
|
|
||||||
private static version(Posix) {
|
private static version(Arsd_core_epoll) {
|
||||||
__gshared ExternalProcess[pid_t] activeChildren;
|
__gshared ExternalProcess[pid_t] activeChildren;
|
||||||
|
|
||||||
void recordChildCreated(pid_t pid, ExternalProcess proc) {
|
void recordChildCreated(pid_t pid, ExternalProcess proc) {
|
||||||
|
@ -2390,7 +2408,7 @@ class ExternalProcess {
|
||||||
}
|
}
|
||||||
|
|
||||||
this(string[] args) {
|
this(string[] args) {
|
||||||
version(Posix) {
|
version(Arsd_core_epoll) {
|
||||||
this.program = FilePath(args[0]);
|
this.program = FilePath(args[0]);
|
||||||
this.args = args;
|
this.args = args;
|
||||||
}
|
}
|
||||||
|
@ -2401,7 +2419,7 @@ class ExternalProcess {
|
||||||
This is the native version for Posix.
|
This is the native version for Posix.
|
||||||
+/
|
+/
|
||||||
this(FilePath program, string[] args) {
|
this(FilePath program, string[] args) {
|
||||||
version(Posix) {
|
version(Arsd_core_epoll) {
|
||||||
this.program = program;
|
this.program = program;
|
||||||
this.args = args;
|
this.args = args;
|
||||||
}
|
}
|
||||||
|
@ -2412,7 +2430,7 @@ class ExternalProcess {
|
||||||
int stderrBufferSize = 8 * 1024;
|
int stderrBufferSize = 8 * 1024;
|
||||||
|
|
||||||
void start() {
|
void start() {
|
||||||
version(Posix) {
|
version(Arsd_core_epoll) {
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
int[2] stdinPipes;
|
int[2] stdinPipes;
|
||||||
|
@ -2581,7 +2599,7 @@ class ExternalProcess {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private version(Posix) {
|
private version(Arsd_core_epoll) {
|
||||||
import core.sys.posix.unistd;
|
import core.sys.posix.unistd;
|
||||||
import core.sys.posix.fcntl;
|
import core.sys.posix.fcntl;
|
||||||
|
|
||||||
|
@ -2633,7 +2651,7 @@ class ExternalProcess {
|
||||||
Write `null` as data to close the pipe. Once the pipe is closed, you must not try to write to it again.
|
Write `null` as data to close the pipe. Once the pipe is closed, you must not try to write to it again.
|
||||||
+/
|
+/
|
||||||
void writeToStdin(in void[] data) {
|
void writeToStdin(in void[] data) {
|
||||||
version(Posix) {
|
version(Arsd_core_epoll) {
|
||||||
if(data is null) {
|
if(data is null) {
|
||||||
close(stdinFd);
|
close(stdinFd);
|
||||||
stdinFd = -1;
|
stdinFd = -1;
|
||||||
|
|
4
http2.d
4
http2.d
|
@ -5153,6 +5153,8 @@ class WebSocket {
|
||||||
const(char)[] reason;
|
const(char)[] reason;
|
||||||
bool wasClean;
|
bool wasClean;
|
||||||
|
|
||||||
|
string extendedErrorInformationUnstable;
|
||||||
|
|
||||||
/++
|
/++
|
||||||
See https://www.rfc-editor.org/rfc/rfc6455#section-7.4.1 for details.
|
See https://www.rfc-editor.org/rfc/rfc6455#section-7.4.1 for details.
|
||||||
+/
|
+/
|
||||||
|
@ -5253,7 +5255,7 @@ class WebSocket {
|
||||||
sock.onerror();
|
sock.onerror();
|
||||||
|
|
||||||
if(sock.onclose)
|
if(sock.onclose)
|
||||||
sock.onclose(CloseEvent(CloseEvent.StandardCloseCodes.abnormalClosure, "Connection timed out", false, int.max));
|
sock.onclose(CloseEvent(CloseEvent.StandardCloseCodes.abnormalClosure, "Connection timed out", false, null));
|
||||||
|
|
||||||
sock.socket.close();
|
sock.socket.close();
|
||||||
sock.readyState_ = CLOSED;
|
sock.readyState_ = CLOSED;
|
||||||
|
|
|
@ -7051,7 +7051,7 @@ enum Resizability {
|
||||||
History:
|
History:
|
||||||
Added November 11, 2022, but not yet implemented and may not be for some time.
|
Added November 11, 2022, but not yet implemented and may not be for some time.
|
||||||
+/
|
+/
|
||||||
/*@future*/ allowResizingMaintainingAspectRatio, // gdc 9 doesn't allow the @future thing here but that's still the intention
|
/*@__future*/ allowResizingMaintainingAspectRatio,
|
||||||
/++
|
/++
|
||||||
If possible, your drawing buffer will remain the same size and simply be automatically scaled to the new window size, letterboxing if needed to keep the aspect ratio. If this is impossible, it will fallback to [fixedSize]. The simpledisplay library will always provide the illusion that your window is the same size you requested, even if it scales things for you, meaning [width] and [height] will never change.
|
If possible, your drawing buffer will remain the same size and simply be automatically scaled to the new window size, letterboxing if needed to keep the aspect ratio. If this is impossible, it will fallback to [fixedSize]. The simpledisplay library will always provide the illusion that your window is the same size you requested, even if it scales things for you, meaning [width] and [height] will never change.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue