diff options
author | Martin Jansa <Martin.Jansa@gmail.com> | 2021-04-07 00:22:33 +0200 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2021-04-06 16:10:10 -0700 |
commit | 412cb3a15c7812c69660ae6e98dad6e01e09a7e9 (patch) | |
tree | cee7f1793f27db57b872052af4a22c864bd9302a | |
parent | 7e60ff535380b905f631a31f3f1228e78f1c117c (diff) | |
download | meta-openembedded-412cb3a15c7812c69660ae6e98dad6e01e09a7e9.tar.gz |
pidgin-sipe: fix g_memdup2 changes to be backwards compatible with glib-1.67
* current version unfortunatelly it isn't backwards compatible with glib-2.0-1.66.7 currently in oe-core master and hardknott and now fails with:
| ../../../pidgin-sipe-1.25.0/src/purple/../api/sipe-common.h:56:19: error: conflicting types for 'g_memdup'
| 56 | #define g_memdup2 g_memdup
| | ^~~~~~~~
that's because glibcompat.h provided by libpurple from pidgin always provides g_memdup2
so the AC_CHECK_LIB in configure.ac detects that it isn't available in glib-2.0 itself
and then tries to redefine it here.
Leave the fall-back on glibcompat.h and just replace g_memdup calls with g_memdup2.
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r-- | meta-oe/recipes-support/pidgin/pidgin-sipe/0001-Migrate-to-use-g_memdup2.patch | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/meta-oe/recipes-support/pidgin/pidgin-sipe/0001-Migrate-to-use-g_memdup2.patch b/meta-oe/recipes-support/pidgin/pidgin-sipe/0001-Migrate-to-use-g_memdup2.patch index 4f5c0bd1f6..ceb48d21fc 100644 --- a/meta-oe/recipes-support/pidgin/pidgin-sipe/0001-Migrate-to-use-g_memdup2.patch +++ b/meta-oe/recipes-support/pidgin/pidgin-sipe/0001-Migrate-to-use-g_memdup2.patch | |||
@@ -1,17 +1,36 @@ | |||
1 | From 40799bb28a9e299055eec00092694ea2e408c431 Mon Sep 17 00:00:00 2001 | 1 | From 51c95a23bff3a024dc19e3127ca751e1458be0f0 Mon Sep 17 00:00:00 2001 |
2 | From: Khem Raj <raj.khem@gmail.com> | 2 | From: Khem Raj <raj.khem@gmail.com> |
3 | Date: Mon, 5 Apr 2021 11:36:50 -0700 | 3 | Date: Mon, 5 Apr 2021 11:36:50 -0700 |
4 | Subject: [PATCH] Migrate to use g_memdup2 | 4 | Subject: [PATCH] Migrate to use g_memdup2 |
5 | 5 | ||
6 | g_memdup has been deprecated for long and latest glib-2.0 2.68+ has | 6 | g_memdup has been deprecated for long and latest glib-2.0 2.68+ has |
7 | turned it int an error to use old function. Add a fall back to | 7 | turned it int an error to use old function. |
8 | older versions of GLib, fall back to g_memdup with a #define | 8 | |
9 | The fall-back to g_memdup isn't needed because pidgin provides g_memdup2 | ||
10 | in pidgin-sipe/1.25.0-r0/recipe-sysroot/usr/include/libpurple/glibcompat.h | ||
11 | based on glib-2.0 version: | ||
12 | /* Backport the static inline version of g_memdup2 if we don't have g_memdup2. | ||
13 | * see https://mail.gnome.org/archives/desktop-devel-list/2021-February/msg00000.html | ||
14 | * for more information. | ||
15 | */ | ||
16 | #if !GLIB_CHECK_VERSION(2, 67, 3) | ||
17 | static inline gpointer | ||
18 | g_memdup2(gconstpointer mem, gsize byte_size) { | ||
19 | gpointer new_mem = NULL; | ||
20 | |||
21 | if(mem && byte_size != 0) { | ||
22 | new_mem = g_malloc (byte_size); | ||
23 | memcpy (new_mem, mem, byte_size); | ||
24 | } | ||
25 | |||
26 | return new_mem; | ||
27 | } | ||
28 | #endif /* !GLIB_CHECK_VERSION(2, 67, 3) */ | ||
9 | 29 | ||
10 | Upstream-Status: Pending | 30 | Upstream-Status: Pending |
11 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | 31 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
12 | --- | 32 | --- |
13 | configure.ac | 3 +++ | 33 | src/api/sipe-common.h | 3 +++ |
14 | src/api/sipe-common.h | 5 +++++ | ||
15 | src/core/sip-sec-gssapi.c | 4 ++-- | 34 | src/core/sip-sec-gssapi.c | 4 ++-- |
16 | src/core/sip-sec-ntlm.c | 12 ++++++------ | 35 | src/core/sip-sec-ntlm.c | 12 ++++++------ |
17 | src/core/sip-sec-tls-dsk.c | 4 ++-- | 36 | src/core/sip-sec-tls-dsk.c | 4 ++-- |
@@ -19,35 +38,19 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com> | |||
19 | src/core/sipe-tls-tester.c | 2 +- | 38 | src/core/sipe-tls-tester.c | 2 +- |
20 | src/core/sipe-tls.c | 4 ++-- | 39 | src/core/sipe-tls.c | 4 ++-- |
21 | src/telepathy/telepathy-protocol.c | 2 +- | 40 | src/telepathy/telepathy-protocol.c | 2 +- |
22 | 9 files changed, 23 insertions(+), 15 deletions(-) | 41 | 8 files changed, 18 insertions(+), 15 deletions(-) |
23 | 42 | ||
24 | diff --git a/configure.ac b/configure.ac | ||
25 | index 2481153..efe01b4 100644 | ||
26 | --- a/configure.ac | ||
27 | +++ b/configure.ac | ||
28 | @@ -327,6 +327,9 @@ AM_CONDITIONAL(SIPE_OPENSSL, [test "x$enable_openssl" != xno]) | ||
29 | dnl check for libxml2 | ||
30 | PKG_CHECK_MODULES(LIBXML2, [libxml-2.0]) | ||
31 | |||
32 | +# dnl check for g_memdup2 in glib-2.0 | ||
33 | +AC_CHECK_LIB(glib-2.0, g_memdup2, [GLIB_CFLAGS="$GLIB_CFLAGS -DHAVE_G_MEMDUP2=1"]) | ||
34 | + | ||
35 | dnl assumption check: sizof(uuid_t) must be 16 (see uuid.c) | ||
36 | AC_MSG_CHECKING([that sizeof(uuid_t) is 16]) | ||
37 | ac_save_CFLAGS="$CFLAGS" | ||
38 | diff --git a/src/api/sipe-common.h b/src/api/sipe-common.h | 43 | diff --git a/src/api/sipe-common.h b/src/api/sipe-common.h |
39 | index c964f15..e114fdc 100644 | 44 | index c964f15..cab81e0 100644 |
40 | --- a/src/api/sipe-common.h | 45 | --- a/src/api/sipe-common.h |
41 | +++ b/src/api/sipe-common.h | 46 | +++ b/src/api/sipe-common.h |
42 | @@ -51,3 +51,8 @@ | 47 | @@ -51,3 +51,6 @@ |
43 | #ifdef _MSC_VER | 48 | #ifdef _MSC_VER |
44 | typedef long ssize_t; | 49 | typedef long ssize_t; |
45 | #endif | 50 | #endif |
46 | + | 51 | + |
47 | +#ifndef HAVE_G_MEMDUP2 | 52 | +// for g_memdup2 |
48 | +#define g_memdup2 g_memdup | 53 | +#include <libpurple/glibcompat.h> |
49 | +#endif | ||
50 | + | ||
51 | diff --git a/src/core/sip-sec-gssapi.c b/src/core/sip-sec-gssapi.c | 54 | diff --git a/src/core/sip-sec-gssapi.c b/src/core/sip-sec-gssapi.c |
52 | index 873080f..4c63868 100644 | 55 | index 873080f..4c63868 100644 |
53 | --- a/src/core/sip-sec-gssapi.c | 56 | --- a/src/core/sip-sec-gssapi.c |
@@ -187,6 +190,3 @@ index f6e5337..1dde579 100644 | |||
187 | } | 190 | } |
188 | if (icon_name) | 191 | if (icon_name) |
189 | *icon_name = g_strdup("im-" SIPE_TELEPATHY_DOMAIN); | 192 | *icon_name = g_strdup("im-" SIPE_TELEPATHY_DOMAIN); |
190 | -- | ||
191 | 2.31.1 | ||
192 | |||