aboutsummaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-support/openldap/openldap/0001-librewrite-include-ldap_pvt_thread.h-before-redefini.patch
blob: bcd1525b670f9d2e8e2c2cc79a8e2338dbc62a29 (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
48
49
50
51
52
53
54
From 79381ab335898c9184e22dd25b544adefa9bf6c5 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Mon, 7 Feb 2022 16:26:57 -0800
Subject: [PATCH] librewrite: include ldap_pvt_thread.h before redefining
 calloc

This helps compiling with musl, where sched.h is included by
ldap_pvt_thread.h which provides prototype for calloc() and conflicts

/usr/include/sched.h:84:7: error: conflicting types for 'ber_memcalloc'
| void *calloc(size_t, size_t);
|       ^1
|  warning and 1 error generated.
| ./rewrite-int.h:44:21: note: expanded from macro 'calloc'
| #define calloc(x,y)     ber_memcalloc(x,y)
|                         ^

Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 libraries/librewrite/rewrite-int.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/libraries/librewrite/rewrite-int.h b/libraries/librewrite/rewrite-int.h
index 4481dd3..5ec226d 100644
--- a/libraries/librewrite/rewrite-int.h
+++ b/libraries/librewrite/rewrite-int.h
@@ -40,6 +40,11 @@
 
 #include <rewrite.h>
 
+#ifndef NO_THREADS
+#define USE_REWRITE_LDAP_PVT_THREADS
+#include <ldap_pvt_thread.h>
+#endif
+
 #define malloc(x)	ber_memalloc(x)
 #define calloc(x,y)	ber_memcalloc(x,y)
 #define realloc(x,y)	ber_memrealloc(x,y)
@@ -47,11 +52,6 @@
 #undef strdup
 #define	strdup(x)	ber_strdup(x)
 
-#ifndef NO_THREADS
-#define USE_REWRITE_LDAP_PVT_THREADS
-#include <ldap_pvt_thread.h>
-#endif
-
 /*
  * For details, see RATIONALE.
  */
-- 
2.35.1