Define an ENABLE_REGEX macro
authorMatthias Clasen <matthiasc@src.gnome.org>
Sun, 18 Jan 2009 06:53:44 +0000 (06:53 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Sun, 18 Jan 2009 06:53:44 +0000 (06:53 +0000)
        * 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
configure.in
gobject/gboxed.c

index b595161ad76b8b963889b0223576cf9e04597ad5..9b5cf60c721b6cc38a9045731a94b2d8c1ae799e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2009-01-18  Matthias Clasen  <mclasen@redhat.com>
+
+       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  <mclasen@redhat.com>
 
        * glib/gbsearcharray.h: Quell some compiler warnings.
index 921506dcb8708ee92fc8aae6795e092926656824..5fd985fce32f92ac747bb0adff61c6ab111e6d41 100644 (file)
@@ -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@:>@],
index 0026b0ad5b2b99326f1c37a369b75059a3ff699c..8cdcd1ec598e92dcf9b3024c83a6bd76d7992e94 100644 (file)
@@ -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;
 }