Add compat bits for libtls on Windows

This commit is contained in:
kinichiro
2018-02-25 01:59:39 +09:00
parent 47781e69e2
commit 3681d02253
8 changed files with 110 additions and 0 deletions

View File

@@ -21,6 +21,7 @@
#ifdef __MINGW32__
#include <_bsd_types.h>
typedef uint32_t in_addr_t;
typedef uint32_t uid_t;
#endif
#ifdef _MSC_VER
@@ -29,6 +30,7 @@ typedef unsigned short u_short;
typedef unsigned int u_int;
typedef uint32_t in_addr_t;
typedef uint32_t mode_t;
typedef uint32_t uid_t;
#include <basetsd.h>
typedef SSIZE_T ssize_t;

View File

@@ -7,7 +7,16 @@
#define LIBCRYPTOCOMPAT_UNISTD_H
#ifndef _MSC_VER
#include_next <unistd.h>
#ifdef __MINGW32__
int ftruncate(int fd, off_t length);
uid_t getuid(void);
ssize_t pread(int d, void *buf, size_t nbytes, off_t offset);
ssize_t pwrite(int d, const void *buf, size_t nbytes, off_t offset);
#endif
#else
#include <stdlib.h>
@@ -22,10 +31,19 @@
#define X_OK 0
#define F_OK 0
#define SEEK_SET 0
#define SEEK_CUR 1
#define SEEK_END 2
#define access _access
unsigned int sleep(unsigned int seconds);
int ftruncate(int fd, off_t length);
uid_t getuid(void);
ssize_t pread(int d, void *buf, size_t nbytes, off_t offset);
ssize_t pwrite(int d, const void *buf, size_t nbytes, off_t offset);
#endif
#ifndef HAVE_GETENTROPY