source: EcnlProtoTool/trunk/mrbgems/mruby-tls-openssl/include/win32netcompat.h@ 331

Last change on this file since 331 was 331, checked in by coas-nagasima, 6 years ago

prototoolに関連するプロジェクトをnewlibからmuslを使うよう変更・更新
ntshellをnewlibの下位の実装から、muslのsyscallの実装に変更・更新
以下のOSSをアップデート
・mruby-1.3.0
・musl-1.1.18
・onigmo-6.1.3
・tcc-0.9.27
以下のOSSを追加
・openssl-1.1.0e
・curl-7.57.0
・zlib-1.2.11
以下のmrbgemsを追加
・iij/mruby-digest
・iij/mruby-env
・iij/mruby-errno
・iij/mruby-iijson
・iij/mruby-ipaddr
・iij/mruby-mock
・iij/mruby-require
・iij/mruby-tls-openssl

  • Property svn:eol-style set to native
  • Property svn:mime-type set to text/x-chdr
File size: 1.9 KB
Line 
1/*
2 * Public domain
3 *
4 * BSD socket emulation code for Winsock2
5 * Brent Cook <bcook@openbsd.org>
6 */
7
8/*
9 * From
10 * https://raw.githubusercontent.com/libressl-portable/portable/master/include/compat/win32netcompat.h
11 * https://raw.githubusercontent.com/libressl-portable/portable/master/include/compat/arpa/inet.h
12 * https://raw.githubusercontent.com/libressl-portable/portable/master/include/compat/arpa/nameser.h
13 */
14
15#ifndef LIBCRYPTOCOMPAT_WIN32NETCOMPAT_H
16#define LIBCRYPTOCOMPAT_WIN32NETCOMPAT_H
17
18#ifdef _WIN32
19
20#include <ws2tcpip.h>
21#include <errno.h>
22#include <unistd.h>
23
24#ifndef SHUT_RDWR
25#define SHUT_RDWR SD_BOTH
26#endif
27#ifndef SHUT_RD
28#define SHUT_RD SD_RECEIVE
29#endif
30#ifndef SHUT_WR
31#define SHUT_WR SD_SEND
32#endif
33
34int posix_connect(int sockfd, const struct sockaddr *addr, socklen_t addrlen);
35
36int posix_close(int fd);
37ssize_t posix_read(int fd, void *buf, size_t count);
38
39ssize_t posix_write(int fd, const void *buf, size_t count);
40
41int posix_getsockopt(int sockfd, int level, int optname,
42 void *optval, socklen_t *optlen);
43
44int posix_setsockopt(int sockfd, int level, int optname,
45 const void *optval, socklen_t optlen);
46
47#ifndef NO_REDEF_POSIX_FUNCTIONS
48#define connect(sockfd, addr, addrlen) posix_connect(sockfd, addr, addrlen)
49#define close(fd) posix_close(fd)
50#define read(fd, buf, count) posix_read(fd, buf, count)
51#define write(fd, buf, count) posix_write(fd, buf, count)
52#define getsockopt(sockfd, level, optname, optval, optlen) \
53 posix_getsockopt(sockfd, level, optname, optval, optlen)
54#define setsockopt(sockfd, level, optname, optval, optlen) \
55 posix_setsockopt(sockfd, level, optname, optval, optlen)
56#endif
57
58#ifndef AI_ADDRCONFIG
59#define AI_ADDRCONFIG 0x00000400
60#endif
61
62#ifndef INADDRSZ
63#define INADDRSZ 4
64#endif
65
66#ifndef IN6ADDRSZ
67#define IN6ADDRSZ 16
68#endif
69
70#ifndef INT16SZ
71#define INT16SZ 2
72#endif
73
74int inet_pton(int af, const char * src, void * dst);
75
76#endif
77
78#endif
Note: See TracBrowser for help on using the repository browser.