Check for <X11/Xlib.h> and ignore code section if header unavailable.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13554 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Christian Stimming 2006-03-09 13:00:37 +00:00
parent a29250686d
commit 80c1f04c80
2 changed files with 8 additions and 1 deletions

View File

@ -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)
### --------------------------------------------------------------------------

View File

@ -26,7 +26,9 @@
#include <gnome.h>
#include <libguile.h>
#include <gconf/gconf.h>
#include <X11/Xlib.h>
#ifdef HAVE_X11_XLIB_H
# include <X11/Xlib.h>
#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 ();