From c2c5964ace4be2a0905a5503554c7a2642e71e0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abril=20Rinc=C3=B3n=20Blanco?= Date: Sat, 21 Sep 2024 00:39:50 +0200 Subject: [PATCH] (#25345) cairo: Fix alloca issue in MSVC cairo --- recipes/cairo/all/conandata.yml | 5 ++++ .../all/patches/1.18.0-msvc-alloca.patch | 28 +++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 recipes/cairo/all/patches/1.18.0-msvc-alloca.patch diff --git a/recipes/cairo/all/conandata.yml b/recipes/cairo/all/conandata.yml index 278a3653016c5..ab830d86cca25 100644 --- a/recipes/cairo/all/conandata.yml +++ b/recipes/cairo/all/conandata.yml @@ -14,6 +14,11 @@ sources: - "https://mirror.koddos.net/blfs/conglomeration/cairo/cairo-1.17.4.tar.xz" sha256: "74b24c1ed436bbe87499179a3b27c43f4143b8676d8ad237a6fa787401959705" patches: + "1.18.0": + - patch_file: "patches/1.18.0-msvc-alloca.patch" + patch_type: "backport" + patch_description: "Fix alloca undefined with MSVC" + patch_source: "https://gitlab.freedesktop.org/cairo/cairo/-/merge_requests/520" "1.17.4": - patch_file: "patches/binutils-2.34-libbfd-fix.patch" patch_type: "backport" diff --git a/recipes/cairo/all/patches/1.18.0-msvc-alloca.patch b/recipes/cairo/all/patches/1.18.0-msvc-alloca.patch new file mode 100644 index 0000000000000..3be0a4002a73e --- /dev/null +++ b/recipes/cairo/all/patches/1.18.0-msvc-alloca.patch @@ -0,0 +1,28 @@ +From 27cdee5e4cf19e7959b80fe1a39e61188de1b654 Mon Sep 17 00:00:00 2001 +From: Dan Yeaw +Date: Sat, 30 Sep 2023 13:30:51 -0400 +Subject: [PATCH] Fix alloca undefined with MSVC + +Conditionally includes malloc.h when compiling with +MSVC so that alloca is defined. +--- + src/cairo-colr-glyph-render.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/src/cairo-colr-glyph-render.c b/src/cairo-colr-glyph-render.c +index 28254fd51..a9ad84bbf 100644 +--- a/src/cairo-colr-glyph-render.c ++++ b/src/cairo-colr-glyph-render.c +@@ -43,6 +43,10 @@ + #include + #include + ++#ifdef _MSC_VER ++#include ++#endif ++ + #if HAVE_FT_COLR_V1 + + #include +-- +GitLab