mirror of
https://github.com/wassname/ray.git
synced 2026-08-04 13:14:14 +08:00
Windows compatibility (#57)
* Add Python and Redis submodules, and remove old third-party modules
* Update VS projects (WARNING: references files that do not exist yet)
* Update code & add shims for APIs except AF_UNIX/{send,recv}msg()
* Minor style changes.
This commit is contained in:
committed by
Robert Nishihara
parent
a93c6b7596
commit
7237ec4124
@@ -201,7 +201,7 @@ TEST task_table_all_test(void) {
|
||||
}
|
||||
|
||||
TEST unique_client_id_test(void) {
|
||||
const int num_conns = 100;
|
||||
enum { num_conns = 100 };
|
||||
|
||||
db_client_id ids[num_conns];
|
||||
db_handle *db;
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
SUITE(io_tests);
|
||||
|
||||
TEST ipc_socket_test(void) {
|
||||
#ifndef _WIN32
|
||||
const char *socket_pathname = "test-socket";
|
||||
int socket_fd = bind_ipc_sock(socket_pathname, true);
|
||||
ASSERT(socket_fd >= 0);
|
||||
@@ -44,11 +45,12 @@ TEST ipc_socket_test(void) {
|
||||
close(socket_fd);
|
||||
unlink(socket_pathname);
|
||||
}
|
||||
|
||||
#endif
|
||||
PASS();
|
||||
}
|
||||
|
||||
TEST long_ipc_socket_test(void) {
|
||||
#ifndef _WIN32
|
||||
const char *socket_pathname = "long-test-socket";
|
||||
int socket_fd = bind_ipc_sock(socket_pathname, true);
|
||||
ASSERT(socket_fd >= 0);
|
||||
@@ -89,6 +91,7 @@ TEST long_ipc_socket_test(void) {
|
||||
}
|
||||
|
||||
utstring_free(test_string);
|
||||
#endif
|
||||
PASS();
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
#include "task.h"
|
||||
|
||||
task_spec *example_task_spec(void) {
|
||||
static task_spec *example_task_spec(void) {
|
||||
task_id parent_task_id = globally_unique_id();
|
||||
function_id func_id = globally_unique_id();
|
||||
task_spec *task =
|
||||
@@ -16,7 +16,7 @@ task_spec *example_task_spec(void) {
|
||||
return task;
|
||||
}
|
||||
|
||||
task *example_task(void) {
|
||||
static task *example_task(void) {
|
||||
task_spec *spec = example_task_spec();
|
||||
task *instance = alloc_task(spec, TASK_STATUS_WAITING, NIL_ID);
|
||||
free_task_spec(spec);
|
||||
@@ -24,7 +24,7 @@ task *example_task(void) {
|
||||
}
|
||||
|
||||
/* Flush redis. */
|
||||
void flushall_redis() {
|
||||
static void flushall_redis() {
|
||||
redisContext *context = redisConnect("127.0.0.1", 6379);
|
||||
freeReplyObject(redisCommand(context, "FLUSHALL"));
|
||||
redisFree(context);
|
||||
|
||||
Reference in New Issue
Block a user