The MinGW.org Windows System Libraries
修订版 | be218568e9ed4ef533763dbe34025c5562faf6d2 (tree) |
---|---|
时间 | 2017-11-14 19:19:03 |
作者 | Keith Marshall <keith@user...> |
Commiter | Keith Marshall |
Update gethostname() declaration; drop Cygwin specificity.
@@ -1,3 +1,12 @@ | ||
1 | +2017-11-14 Keith Marshall <keith@users.osdn.me> | |
2 | + | |
3 | + Update gethostname() declaration; drop Cygwin specificity. | |
4 | + | |
5 | + * include/winsock.h (gethostname): Declare unconditionally; add... | |
6 | + (WINSOCK_API_LINKAGE): ...this DLL import control attribute. | |
7 | + [!(defined __INSIDE_CYGWIN__ || defined __INSIDE_MSYS__)]: Recast... | |
8 | + [!defined __INSIDE_MSYS__]: ...as this, throughout. | |
9 | + | |
1 | 10 | 2017-11-09 Keith Marshall <keith@users.osdn.me> |
2 | 11 | |
3 | 12 | Normalize fd_set event macros for <winsock2.h> compatibility. |
@@ -202,7 +202,7 @@ __CRT_ALIAS void __FD_ZERO (fd_set *__set) | ||
202 | 202 | #warning "Your <sys/types.h> may cause runtime problems with W32 sockets." |
203 | 203 | #endif /* !_SYS_TYPES_FD_SET */ |
204 | 204 | |
205 | -#if ! (defined __INSIDE_CYGWIN__ || defined __INSIDE_MSYS__) | |
205 | +#ifndef __INSIDE_MSYS__ | |
206 | 206 | |
207 | 207 | struct hostent |
208 | 208 | { char *h_name; |
@@ -218,7 +218,7 @@ struct linger | ||
218 | 218 | u_short l_linger; |
219 | 219 | }; |
220 | 220 | |
221 | -#endif /* ! (__INSIDE_CYGWIN__ || __INSIDE_MSYS__) */ | |
221 | +#endif /* !__INSIDE_MSYS__ */ | |
222 | 222 | |
223 | 223 | #define IOCPARM_MASK 0x7F |
224 | 224 | #define IOC_VOID 0x20000000 |
@@ -226,7 +226,7 @@ struct linger | ||
226 | 226 | #define IOC_IN 0x80000000 |
227 | 227 | #define IOC_INOUT (IOC_IN | IOC_OUT) |
228 | 228 | |
229 | -#if ! (defined __INSIDE_CYGWIN__ || defined __INSIDE_MSYS__) | |
229 | +#ifndef __INSIDE_MSYS__ | |
230 | 230 | |
231 | 231 | #define _IO(x,y) (IOC_VOID|((x)<<8)|(y)) |
232 | 232 | #define _IOR(x,y,t) (IOC_OUT|(((long)sizeof(t)&IOCPARM_MASK)<<16)|((x)<<8)|(y)) |
@@ -234,7 +234,7 @@ struct linger | ||
234 | 234 | |
235 | 235 | #define FIONBIO _IOW('f', 126, u_long) |
236 | 236 | |
237 | -#endif /* ! (__INSIDE_CYGWIN__ || __INSIDE_MSYS__) */ | |
237 | +#endif /* !__INSIDE_MSYS__ */ | |
238 | 238 | |
239 | 239 | #define FIONREAD _IOR('f', 127, u_long) |
240 | 240 | #define FIOASYNC _IOW('f', 125, u_long) |
@@ -244,7 +244,7 @@ struct linger | ||
244 | 244 | #define SIOCGLOWAT _IOR('s', 3, u_long) |
245 | 245 | #define SIOCATMARK _IOR('s', 7, u_long) |
246 | 246 | |
247 | -#if ! ( defined __INSIDE_CYGWIN__ || defined __INSIDE_MSYS__) | |
247 | +#ifndef __INSIDE_MSYS__ | |
248 | 248 | |
249 | 249 | struct netent |
250 | 250 | { char *n_name; |
@@ -266,7 +266,7 @@ struct protoent | ||
266 | 266 | short p_proto; |
267 | 267 | }; |
268 | 268 | |
269 | -#endif /* ! (__INSIDE_CYGWIN__ || __INSIDE_MSYS__) */ | |
269 | +#endif /* !__INSIDE_MSYS__ */ | |
270 | 270 | |
271 | 271 | #define IPPROTO_IP 0 |
272 | 272 | #define IPPROTO_ICMP 1 |
@@ -451,7 +451,7 @@ struct ip_mreq | ||
451 | 451 | #define AF_ATM 22 |
452 | 452 | #define AF_INET6 23 |
453 | 453 | |
454 | -#if ! (defined __INSIDE_CYGWIN__ || defined __INSIDE_MSYS__) | |
454 | +#ifndef __INSIDE_MSYS__ | |
455 | 455 | |
456 | 456 | #define AF_MAX 24 |
457 | 457 |
@@ -460,7 +460,7 @@ struct sockaddr | ||
460 | 460 | char sa_data[14]; |
461 | 461 | }; |
462 | 462 | |
463 | -#endif /* ! (__INSIDE_CYGWIN__ || __INSIDE_MSYS__) */ | |
463 | +#endif /* !__INSIDE_MSYS__ */ | |
464 | 464 | |
465 | 465 | struct sockproto |
466 | 466 | { u_short sp_family; |
@@ -508,13 +508,13 @@ struct sockproto | ||
508 | 508 | #define SOMAXCONN 5 |
509 | 509 | #endif /* !_WINSOCK2_H */ |
510 | 510 | |
511 | -#if ! (defined __INSIDE_CYGWIN__ || defined __INSIDE_MSYS__) | |
511 | +#ifndef __INSIDE_MSYS__ | |
512 | 512 | |
513 | 513 | #define MSG_OOB 1 |
514 | 514 | #define MSG_PEEK 2 |
515 | 515 | #define MSG_DONTROUTE 4 |
516 | 516 | |
517 | -#endif /* ! (__INSIDE_CYGWIN__ || __INSIDE_MSYS__) */ | |
517 | +#endif /* !__INSIDE_MSYS__ */ | |
518 | 518 | |
519 | 519 | #define MSG_MAXIOVLEN 16 |
520 | 520 | #define MSG_PARTIAL 0x8000 |
@@ -571,7 +571,7 @@ enum | ||
571 | 571 | |
572 | 572 | #define WSANO_ADDRESS WSANO_DATA |
573 | 573 | |
574 | -#if ! (defined __INSIDE_CYGWIN__ || defined __INSIDE_MSYS__) | |
574 | +#ifndef __INSIDE_MSYS__ | |
575 | 575 | |
576 | 576 | #define h_errno WSAGetLastError() |
577 | 577 | #define HOST_NOT_FOUND WSAHOST_NOT_FOUND |
@@ -580,7 +580,7 @@ enum | ||
580 | 580 | #define NO_DATA WSANO_DATA |
581 | 581 | #define NO_ADDRESS WSANO_ADDRESS |
582 | 582 | |
583 | -#endif /* ! (__INSIDE_CYGWIN__ || __INSIDE_MSYS__) */ | |
583 | +#endif /* !__INSIDE_MSYS__ */ | |
584 | 584 | |
585 | 585 | WINSOCK_API_LINKAGE SOCKET PASCAL accept (SOCKET, struct sockaddr *, int *); |
586 | 586 |
@@ -638,7 +638,7 @@ WINSOCK_API_LINKAGE HANDLE PASCAL WSAAsyncGetHostByAddr (HWND, u_int, const char | ||
638 | 638 | WINSOCK_API_LINKAGE int PASCAL WSACancelAsyncRequest (HANDLE); |
639 | 639 | WINSOCK_API_LINKAGE int PASCAL WSAAsyncSelect (SOCKET, HWND, u_int, long); |
640 | 640 | |
641 | -#if ! (defined __INSIDE_CYGWIN__ || defined __INSIDE_MSYS__) | |
641 | +#ifndef __INSIDE_MSYS__ | |
642 | 642 | |
643 | 643 | WINSOCK_API_LINKAGE u_long PASCAL htonl (u_long); |
644 | 644 | WINSOCK_API_LINKAGE u_long PASCAL ntohl (u_long); |
@@ -646,13 +646,9 @@ WINSOCK_API_LINKAGE u_short PASCAL htons (u_short); | ||
646 | 646 | WINSOCK_API_LINKAGE u_short PASCAL ntohs (u_short); |
647 | 647 | WINSOCK_API_LINKAGE int PASCAL select (int nfds, fd_set *, fd_set *, fd_set *, const struct timeval *); |
648 | 648 | |
649 | -/* FIXME: <winsock2.h> moves the following declaration out of the | |
650 | - * !(__INSIDE_CYGWIN__||__INSIDE_MSYS__) filter; which is correct? | |
651 | - * Furthermore, should this not also have WINSOCK_API_LINKAGE? | |
652 | - */ | |
653 | -int PASCAL gethostname (char *, int); | |
649 | +#endif /* !__INSIDE_MSYS__ */ | |
654 | 650 | |
655 | -#endif /* ! (__INSIDE_CYGWIN__ || __INSIDE_MSYS__) */ | |
651 | +WINSOCK_API_LINKAGE int PASCAL gethostname (char *, int); | |
656 | 652 | |
657 | 653 | #define WSAMAKEASYNCREPLY(b,e) MAKELONG(b,e) |
658 | 654 | #define WSAMAKESELECTREPLY(e,error) MAKELONG(e,error) |