Skip to content

Commit 1454e1f

Browse files
More compatibility issues
1 parent f1ae46e commit 1454e1f

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

pyml_stubs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ file_of_file_descr(value file_descr, const char *mode)
8383
{
8484
CAMLparam1(file_descr);
8585
int fd = win_CRT_fd_of_filedescr(file_descr);
86-
FILE *result = _fdopen(dup(fd), mode);
86+
FILE *result = _fdopen(_dup(fd), mode);
8787
CAMLreturnT(FILE *, result);
8888
}
8989
#else

pyml_stubs.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#ifndef _PYML_STUBS_H_
22
#define _PYML_STUBS_H_
33
#include <stdbool.h>
4+
#include <stdint.h>
45

56
/* The following definitions are extracted and simplified from
67
#include <Python.h>
@@ -11,6 +12,8 @@
1112
#if defined(_MSC_VER)
1213
#include <BaseTsd.h>
1314
typedef SSIZE_T ssize_t;
15+
#else
16+
#include <unistd.h>
1417
#endif
1518

1619
typedef ssize_t Py_ssize_t;

0 commit comments

Comments
 (0)