aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndersBroman <anders.broman@ericsson.com>2017-11-22 17:22:52 +0100
committerAnders Broman <a.broman58@gmail.com>2017-11-23 06:14:38 +0000
commitfe76be0b5bcbb465d4b510135922ea3302c8c705 (patch)
treecf4c54fdc4188a4eeafaa5d8e22e671d443caa73
parentd790c524b41907ebaa0f29afec19ee6913173129 (diff)
[make-dissectors] g_ptr_array_new_full() is glib 2.30.0 which we do not
require. Add alternate code to fix the build for our minimum required version. Change-Id: Ia0911c5a6be3af68330ac41a3336d7d47b87b7a9 Reviewed-on: https://code.wireshark.org/review/24535 Reviewed-by: João Valverde <j@v6e.pt> Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
-rw-r--r--epan/dissectors/make-dissectors.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/epan/dissectors/make-dissectors.c b/epan/dissectors/make-dissectors.c
index 887266764b..24e4864702 100644
--- a/epan/dissectors/make-dissectors.c
+++ b/epan/dissectors/make-dissectors.c
@@ -69,8 +69,15 @@ int main(int argc, char **argv)
GError *err = NULL;
guint i;
+#if GLIB_CHECK_VERSION(2, 30, 0)
protos = g_ptr_array_new_full(ARRAY_RESERVED_SIZE, g_free);
handoffs = g_ptr_array_new_full(ARRAY_RESERVED_SIZE, g_free);
+#else
+ protos = g_ptr_array_sized_new(ARRAY_RESERVED_SIZE);
+ g_ptr_array_set_free_func(protos, g_free);
+ handoffs = g_ptr_array_sized_new(ARRAY_RESERVED_SIZE);
+ g_ptr_array_set_free_func(handoffs, g_free);
+#endif /* GLIB_CHECK_VERSION(2, 30, 0)*/
protos_regex = g_regex_new("void\\s+(proto_register_[[:alnum:]_]+)\\s*\\(\\s*void\\s*\\)\\s*{",
G_REGEX_OPTIMIZE, G_REGEX_MATCH_NOTEMPTY, &err);