• R/O
  • HTTP
  • SSH
  • HTTPS

mingw-org-wsl: Commit

The MinGW.OSDN Windows System Libraries. Formerly designated as "MinGW.org Windows System Libraries", this encapsulates the "mingwrt" C runtime library extensions, and the "w32api" 32-bit MS-Windows API libraries.

Please note that this project no longer owns the "MinGW.org" domain name; any software which may be distributed from that domain is NOT supported by this project.


Commit MetaInfo

Revisionbe218568e9ed4ef533763dbe34025c5562faf6d2 (tree)
Time2017-11-14 19:19:03
AuthorKeith Marshall <keith@user...>
CommiterKeith Marshall

Log Message

Update gethostname() declaration; drop Cygwin specificity.

Change Summary

Incremental Difference

--- a/w32api/ChangeLog
+++ b/w32api/ChangeLog
@@ -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+
110 2017-11-09 Keith Marshall <keith@users.osdn.me>
211
312 Normalize fd_set event macros for <winsock2.h> compatibility.
--- a/w32api/include/winsock.h
+++ b/w32api/include/winsock.h
@@ -202,7 +202,7 @@ __CRT_ALIAS void __FD_ZERO (fd_set *__set)
202202 #warning "Your <sys/types.h> may cause runtime problems with W32 sockets."
203203 #endif /* !_SYS_TYPES_FD_SET */
204204
205-#if ! (defined __INSIDE_CYGWIN__ || defined __INSIDE_MSYS__)
205+#ifndef __INSIDE_MSYS__
206206
207207 struct hostent
208208 { char *h_name;
@@ -218,7 +218,7 @@ struct linger
218218 u_short l_linger;
219219 };
220220
221-#endif /* ! (__INSIDE_CYGWIN__ || __INSIDE_MSYS__) */
221+#endif /* !__INSIDE_MSYS__ */
222222
223223 #define IOCPARM_MASK 0x7F
224224 #define IOC_VOID 0x20000000
@@ -226,7 +226,7 @@ struct linger
226226 #define IOC_IN 0x80000000
227227 #define IOC_INOUT (IOC_IN | IOC_OUT)
228228
229-#if ! (defined __INSIDE_CYGWIN__ || defined __INSIDE_MSYS__)
229+#ifndef __INSIDE_MSYS__
230230
231231 #define _IO(x,y) (IOC_VOID|((x)<<8)|(y))
232232 #define _IOR(x,y,t) (IOC_OUT|(((long)sizeof(t)&IOCPARM_MASK)<<16)|((x)<<8)|(y))
@@ -234,7 +234,7 @@ struct linger
234234
235235 #define FIONBIO _IOW('f', 126, u_long)
236236
237-#endif /* ! (__INSIDE_CYGWIN__ || __INSIDE_MSYS__) */
237+#endif /* !__INSIDE_MSYS__ */
238238
239239 #define FIONREAD _IOR('f', 127, u_long)
240240 #define FIOASYNC _IOW('f', 125, u_long)
@@ -244,7 +244,7 @@ struct linger
244244 #define SIOCGLOWAT _IOR('s', 3, u_long)
245245 #define SIOCATMARK _IOR('s', 7, u_long)
246246
247-#if ! ( defined __INSIDE_CYGWIN__ || defined __INSIDE_MSYS__)
247+#ifndef __INSIDE_MSYS__
248248
249249 struct netent
250250 { char *n_name;
@@ -266,7 +266,7 @@ struct protoent
266266 short p_proto;
267267 };
268268
269-#endif /* ! (__INSIDE_CYGWIN__ || __INSIDE_MSYS__) */
269+#endif /* !__INSIDE_MSYS__ */
270270
271271 #define IPPROTO_IP 0
272272 #define IPPROTO_ICMP 1
@@ -451,7 +451,7 @@ struct ip_mreq
451451 #define AF_ATM 22
452452 #define AF_INET6 23
453453
454-#if ! (defined __INSIDE_CYGWIN__ || defined __INSIDE_MSYS__)
454+#ifndef __INSIDE_MSYS__
455455
456456 #define AF_MAX 24
457457
@@ -460,7 +460,7 @@ struct sockaddr
460460 char sa_data[14];
461461 };
462462
463-#endif /* ! (__INSIDE_CYGWIN__ || __INSIDE_MSYS__) */
463+#endif /* !__INSIDE_MSYS__ */
464464
465465 struct sockproto
466466 { u_short sp_family;
@@ -508,13 +508,13 @@ struct sockproto
508508 #define SOMAXCONN 5
509509 #endif /* !_WINSOCK2_H */
510510
511-#if ! (defined __INSIDE_CYGWIN__ || defined __INSIDE_MSYS__)
511+#ifndef __INSIDE_MSYS__
512512
513513 #define MSG_OOB 1
514514 #define MSG_PEEK 2
515515 #define MSG_DONTROUTE 4
516516
517-#endif /* ! (__INSIDE_CYGWIN__ || __INSIDE_MSYS__) */
517+#endif /* !__INSIDE_MSYS__ */
518518
519519 #define MSG_MAXIOVLEN 16
520520 #define MSG_PARTIAL 0x8000
@@ -571,7 +571,7 @@ enum
571571
572572 #define WSANO_ADDRESS WSANO_DATA
573573
574-#if ! (defined __INSIDE_CYGWIN__ || defined __INSIDE_MSYS__)
574+#ifndef __INSIDE_MSYS__
575575
576576 #define h_errno WSAGetLastError()
577577 #define HOST_NOT_FOUND WSAHOST_NOT_FOUND
@@ -580,7 +580,7 @@ enum
580580 #define NO_DATA WSANO_DATA
581581 #define NO_ADDRESS WSANO_ADDRESS
582582
583-#endif /* ! (__INSIDE_CYGWIN__ || __INSIDE_MSYS__) */
583+#endif /* !__INSIDE_MSYS__ */
584584
585585 WINSOCK_API_LINKAGE SOCKET PASCAL accept (SOCKET, struct sockaddr *, int *);
586586
@@ -638,7 +638,7 @@ WINSOCK_API_LINKAGE HANDLE PASCAL WSAAsyncGetHostByAddr (HWND, u_int, const char
638638 WINSOCK_API_LINKAGE int PASCAL WSACancelAsyncRequest (HANDLE);
639639 WINSOCK_API_LINKAGE int PASCAL WSAAsyncSelect (SOCKET, HWND, u_int, long);
640640
641-#if ! (defined __INSIDE_CYGWIN__ || defined __INSIDE_MSYS__)
641+#ifndef __INSIDE_MSYS__
642642
643643 WINSOCK_API_LINKAGE u_long PASCAL htonl (u_long);
644644 WINSOCK_API_LINKAGE u_long PASCAL ntohl (u_long);
@@ -646,13 +646,9 @@ WINSOCK_API_LINKAGE u_short PASCAL htons (u_short);
646646 WINSOCK_API_LINKAGE u_short PASCAL ntohs (u_short);
647647 WINSOCK_API_LINKAGE int PASCAL select (int nfds, fd_set *, fd_set *, fd_set *, const struct timeval *);
648648
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__ */
654650
655-#endif /* ! (__INSIDE_CYGWIN__ || __INSIDE_MSYS__) */
651+WINSOCK_API_LINKAGE int PASCAL gethostname (char *, int);
656652
657653 #define WSAMAKEASYNCREPLY(b,e) MAKELONG(b,e)
658654 #define WSAMAKESELECTREPLY(e,error) MAKELONG(e,error)
Show on old repository browser