Merge pull request #9884 from dra27/cygwin64-prereq-6

Missing declarations in io.h [Cygwin64 pre-req 6/6]
master
David Allsopp 2020-09-09 09:24:34 +01:00 committed by GitHub
commit 6dc2457036
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 6 deletions

View File

@ -70,7 +70,11 @@ enum {
CAMLextern struct channel * caml_open_descriptor_in (int); CAMLextern struct channel * caml_open_descriptor_in (int);
CAMLextern struct channel * caml_open_descriptor_out (int); CAMLextern struct channel * caml_open_descriptor_out (int);
CAMLextern void caml_close_channel (struct channel *); CAMLextern void caml_close_channel (struct channel *);
CAMLextern file_offset caml_channel_size (struct channel *);
CAMLextern void caml_seek_in (struct channel *, file_offset);
CAMLextern void caml_seek_out (struct channel *, file_offset);
CAMLextern file_offset caml_pos_in (struct channel *);
CAMLextern file_offset caml_pos_out (struct channel *);
/* I/O on channels from C. The channel must be locked (see below) before /* I/O on channels from C. The channel must be locked (see below) before
calling any of the functions and macros below */ calling any of the functions and macros below */

View File

@ -275,8 +275,7 @@ CAMLexport file_offset caml_pos_out(struct channel *channel)
/* Input */ /* Input */
/* caml_do_read is exported for Cash */ int caml_do_read(int fd, char *p, unsigned int n)
CAMLexport int caml_do_read(int fd, char *p, unsigned int n)
{ {
int r; int r;
do { do {
@ -379,7 +378,7 @@ CAMLexport file_offset caml_pos_in(struct channel *channel)
return channel->offset - (file_offset)(channel->max - channel->curr); return channel->offset - (file_offset)(channel->max - channel->curr);
} }
CAMLexport intnat caml_input_scan_line(struct channel *channel) intnat caml_input_scan_line(struct channel *channel)
{ {
char * p; char * p;
int n; int n;
@ -426,8 +425,7 @@ CAMLexport intnat caml_input_scan_line(struct channel *channel)
objects into a heap-allocated object. Perform locking objects into a heap-allocated object. Perform locking
and unlocking around the I/O operations. */ and unlocking around the I/O operations. */
/* FIXME CAMLexport, but not in io.h exported for Cash ? */ void caml_finalize_channel(value vchan)
CAMLexport void caml_finalize_channel(value vchan)
{ {
struct channel * chan = Channel(vchan); struct channel * chan = Channel(vchan);
if ((chan->flags & CHANNEL_FLAG_MANAGED_BY_GC) == 0) return; if ((chan->flags & CHANNEL_FLAG_MANAGED_BY_GC) == 0) return;