MSYS2-packages/msys2-runtime-3.3/0021-Introduce-the-enable_pcon-value-for-MSYS.patch
Christoph Reiter 743bae3086 Add msys2-runtime-3.3
Provides and conflicts with msys2-runtime, so can be used to replace it if wanted.

Keep this as a separate package to test for regressions in cygwin
and to have (in theory) a runtime that supports 32bit in the repo.

There is no guarantee for how long we are going to keep this.
2022-12-09 17:58:25 +01:00

55 lines
2.0 KiB
Diff

From a4a2aebc21843483387198cdb20db3a1eeb99362 Mon Sep 17 00:00:00 2001
From: Johannes Schindelin <johannes.schindelin@gmx.de>
Date: Tue, 19 May 2020 13:49:37 +0200
Subject: [PATCH 21/N] Introduce the `enable_pcon` value for `MSYS`
It is simply the negation of `disable_pcon`, i.e. `MSYS=enable_pcon` is
equivalent to `MSYS=nodisable_pcon` (the former is slightly more
intuitive than the latter) and likewise `MSYS=noenable_pcon` is
equivalent to `MSYS=disable_pcon` (here, the latter is definitely more
intuitive than the former).
This is needed because we just demoted the pseudo console feature to be
opt-in instead of opt-out, and it would be awkward to recommend to users
to use "nodisable_pcon"... "nodisable" is not even a verb.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
winsup/cygwin/environ.cc | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/winsup/cygwin/environ.cc b/winsup/cygwin/environ.cc
index 49631d6..daaa1ec 100644
--- a/winsup/cygwin/environ.cc
+++ b/winsup/cygwin/environ.cc
@@ -42,6 +42,7 @@ enum settings
isfunc,
setdword,
setbool,
+ setnegbool,
setbit
};
@@ -126,6 +127,7 @@ static struct parse_thing
{"wincmdln", {&wincmdln}, setbool, NULL, {{false}, {true}}},
{"winsymlinks", {func: set_winsymlinks}, isfunc, NULL, {{0}, {0}}},
{"disable_pcon", {&disable_pcon}, setbool, NULL, {{false}, {true}}},
+ {"enable_pcon", {&disable_pcon}, setnegbool, NULL, {{true}, {false}}},
{NULL, {0}, setdword, 0, {{0}, {0}}}
};
@@ -243,6 +245,13 @@ parse_options (const char *inbuf)
*k->setting.b = !!strtol (eq, NULL, 0);
debug_printf ("%s%s", *k->setting.b ? "" : "no", k->name);
break;
+ case setnegbool:
+ if (!istrue || !eq)
+ *k->setting.b = k->values[istrue].i;
+ else
+ *k->setting.b = !strtol (eq, NULL, 0);
+ debug_printf ("%s%s", !*k->setting.b ? "" : "no", k->name);
+ break;
case setbit:
*k->setting.x &= ~k->values[istrue].i;
if (istrue || (eq && strtol (eq, NULL, 0)))