From: Uwe Hermann Date: Thu, 29 Jan 2015 07:51:31 +0000 (+0100) Subject: Lower dependency to glib 2.32. X-Git-Tag: libsigrok-0.4.0~665 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=5801d558;p=libsigrok.git Lower dependency to glib 2.32. By avoiding g_slist_copy_deep() for now, we can easily allow libsigrok to build against glib 2.32 (less hassle for users of stable/older distros or OSes). --- diff --git a/README b/README index 7ddfe81e..eea27976 100644 --- a/README +++ b/README @@ -36,7 +36,7 @@ Requirements for the C library: - automake >= 1.11 (only needed when building from git) - libtool (only needed when building from git) - pkg-config >= 0.22 - - libglib >= 2.34.0 + - libglib >= 2.32.0 - libzip >= 0.10 - libserialport >= 0.1.0 (optional, used by some drivers) - librevisa >= 0.0.20130412 (optional, used by some drivers) diff --git a/configure.ac b/configure.ac index b0db86fd..7488a890 100644 --- a/configure.ac +++ b/configure.ac @@ -260,8 +260,8 @@ AM_CONDITIONAL(NEED_RPC, test "x$have_rpc" != "x0") # libglib-2.0 is always needed. Abort if it's not found. # Note: glib-2.0 is part of the libsigrok API (hard pkg-config requirement). -# We require at least 2.34.0 due to e.g. g_slist_deep_copy(). -AM_PATH_GLIB_2_0([2.34.0], +# We require at least 2.32.0 due to e.g. g_variant_new_fixed_array(). +AM_PATH_GLIB_2_0([2.32.0], [LIB_CFLAGS="$LIB_CFLAGS $GLIB_CFLAGS"; LIBS="$LIBS $GLIB_LIBS"]) # libzip is always needed. Abort if it's not found. @@ -554,13 +554,13 @@ echo "Detected libraries:" echo # Note: This only works for libs with pkg-config integration. -for lib in "glib-2.0 >= 2.34.0" "libzip >= 0.10" "libserialport >= 0.2.0" \ +for lib in "glib-2.0 >= 2.32.0" "libzip >= 0.10" "libserialport >= 0.2.0" \ "librevisa >= 0.0.20130412" "libusb-1.0 >= 1.0.16" "libftdi >= 0.16" \ "libftdi1 >= 1.0" "libgpib" "glibmm-2.4 >= 2.32.0" \ "pygobject-3.0 >= 3.0.0" "check >= 0.9.4" do optional="OPTIONAL" - if test "x$lib" = "xglib-2.0 >= 2.34.0"; then optional="REQUIRED"; fi + if test "x$lib" = "xglib-2.0 >= 2.32.0"; then optional="REQUIRED"; fi if test "x$lib" = "xlibzip >= 0.10"; then optional="REQUIRED"; fi if `$PKG_CONFIG --exists $lib`; then ver=`$PKG_CONFIG --modversion $lib` diff --git a/src/session.c b/src/session.c index f7d3bc8a..3d02e677 100644 --- a/src/session.c +++ b/src/session.c @@ -984,8 +984,8 @@ SR_PRIV int sr_packet_copy(const struct sr_datafeed_packet *packet, case SR_DF_META: meta = packet->payload; meta_copy = g_malloc(sizeof(struct sr_datafeed_meta)); - meta_copy->config = g_slist_copy_deep(meta->config, - (GCopyFunc)copy_src, NULL); + meta_copy->config = g_slist_copy(meta->config); + g_slist_foreach(meta_copy->config, (GCopyFunc)copy_src, NULL); (*copy)->payload = meta_copy; break; case SR_DF_LOGIC: