From 80c1f04c80fb10f6774961ff9a8d343a92ecdf47 Mon Sep 17 00:00:00 2001 From: Christian Stimming Date: Thu, 9 Mar 2006 13:00:37 +0000 Subject: [PATCH] Check for and ignore code section if header unavailable. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13554 57a11ea4-9604-0410-9ed3-97b8803252fd --- configure.in | 1 + src/gnome-utils/gnc-gnome-utils.c | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 767d4ed3af..469af7d74a 100644 --- a/configure.in +++ b/configure.in @@ -115,6 +115,7 @@ if test "x$ac_cv_header_ltdl_h" = xno; then fi # These are unavailable on windows/mingw32 +AC_CHECK_HEADERS(X11/Xlib.h glob.h) AC_CHECK_FUNCS(getppid getuid gethostname gmtime_r) ### -------------------------------------------------------------------------- diff --git a/src/gnome-utils/gnc-gnome-utils.c b/src/gnome-utils/gnc-gnome-utils.c index e8b46f61cf..3f435621cf 100644 --- a/src/gnome-utils/gnc-gnome-utils.c +++ b/src/gnome-utils/gnc-gnome-utils.c @@ -26,7 +26,9 @@ #include #include #include -#include +#ifdef HAVE_X11_XLIB_H +# include +#endif #include "gnc-html-graph-gog.h" @@ -325,6 +327,7 @@ gnc_ui_check_events (gpointer not_used) return TRUE; } +#ifdef HAVE_X11_XLIB_H static int gnc_x_error (Display *display, XErrorEvent *error) { @@ -345,6 +348,7 @@ gnc_x_error (Display *display, XErrorEvent *error) return 0; } +#endif int gnc_ui_start_event_loop (void) @@ -356,7 +360,9 @@ gnc_ui_start_event_loop (void) id = g_timeout_add_full (G_PRIORITY_DEFAULT_IDLE, 10000, /* 10 secs */ gnc_ui_check_events, NULL, NULL); +#ifdef HAVE_X11_XLIB_H XSetErrorHandler (gnc_x_error); +#endif /* Enter gnome event loop */ gtk_main ();