summaryrefslogtreecommitdiff
path: root/meta-openembedded/meta-multimedia/recipes-multimedia/pipewire/pipewire/0001-spa-fix-c90-header-include.patch
blob: ad6448a10a706ccc38c6b9e370afd26623ba7998 (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
43
44
45
46
47
From d3ea3142e1a4de206e616bc18f63a529e6b4986a Mon Sep 17 00:00:00 2001
From: psykose <alice@ayaya.dev>
Date: Wed, 13 Apr 2022 21:57:49 +0000
Subject: [PATCH 001/154] spa: fix c90 header include

placing declarations after code is invalid under ISO c90

Fixes !1211

Patch-Status: Backport
---
 spa/include/spa/utils/string.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/spa/include/spa/utils/string.h b/spa/include/spa/utils/string.h
index e80434537..43d19616c 100644
--- a/spa/include/spa/utils/string.h
+++ b/spa/include/spa/utils/string.h
@@ -276,10 +276,11 @@ static inline int spa_scnprintf(char *buffer, size_t size, const char *format, .
 static inline float spa_strtof(const char *str, char **endptr)
 {
 	static locale_t locale = NULL;
+	locale_t prev;
 	float v;
 	if (SPA_UNLIKELY(locale == NULL))
 		locale = newlocale(LC_ALL_MASK, "C", NULL);
-	locale_t prev = uselocale(locale);
+	prev = uselocale(locale);
 	v = strtof(str, endptr);
 	uselocale(prev);
 	return v;
@@ -319,10 +320,11 @@ static inline bool spa_atof(const char *str, float *val)
 static inline double spa_strtod(const char *str, char **endptr)
 {
 	static locale_t locale = NULL;
+	locale_t prev;
 	double v;
 	if (SPA_UNLIKELY(locale == NULL))
 		locale = newlocale(LC_ALL_MASK, "C", NULL);
-	locale_t prev = uselocale(locale);
+	prev = uselocale(locale);
 	v = strtod(str, endptr);
 	uselocale(prev);
 	return v;
-- 
2.25.1