aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Anisimkov <anisimko@adacore.com>2021-05-20 19:55:02 +0600
committerPierre-Marie de Rodat <derodat@adacore.com>2021-07-07 16:23:18 +0000
commit125bb16bece454843ca420fd033351d1a80976a4 (patch)
treeaf55d85883628332141866b2490c26eca3dfcff0
parent29d3965161a8c9337a8b46019eea184ff3a6ac61 (diff)
downloadgcc-125bb16bece454843ca420fd033351d1a80976a4.zip
gcc-125bb16bece454843ca420fd033351d1a80976a4.tar.gz
gcc-125bb16bece454843ca420fd033351d1a80976a4.tar.bz2
[Ada] Keepalive control on Windows
gcc/ada/ * s-oscons-tmplt.c (TCP_KEEPCNT TCP_KEEPIDLE, TCP_KEEPINTVL): Hardcode on Windows if undefined.
-rw-r--r--gcc/ada/s-oscons-tmplt.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/ada/s-oscons-tmplt.c b/gcc/ada/s-oscons-tmplt.c
index d42e663..044e203 100644
--- a/gcc/ada/s-oscons-tmplt.c
+++ b/gcc/ada/s-oscons-tmplt.c
@@ -1502,18 +1502,36 @@ CNS(MSG_Forced_Flags, "")
CND(TCP_NODELAY, "Do not coalesce packets")
#ifndef TCP_KEEPCNT
+#ifdef __MINGW32__
+/* Windows headers can be too old to have all available constants.
+ * We know this one. */
+# define TCP_KEEPCNT 16
+#else
# define TCP_KEEPCNT -1
#endif
+#endif
CND(TCP_KEEPCNT, "Maximum number of keepalive probes")
#ifndef TCP_KEEPIDLE
+#ifdef __MINGW32__
+/* Windows headers can be too old to have all available constants.
+ * We know this one. */
+# define TCP_KEEPIDLE 3
+#else
# define TCP_KEEPIDLE -1
#endif
+#endif
CND(TCP_KEEPIDLE, "Idle time before TCP starts sending keepalive probes")
#ifndef TCP_KEEPINTVL
+#ifdef __MINGW32__
+/* Windows headers can be too old to have all available constants.
+ * We know this one. */
+# define TCP_KEEPINTVL 17
+#else
# define TCP_KEEPINTVL -1
#endif
+#endif
CND(TCP_KEEPINTVL, "Time between individual keepalive probes")
#ifndef SO_REUSEADDR