• R/O
  • HTTP
  • SSH
  • HTTPS

mingw-org-wsl: Commit

The MinGW.org Windows System Libraries


Commit MetaInfo

Revisiónb6cf78ea43d348f29f89988f31062493e0329370 (tree)
Tiempo2019-02-04 00:47:20
AutorKeith Marshall <keith@user...>
CommiterKeith Marshall

Log Message

Clean up winsock default version selection stratagem.

Cambiar Resumen

Diferencia

--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
1+2019-02-02 Keith Marshall <keith@users.osdn.me>
2+
3+ Add build option for <features.h> sample distribution.
4+
5+ * configure.ac (lua): Add AC_PATH_PROG check; assign result to...
6+ (LUA): ...this new AC_SUBST propagated macro definition.
7+
8+ * Makefile.in (dist): Add dependencies on...
9+ (dist-prepare, dist-extra): ...these new goals; implement...
10+ (dist-prepare): ...to initialize an empty staging directory, and...
11+ (dist-extra): ...incorporate optional distributable components.
12+ (features.stamp): New optional goal; selected by definition of...
13+ (FEATURES): ...this user specified macro, nominally defined by...
14+ (option, options): ...evaluation of command line assignment.
15+ (features.lua, features.unsupported): New prerequisite goals.
16+ (WSL_TMPDIR, FEATURES_H_INITIALIZE, FEATURES_CFG, LUA, LUACMD)
17+ (TODAY, ISSUE): New supporting macros; define them.
18+
119 2019-01-22 Keith Marshall <keith@users.osdn.me>
220
321 Adjust repository version following WSL-5.2.1 release.
--- a/mingwrt/ChangeLog
+++ b/mingwrt/ChangeLog
@@ -1,21 +1,3 @@
1-2019-02-02 Keith Marshall <keith@users.osdn.me>
2-
3- Add build option for <features.h> sample distribution.
4-
5- * configure.ac (lua): Add AC_PATH_PROG check; assign result to...
6- (LUA): ...this new AC_SUBST propagated macro definition.
7-
8- * Makefile.in (dist): Add dependencies on...
9- (dist-prepare, dist-extra): ...these new goals; implement...
10- (dist-prepare): ...to initialize an empty staging directory, and...
11- (dist-extra): ...incorporate optional distributable components.
12- (features.stamp): New optional goal; selected by definition of...
13- (FEATURES): ...this user specified macro, nominally defined by...
14- (option, options): ...evaluation of command line assignment.
15- (features.lua, features.unsupported): New prerequisite goals.
16- (WSL_TMPDIR, FEATURES_H_INITIALIZE, FEATURES_CFG, LUA, LUACMD)
17- (TODAY, ISSUE): New supporting macros; define them.
18-
191 2019-01-22 Keith Marshall <keith@users.osdn.me>
202
213 Prepare and publish MinGW.org WSL-5.2.1 release.
--- a/w32api/ChangeLog
+++ b/w32api/ChangeLog
@@ -1,3 +1,22 @@
1+2019-02-03 Keith Marshall <keith@users.osdn.me>
2+
3+ Clean up winsock default version selection stratagem.
4+
5+ * include/winsock.h [_WINSOCK_H]: Defer definition until within new
6+ internal recursion breaking retest block; following evaluation of...
7+ [__USE_MINGW_WINSOCK_DEFAULT]: ...this, whence <winsock2.h> may be
8+ included, reproducing the original version selection logic from...
9+ * include/_winsock.h: ...here; file is now obsolete; delete it.
10+
11+ * include/winsock2.h (__USE_MINGW_WINSOCK_DEFAULT): Undefine it,
12+ before including <winsock.h>
13+
14+ * include/windows.h include/nspapi.h include/wsnetbs.h: Define...
15+ (__USE_MINGW_WINSOCK_DEFAULT): ...this, and then include <winsock.h>
16+ instead of deleted file <_winsock.h>
17+
18+ * tests/headers.at: Regenerated.
19+
120 2019-01-22 Keith Marshall <keith@users.osdn.me>
221
322 Prepare and publish MinGW.org WSL-5.2.1 release.
--- a/w32api/include/_winsock.h
+++ /dev/null
@@ -1,59 +0,0 @@
1-/*
2- * _winsock.h
3- *
4- * A private system header, included wherever other system headers may
5- * require declaration of the WinSock API, without explicitly specifying
6- * a particular WinSock version dependency.
7- *
8- *
9- * $Id$
10- *
11- * Written by Keith Marshall <keith@users.osdn.me>
12- * Copyright (C) 2017, MinGW.org Project
13- *
14- *
15- * Permission is hereby granted, free of charge, to any person obtaining a
16- * copy of this software and associated documentation files (the "Software"),
17- * to deal in the Software without restriction, including without limitation
18- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
19- * and/or sell copies of the Software, and to permit persons to whom the
20- * Software is furnished to do so, subject to the following conditions:
21- *
22- * The above copyright notice and this permission notice (including the next
23- * paragraph) shall be included in all copies or substantial portions of the
24- * Software.
25- *
26- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
27- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
28- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
29- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
30- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
31- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
32- * DEALINGS IN THE SOFTWARE.
33- *
34- */
35-#ifndef _WINSOCK_H
36-#pragma GCC system_header
37-
38-/* The WinSock API dependency may be satisfied by including either <winsock.h>
39- * or <winsock2.h>; note that, regardless of whichever of these alternatives we
40- * choose, _WINSOCK_H will become defined, thus satisfying the repeat inclusion
41- * guard for this header file itself, without any requirement for us to provide
42- * an explicit definition herein.
43- */
44-#include <sdkddkver.h>
45-#if _WIN32_WINNT >= _WIN32_WINNT_NT4
46-/* When the target operating system is WinNT4, or later, we prefer to support
47- * the WinSock v2 API, by default; (this is consistent with the default choice
48- * which was traditionally specified within MinGW.org's <windows.h>)...
49- */
50-#include <winsock2.h>
51-
52-#else
53-/* ...whereas, for operating systems predating WinNT4, we elect to offer
54- * support for only WinSock v1.1
55- */
56-#include <winsock.h>
57-#endif
58-
59-#endif /* !_WINSOCK_H: $RCSfile$: end of file */
--- a/w32api/include/nspapi.h
+++ b/w32api/include/nspapi.h
@@ -7,7 +7,7 @@
77 * $Id$
88 *
99 * Written by Anders Norlander <anorland@hem2.passagen.se>
10- * Copyright (C) 1998, 1999, 2002, 2004, 2017, MinGW.org Project
10+ * Copyright (C) 1998, 1999, 2002, 2004, 2017, 2019, MinGW.org Project
1111 *
1212 *
1313 * Permission is hereby granted, free of charge, to any person obtaining a
@@ -42,12 +42,14 @@
4242 * the full content, we must process the WinSock API declarations from
4343 * <winsock.h> or <winsock2.h>, BEFORE we define the <nspapi.h> repeat
4444 * inclusion guard, so that <winsock2.h> may, if necessary, recurse to
45- * access the selectively exposed content. Inclusion of the following
46- * private header will declare the necessary WinSock API, choosing to
47- * include either <winsock.h> or <winsock2.h> by default, on the same
48- * basis as the similar choice made in <windows.h>
45+ * access the selectively exposed content. Inclusion of "winsock.h",
46+ * subject to the __USE_MINGW_WINSOCK_DEFAULT feature test, declares
47+ * the necessary WinSock API, choosing between the WinSock v1.1 API,
48+ * and the WinSock v2 API, on the same basis as the similar choice
49+ * made in <windows.h>
4950 */
50-#include "_winsock.h"
51+#define __USE_MINGW_WINSOCK_DEFAULT
52+#include "winsock.h"
5153
5254 /* We can now be confident that the WinSock API has been appropriately
5355 * declared; we may now define the <nspapi.h> repeat inclusion guard.
--- a/w32api/include/windows.h
+++ b/w32api/include/windows.h
@@ -6,7 +6,7 @@
66 * $Id$
77 *
88 * Written by Anders Norlander <anorland@hem2.passagen.se>
9- * Copyright (C) 1998-2003, 2006, 2007, 2016, 2017, MinGW.org Project
9+ * Copyright (C) 1998-2003, 2006, 2007, 2016, 2017, 2019, MinGW.org Project
1010 *
1111 *
1212 * Permission is hereby granted, free of charge, to any person obtaining a
@@ -76,13 +76,15 @@
7676 #endif
7777 #if defined __USE_W32_SOCKETS \
7878 || ! (defined __CYGWIN__ || defined __MSYS__ || defined _UWIN)
79- /* The WinSock API should be declared; including the following
80- * private header file will make an informed choice between the
79+ /* The WinSock API should be declared; including <winsock.h>,
80+ * under the control of the __USE_MINGW_WINSOCK_DEFAULT feature
81+ * test, will ensure that we make an informed choice between the
8182 * WinSock v1.1 API, as declared in <winsock.h>, and WinSock v2,
8283 * as declared in <winsock2.h>, as the preferred default level
8384 * of WinSock API support to be offered.
8485 */
85-# include "_winsock.h"
86+# define __USE_MINGW_WINSOCK_DEFAULT
87+# include "winsock.h"
8688 /*
8789 * FIXME: strict Microsoft compatibility may require inclusion
8890 * of <mswsock.h> here as well; however, this has been observed
--- a/w32api/include/winsock.h
+++ b/w32api/include/winsock.h
@@ -9,7 +9,7 @@
99 * $Id$
1010 *
1111 * Adaptation by Anders Norlander <anorland@hem2.passagen.se>
12- * Copyright (C) 1998-2004, 2012, 2016, 2017, MinGW.org Project.
12+ * Copyright (C) 1998-2004, 2012, 2016, 2017, 2019, MinGW.org Project.
1313 *
1414 * Portions Copyright (C) 1980, 1983, 1988, 1993
1515 * The Regents of the University of California. All rights reserved.
@@ -44,8 +44,35 @@
4444 */
4545 #ifndef _WINSOCK_H
4646 #pragma GCC system_header
47-#define _WINSOCK_H
4847
48+#ifdef __USE_MINGW_WINSOCK_DEFAULT
49+/* This is default inclusion of <winsock.h> by <windows.h>, (or some other
50+ * W32API header; there is no sane reason for __USE_MINGW_WINSOCK_DEFAULT to
51+ * have been defined, otherwise). Whereas Microsoft would simply default to
52+ * using WinSock v1.1, MinGW may choose an alternative default.
53+ */
54+#include <sdkddkver.h>
55+#if _WIN32_WINNT >= _WIN32_WINNT_NT4
56+/* When the target operating system is WinNT4, or later, we prefer to support
57+ * the WinSock v2 API, by default; (this is consistent with the default choice
58+ * which was traditionally specified within MinGW.org's <windows.h>).
59+ */
60+#include "winsock2.h"
61+
62+#endif /* __USE_MINGW_WINSOCK_DEFAULT for Win-NT4 and later */
63+#endif /* __USE_MINGW_WINSOCK_DEFAULT (any Windows version) */
64+
65+/* If "winsock2.h" was included, to satisfy the __USE_MINGW_WINSOCK_DEFAULT
66+ * condition, then the remainder of this file has already been processed, due
67+ * to reinclusion by "winsock2.h"; test _WINSOCK_H again to prevent redundant
68+ * reprocessing, (which may be potentially harmful)...
69+ */
70+#ifndef _WINSOCK_H
71+/* ...but, when _WINSOCK_H hasn't been defined yet, then this is our first
72+ * opportunity to process this <winsock.h> content; activate the guard, and
73+ * proceed to process it now.
74+ */
75+#define _WINSOCK_H
4976 #define _GNU_H_WINDOWS32_SOCKETS
5077 #define __WINSOCK_H_SOURCED__ 1
5178
@@ -677,7 +704,9 @@ _END_C_DECLS
677704 * references to the mswsock extensions.
678705 */
679706 #include <mswsock.h>
680-#endif
707+
708+#endif /* !_WINSOCK2_H */
709+#endif /* !_WINSOCK_H redundancy check */
681710
682711 #undef __WINSOCK_H_SOURCED__
683712 #endif /* _WINSOCK_H: $RCSfile$: end of file */
--- a/w32api/include/winsock2.h
+++ b/w32api/include/winsock2.h
@@ -10,7 +10,7 @@
1010 *
1111 * Contributed by the WINE Project.
1212 * Adaptation by Mumit Khan <khan@xraylith.wisc.edu>
13- * Copyright (C) 1998-2005, 2011, 2016, 2017, MinGW.org Project
13+ * Copyright (C) 1998-2005, 2011, 2016, 2017, 2019, MinGW.org Project
1414 *
1515 *
1616 * Permission is hereby granted, free of charge, to any person obtaining a
@@ -42,6 +42,13 @@
4242 #pragma GCC system_header
4343 #define _WINSOCK2_H
4444
45+/* This is MinGW's preferred WinSock default choice; having made it, we
46+ * MUST now ensure that the __USE_MINGW_WINSOCK_DEFAULT selector doesn't
47+ * persist beyond this point, since it would interfere with inclusion of
48+ * common content from <winsock.h>
49+ */
50+#undef __USE_MINGW_WINSOCK_DEFAULT
51+
4552 #ifdef _WINSOCK_H /* included prematurely */
4653 /* Oops! <winsock.h> appears to have been included already, which now
4754 * precludes any use of WinSock v2 protocol.
--- a/w32api/include/wsnetbs.h
+++ b/w32api/include/wsnetbs.h
@@ -6,7 +6,7 @@
66 * $Id$
77 *
88 * Written by Kai Henningsen <kai-henningsen@users.sourceforge.net>
9- * Copyright (C) 2002, 2017, MinGW.org Project
9+ * Copyright (C) 2002, 2017, 2019, MinGW.org Project
1010 *
1111 *
1212 * Permission is hereby granted, free of charge, to any person obtaining a
@@ -41,7 +41,8 @@
4141
4242 #ifndef RC_INVOKED
4343
44-#include "_winsock.h"
44+#define __USE_MINGW_WINSOCK_DEFAULT
45+#include "winsock.h"
4546
4647 typedef struct sockaddr_nb
4748 { short snb_family;
--- a/w32api/tests/headers.at
+++ b/w32api/tests/headers.at
@@ -255,7 +255,6 @@ winreg.h dnl
255255 winresrc.h dnl
256256 winsnmp.h dnl
257257 winsock2.h dnl
258-_winsock.h dnl
259258 winsock.h dnl
260259 winspool.h dnl
261260 winsvc.h dnl
Show on old repository browser