summaryrefslogtreecommitdiffstats
path: root/meta/recipes-support/p11-kit/files/strerror-2.patch
blob: 1a9180b508c438a3b71a542c806218033d41efbe (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
From 7aa6251bf4ce36d027d53c9c96bb05f90ef7eb5b Mon Sep 17 00:00:00 2001
From: Adam Sampson <ats@offog.org>
Date: Sun, 2 Jul 2023 15:44:06 +0100
Subject: [PATCH] Define _GNU_SOURCE when testing for strerror_r

The Meson check for GNU/XSI strerror_r didn't inherit the project
options that include _GNU_SOURCE (unlike the autoconf version), so the
result didn't match how the code that uses it will be compiled. Add
_GNU_SOURCE explicitly as with the following checks.

Signed-off-by: Adam Sampson <ats@offog.org>

Upstream-Status: Backport
Signed-off-by: Ross Burton <ross.burton@arm.com>
---
 meson.build | 1 +
 1 file changed, 1 insertion(+)

diff --git a/meson.build b/meson.build
index 4cc3f89a..9a72e148 100644
--- a/meson.build
+++ b/meson.build
@@ -301,6 +301,7 @@ endforeach
 
 if cc.has_function('strerror_r', prefix: '#include <string.h>')
   strerror_r_code = '''
+#define _GNU_SOURCE
 #include <errno.h>
 #include <string.h>