patch 8.1.1301: when compiled with VIMDLL some messages are not shown
Problem: When compiled with VIMDLL some messages are not shown.
Solution: Set/reset gui.in_use and gui.starting as needed. (Ken Takata,
closes #4361)
diff --git a/src/gui_w32.c b/src/gui_w32.c
index 7bea58e..69212eb 100644
--- a/src/gui_w32.c
+++ b/src/gui_w32.c
@@ -4827,6 +4827,10 @@
{
char buf[IOSIZE];
+# ifdef VIMDLL
+ gui.in_use = mch_is_gui_executable();
+# endif
+
/* Can't use emsg() here, we have not finished initialisation yet. */
vim_snprintf(buf, IOSIZE,
_("E243: Argument not supported: \"-%s\"; Use the OLE version."),
diff --git a/src/main.c b/src/main.c
index a57b196..6d30143 100644
--- a/src/main.c
+++ b/src/main.c
@@ -178,6 +178,8 @@
#ifdef VIMDLL
// Check if the current executable file is for the GUI subsystem.
gui.starting = mch_is_gui_executable();
+#elif defined(FEAT_GUI_MSWIN)
+ gui.starting = TRUE;
#endif
#ifdef FEAT_CLIENTSERVER
@@ -3242,6 +3244,14 @@
reset_signals(); /* kill us with CTRL-C here, if you like */
#endif
+ // If this is a Windows GUI executable, show an error dialog box.
+#ifdef VIMDLL
+ gui.in_use = mch_is_gui_executable();
+#endif
+#ifdef FEAT_GUI_MSWIN
+ gui.starting = FALSE; // Needed to show as error.
+#endif
+
init_longVersion();
mch_errmsg(longVersion);
mch_errmsg("\n");
diff --git a/src/message.c b/src/message.c
index 038ccd6..7c25658 100644
--- a/src/message.c
+++ b/src/message.c
@@ -2977,7 +2977,7 @@
int len;
#endif
-#if (defined(UNIX) || defined(FEAT_GUI)) && (!defined(ALWAYS_USE_GUI) || !defined(VIMDLL))
+#if (defined(UNIX) || defined(FEAT_GUI)) && !defined(ALWAYS_USE_GUI) && !defined(VIMDLL)
/* On Unix use stderr if it's a tty.
* When not going to start the GUI also use stderr.
* On Mac, when started from Finder, stderr is the console. */
@@ -3080,7 +3080,7 @@
void
mch_msg(char *str)
{
-#if (defined(UNIX) || defined(FEAT_GUI)) && (!defined(ALWAYS_USE_GUI) || !defined(VIMDLL))
+#if (defined(UNIX) || defined(FEAT_GUI)) && !defined(ALWAYS_USE_GUI) && !defined(VIMDLL)
/* On Unix use stdout if we have a tty. This allows "vim -h | more" and
* uses mch_errmsg() when started from the desktop.
* When not going to start the GUI also use stdout.
diff --git a/src/version.c b/src/version.c
index 7905cda..6f6456b 100644
--- a/src/version.c
+++ b/src/version.c
@@ -768,6 +768,8 @@
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1301,
+/**/
1300,
/**/
1299,