From a5fd60a8ac9f19c150c45a2e1a050d65e8745423 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sun, 18 Jan 2009 06:53:44 +0000 Subject: [PATCH] Define an ENABLE_REGEX macro * configure.in: Define an ENABLE_REGEX macro * gobject/gboxed.c: Don't refer to g_regex_ref if ENABLE_REGEX is not defined. svn path=/trunk/; revision=7815 --- ChangeLog | 9 +++++++++ configure.in | 1 + gobject/gboxed.c | 4 ++++ 3 files changed, 14 insertions(+) diff --git a/ChangeLog b/ChangeLog index b595161ad..9b5cf60c7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2009-01-18 Matthias Clasen + + Bug 512779 – --disable-regex breaks compilation + + * configure.in: Define an ENABLE_REGEX macro + + * gobject/gboxed.c: Don't refer to g_regex_ref if ENABLE_REGEX + is not defined. + 2009-01-18 Matthias Clasen * glib/gbsearcharray.h: Quell some compiler warnings. diff --git a/configure.in b/configure.in index 921506dcb..5fd985fce 100644 --- a/configure.in +++ b/configure.in @@ -2502,6 +2502,7 @@ esac], AM_CONDITIONAL(ENABLE_REGEX, $enable_regex) if test x$enable_regex = xtrue; then + AC_DEFINE(ENABLE_REGEX, [], [include GRegex]) # Check if we should use the internal or the system-supplied pcre AC_ARG_WITH(pcre, [AC_HELP_STRING([--with-pcre=@<:@internal/system@:>@], diff --git a/gobject/gboxed.c b/gobject/gboxed.c index 0026b0ad5..8cdcd1ec5 100644 --- a/gobject/gboxed.c +++ b/gobject/gboxed.c @@ -263,10 +263,14 @@ GType g_regex_get_type (void) { static GType type_id = 0; + +#ifdef ENABLE_REGEX if (!type_id) type_id = g_boxed_type_register_static (g_intern_static_string ("GRegex"), (GBoxedCopyFunc) g_regex_ref, (GBoxedFreeFunc) g_regex_unref); +#endif + return type_id; } -- 2.34.1