diff options
| author | kinichiro <kinichiro.inoguchi@gmail.com> | 2018-02-25 01:59:39 +0900 |
|---|---|---|
| committer | kinichiro <kinichiro.inoguchi@gmail.com> | 2018-02-25 21:56:05 +0900 |
| commit | 3681d02253d29229e265720984ce81a35206de4c (patch) | |
| tree | 95590bed234fb09e40e14feb5cdb6c0120f07334 /include | |
| parent | 47781e69e2946011ea7bd0723e98a2fedff88980 (diff) | |
| download | portable-3681d02253d29229e265720984ce81a35206de4c.tar.gz portable-3681d02253d29229e265720984ce81a35206de4c.tar.bz2 portable-3681d02253d29229e265720984ce81a35206de4c.zip | |
Add compat bits for libtls on Windows
Diffstat (limited to 'include')
| -rw-r--r-- | include/compat/sys/types.h | 2 | ||||
| -rw-r--r-- | include/compat/unistd.h | 18 |
2 files changed, 20 insertions, 0 deletions
diff --git a/include/compat/sys/types.h b/include/compat/sys/types.h index 473d6da..2107119 100644 --- a/include/compat/sys/types.h +++ b/include/compat/sys/types.h | |||
| @@ -21,6 +21,7 @@ | |||
| 21 | #ifdef __MINGW32__ | 21 | #ifdef __MINGW32__ |
| 22 | #include <_bsd_types.h> | 22 | #include <_bsd_types.h> |
| 23 | typedef uint32_t in_addr_t; | 23 | typedef uint32_t in_addr_t; |
| 24 | typedef uint32_t uid_t; | ||
| 24 | #endif | 25 | #endif |
| 25 | 26 | ||
| 26 | #ifdef _MSC_VER | 27 | #ifdef _MSC_VER |
| @@ -29,6 +30,7 @@ typedef unsigned short u_short; | |||
| 29 | typedef unsigned int u_int; | 30 | typedef unsigned int u_int; |
| 30 | typedef uint32_t in_addr_t; | 31 | typedef uint32_t in_addr_t; |
| 31 | typedef uint32_t mode_t; | 32 | typedef uint32_t mode_t; |
| 33 | typedef uint32_t uid_t; | ||
| 32 | 34 | ||
| 33 | #include <basetsd.h> | 35 | #include <basetsd.h> |
| 34 | typedef SSIZE_T ssize_t; | 36 | typedef SSIZE_T ssize_t; |
diff --git a/include/compat/unistd.h b/include/compat/unistd.h index d596043..e70a390 100644 --- a/include/compat/unistd.h +++ b/include/compat/unistd.h | |||
| @@ -7,7 +7,16 @@ | |||
| 7 | #define LIBCRYPTOCOMPAT_UNISTD_H | 7 | #define LIBCRYPTOCOMPAT_UNISTD_H |
| 8 | 8 | ||
| 9 | #ifndef _MSC_VER | 9 | #ifndef _MSC_VER |
| 10 | |||
| 10 | #include_next <unistd.h> | 11 | #include_next <unistd.h> |
| 12 | |||
| 13 | #ifdef __MINGW32__ | ||
| 14 | int ftruncate(int fd, off_t length); | ||
| 15 | uid_t getuid(void); | ||
| 16 | ssize_t pread(int d, void *buf, size_t nbytes, off_t offset); | ||
| 17 | ssize_t pwrite(int d, const void *buf, size_t nbytes, off_t offset); | ||
| 18 | #endif | ||
| 19 | |||
| 11 | #else | 20 | #else |
| 12 | 21 | ||
| 13 | #include <stdlib.h> | 22 | #include <stdlib.h> |
| @@ -22,10 +31,19 @@ | |||
| 22 | #define X_OK 0 | 31 | #define X_OK 0 |
| 23 | #define F_OK 0 | 32 | #define F_OK 0 |
| 24 | 33 | ||
| 34 | #define SEEK_SET 0 | ||
| 35 | #define SEEK_CUR 1 | ||
| 36 | #define SEEK_END 2 | ||
| 37 | |||
| 25 | #define access _access | 38 | #define access _access |
| 26 | 39 | ||
| 27 | unsigned int sleep(unsigned int seconds); | 40 | unsigned int sleep(unsigned int seconds); |
| 28 | 41 | ||
| 42 | int ftruncate(int fd, off_t length); | ||
| 43 | uid_t getuid(void); | ||
| 44 | ssize_t pread(int d, void *buf, size_t nbytes, off_t offset); | ||
| 45 | ssize_t pwrite(int d, const void *buf, size_t nbytes, off_t offset); | ||
| 46 | |||
| 29 | #endif | 47 | #endif |
| 30 | 48 | ||
| 31 | #ifndef HAVE_GETENTROPY | 49 | #ifndef HAVE_GETENTROPY |
