Skip to content

Commit

Permalink
(#25345) cairo: Fix alloca issue in MSVC cairo
Browse files Browse the repository at this point in the history
  • Loading branch information
AbrilRBS authored Sep 20, 2024
1 parent 1a14d46 commit c2c5964
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
5 changes: 5 additions & 0 deletions recipes/cairo/all/conandata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
28 changes: 28 additions & 0 deletions recipes/cairo/all/patches/1.18.0-msvc-alloca.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
From 27cdee5e4cf19e7959b80fe1a39e61188de1b654 Mon Sep 17 00:00:00 2001
From: Dan Yeaw <dan@yeaw.me>
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 <stdio.h>
#include <string.h>

+#ifdef _MSC_VER
+#include <malloc.h>
+#endif
+
#if HAVE_FT_COLR_V1

#include <ft2build.h>
--
GitLab

0 comments on commit c2c5964

Please sign in to comment.