From 811df7d7815806eede76ff19b7df88325f4397fe Mon Sep 17 00:00:00 2001 From: Colin Leroy Date: Sat, 3 Mar 2007 10:51:26 +0000 Subject: [PATCH] 2007-03-03 [colin] 2.8.0cvs10 * configure.ac * src/main.c * src/common/plugin.c Fix bug 1134, 'Valgrind macros unhandled by Irix's cc' --- ChangeLog | 8 ++++++++ PATCHSETS | 1 + configure.ac | 20 +++++++++++++++++++- src/common/plugin.c | 7 ++++++- src/main.c | 5 ++++- 5 files changed, 38 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7e433ccb7..88ced332d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2007-03-03 [colin] 2.8.0cvs10 + + * configure.ac + * src/main.c + * src/common/plugin.c + Fix bug 1134, 'Valgrind macros unhandled + by Irix's cc' + 2007-03-02 [colin] 2.8.0cvs9 * src/mbox.c diff --git a/PATCHSETS b/PATCHSETS index 610f65215..0d81b4106 100644 --- a/PATCHSETS +++ b/PATCHSETS @@ -2402,3 +2402,4 @@ ( cvs diff -u -r 1.274.2.174 -r 1.274.2.175 src/mainwindow.c; cvs diff -u -r 1.25.2.24 -r 1.25.2.25 src/matcher_parser_parse.y; cvs diff -u -r 1.204.2.121 -r 1.204.2.122 src/prefs_common.c; cvs diff -u -r 1.1.2.32 -r 1.1.2.33 src/prefs_msg_colors.c; cvs diff -u -r 1.60.2.42 -r 1.60.2.43 src/procmsg.h; cvs diff -u -r 1.2.2.16 -r 1.2.2.17 src/gtk/colorlabel.c; cvs diff -u -r 1.1.4.6 -r 1.1.4.7 src/gtk/colorlabel.h; ) > 2.8.0cvs7.patchset ( cvs diff -u -r 1.274.2.175 -r 1.274.2.176 src/mainwindow.c; cvs diff -u -r 1.2.2.17 -r 1.2.2.18 src/gtk/colorlabel.c; ) > 2.8.0cvs8.patchset ( cvs diff -u -r 1.28.2.33 -r 1.28.2.34 src/mbox.c; ) > 2.8.0cvs9.patchset +( cvs diff -u -r 1.654.2.2458 -r 1.654.2.2459 configure.ac; cvs diff -u -r 1.115.2.140 -r 1.115.2.141 src/main.c; cvs diff -u -r 1.13.2.26 -r 1.13.2.27 src/common/plugin.c; ) > 2.8.0cvs10.patchset diff --git a/configure.ac b/configure.ac index d72cc2df9..dfc1cbd3a 100644 --- a/configure.ac +++ b/configure.ac @@ -11,7 +11,7 @@ MINOR_VERSION=8 MICRO_VERSION=0 INTERFACE_AGE=0 BINARY_AGE=0 -EXTRA_VERSION=9 +EXTRA_VERSION=10 EXTRA_RELEASE= EXTRA_GTK2_VERSION= @@ -829,6 +829,24 @@ else fi AM_CONDITIONAL(CLAWS_GNOMEPRINT, test x"$ac_cv_enable_gnomeprint" = x"yes") +AC_MSG_CHECKING([whether to use valgrind]) +AC_ARG_ENABLE(valgrind, + [ --disable-valgrind Do not use valgrind for debugging], + [ac_cv_enable_valgrind=$enableval], [ac_cv_enable_valgrind=yes]) +if test x$ac_cv_enable_valgrind = xyes; then + AC_MSG_RESULT(yes) + PKG_CHECK_MODULES(VALGRIND, valgrind >= 2.4.0, + ac_cv_enable_valgrind=yes, ac_cv_enable_valgrind=no) + if test x"$ac_cv_enable_valgrind" = xyes; then + AC_DEFINE(HAVE_VALGRIND, 1, Define if you want valgrind support) + else + AC_MSG_RESULT(not found) + fi +else + AC_MSG_RESULT(no) +fi +AM_CONDITIONAL(CLAWS_VALGRIND, test x"$ac_cv_enable_valgrind" = x"yes") + dnl **************************** dnl ** Final configure output ** dnl **************************** diff --git a/src/common/plugin.c b/src/common/plugin.c index 4c89a6c7e..9b5925e59 100644 --- a/src/common/plugin.c +++ b/src/common/plugin.c @@ -33,8 +33,9 @@ #include "plugin.h" #include "prefs.h" #include "claws.h" +#ifdef HAVE_VALGRIND #include "valgrind.h" - +#endif struct _Plugin { gchar *filename; @@ -382,9 +383,13 @@ void plugin_unload(Plugin *plugin) plugin_done(); } +#ifdef HAVE_VALGRIND if (!RUNNING_ON_VALGRIND) { g_module_close(plugin->module); } +#else + g_module_close(plugin->module); +#endif plugins = g_slist_remove(plugins, plugin); g_free(plugin->filename); g_free(plugin); diff --git a/src/main.c b/src/main.c index 52505ba60..4036651ce 100644 --- a/src/main.c +++ b/src/main.c @@ -100,8 +100,9 @@ #include "imap-thread.h" #endif #include "stock_pixmap.h" +#ifdef HAVE_VALGRIND #include "valgrind.h" - +#endif #if USE_OPENSSL # include "ssl.h" #endif @@ -1339,9 +1340,11 @@ void app_will_exit(GtkWidget *widget, gpointer data) } sock_cleanup(); +#ifdef HAVE_VALGRIND if (RUNNING_ON_VALGRIND) { summary_clear_list(mainwin->summaryview); } +#endif if (folderview_get_selected_item(mainwin->folderview)) folder_item_close(folderview_get_selected_item(mainwin->folderview)); gtk_main_quit(); -- 2.25.1