From cff99f3c3eb08b1d26f9ceb87420f0b5dd259dd5 Mon Sep 17 00:00:00 2001
From: Yevgen Muntyan <17531749+muntyan@users.noreply.github.com>
Date: Sat, 24 Dec 2005 19:36:11 +0000
Subject: [PATCH] r1492@localhost: muntyan | 2005-12-24 00:09:56 -0600 Do not
display stupid error messages on windows
---
moo.kdevelop | 28 ++++++++++++++--------------
moo/mooedit/mooplugin.c | 25 ++++++++++++++++++++++++-
2 files changed, 38 insertions(+), 15 deletions(-)
diff --git a/moo.kdevelop b/moo.kdevelop
index 6de885bc..36e56c08 100644
--- a/moo.kdevelop
+++ b/moo.kdevelop
@@ -24,7 +24,7 @@
.
false
-
+
C
@@ -54,13 +54,13 @@
-O0 -g3 -pg
-O0 -g3 -pg
-
-
-
-
-
-
-
+
+
+
+
+
+
+
--enable-debug=full --enable-all-gcc-warnings=fatal --enable-developer-mode --disable-moo-module --without-python --without-mooterm --without-mooapp
@@ -198,12 +198,12 @@
-
+
--g-fatal-warnings
-
-
-
-
+
+
+
+
true
false
true
@@ -304,7 +304,7 @@
-
+
set
m_,_
theValue
diff --git a/moo/mooedit/mooplugin.c b/moo/mooedit/mooplugin.c
index 2785f2c1..2522f16e 100644
--- a/moo/mooedit/mooplugin.c
+++ b/moo/mooedit/mooplugin.c
@@ -25,6 +25,10 @@
#include
#include
+#ifdef __WIN32__
+#include
+#endif
+
#define PLUGIN_PREFS_ENABLED "enabled"
@@ -778,6 +782,25 @@ out:
}
+static GModule *
+module_open (const char *path)
+{
+ GModule *module;
+ G_GNUC_UNUSED guint saved;
+
+#ifdef __WIN32__
+ saved = SetErrorMode (SEM_NOOPENFILEERRORBOX | SEM_FAILCRITICALERRORS);
+#endif
+
+ module = g_module_open (path, 0);
+
+#ifdef __WIN32__
+ SetErrorMode (saved);
+#endif
+
+ return module;
+}
+
static void
moo_plugin_read_dir (const char *path)
{
@@ -803,7 +826,7 @@ moo_plugin_read_dir (const char *path)
prefix = g_strndup (name, suffix - name);
module_path = g_build_filename (path, name, NULL);
- module = g_module_open (module_path, 0);
+ module = module_open (module_path);
if (module)
{