Skip to content

Commit

Permalink
fix windows build (@db4, ocaml-community#72)
Browse files Browse the repository at this point in the history
  • Loading branch information
kandu committed Jun 15, 2019
1 parent 08c4285 commit d935025
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions src/lTerm_windows_stubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

#if defined(_WIN32) || defined(_WIN64)

#include <windows.h>
#include <lwt_unix.h>

/* +-----------------------------------------------------------------+
Expand Down Expand Up @@ -140,24 +139,16 @@ static void worker_read_console_input(struct job_read_console_input *job)
}
}

CAMLprim value lt_windows_read_console_input_job(value val_fd)
static value result_read_console_input(struct job_read_console_input *job)
{
LWT_UNIX_INIT_JOB(job, read_console_input, 0);
job->handle = Handle_val(val_fd);
job->error_code = 0;
CAMLreturn(lwt_unix_alloc_job(&(job->job)));
}

static value result_read_console_input_result(struct job_read_console_input *job)
{
INPUT_RECORD input;
INPUT_RECORD * input;
DWORD cks, bs;
WORD code;
int i;
CAMLparam0();
CAMLlocal3(result, x, y);
int error_code = job->error_code;
input = job->input;
input = &(job->input);
lwt_unix_free_job(&job->job);
if (error_code) {
win32_maperr(error_code);
Expand Down Expand Up @@ -212,6 +203,16 @@ static value result_read_console_input_result(struct job_read_console_input *job
CAMLreturn(Val_int(0));
}

CAMLprim value lt_windows_read_console_input_job(value val_fd)
{
CAMLparam0();
LWT_UNIX_INIT_JOB(job, read_console_input, 0);
job->handle = Handle_val(val_fd);
job->error_code = 0;
return lwt_unix_alloc_job(&(job->job));
CAMLreturn(lwt_unix_alloc_job(&(job->job)));
}

/* +-----------------------------------------------------------------+
| Console informations |
+-----------------------------------------------------------------+ */
Expand Down

0 comments on commit d935025

Please # to comment.