-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix test compilation errors on Windows #144
base: master
Are you sure you want to change the base?
Conversation
* Disable EVFILT_PROC as this is not supported. * Initialize kevent() timeouts using an older syntax. * Use Sleep() instead of usleep(). * Disable test_transition_from_write_to_read(). * Emulate the POSIX API for shutdown(2) and pipe(2).
The tests don't actually run successfully, but at least they compile. |
|
||
EV_SET(&kev, 0, EVFILT_LIBKQUEUE, EV_ADD, NOTE_VERSION, 0, NULL); | ||
if (kevent(ctx->kqfd, &kev, 1, &receipt, 1, &(struct timespec){}) != 1) { | ||
if (kevent(ctx->kqfd, &kev, 1, &receipt, 1, &ts) != 1) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Windows still doesn't support C11?!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it still doesn't support compound literals. I even tried enabling the latest conforming preprocessor:
#define SHUT_RDWR SD_BOTH | ||
|
||
/* Emulate the POSIX pipe(2) interface */ | ||
#define pipe(x) _pipe(x, 512, 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd wrap a lot of these in ifdef _MSC_VER
MinGW supports a lot of this, including pthread.
@@ -16,6 +16,12 @@ | |||
|
|||
#include "common.h" | |||
|
|||
#if defined(_WIN32) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MinGW supports usleep.
6eba1b5
to
24f20f0
Compare
No description provided.