summaryrefslogtreecommitdiffstats
path: root/meta/recipes-sato/webkit/libwpe/0001-Fix-build-failure-due-to-libc-using-libc-functions.patch
blob: 6d27b4835d66f338d7240e76824ff1ae2df99183 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
From ccf8a58c3536ca0e62748e0ea477514e14d821bc Mon Sep 17 00:00:00 2001
From: Adrian Perez de Castro <aperez@igalia.com>
Date: Thu, 4 Aug 2022 12:19:05 +0300
Subject: [PATCH] Fix build failure due to libc++ using libc functions

Include the "alloc-private.h" header after the C++ standard library
headers. This sidesteps build failures caused by implementations of
std::map and std::string which use libc memory allocation functions
in expanded templates after they have been marked with the "poison"
pragma.

Fixes #115

Upstream-Status: Backport
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
---
 src/pasteboard-generic.cpp | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/pasteboard-generic.cpp b/src/pasteboard-generic.cpp
index 86fe4ee..a357027 100644
--- a/src/pasteboard-generic.cpp
+++ b/src/pasteboard-generic.cpp
@@ -26,12 +26,15 @@
 
 #include "pasteboard-private.h"
 
-#include "alloc-private.h"
-#include <cstdlib>
-#include <cstring>
 #include <map>
 #include <string>
 
+// We need to include this header last, in order to avoid template expansions
+// from the C++ standard library happening after it forbids usage of the libc
+// memory functions.
+#include "alloc-private.h"
+#include <cstring>
+
 namespace Generic {
 using Pasteboard = std::map<std::string, std::string>;
 }