summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/libnsl/libnsl2/0002-Define-glibc-specific-macros.patch
blob: 75fda4b0f0ec2a1cc7fd0973a16cd7eed77a8add (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
55
56
57
From 60282514ea01af004d7f9e66dd3929223b7d2e7b Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Tue, 18 Apr 2017 09:16:12 -0700
Subject: [PATCH 2/2] Define glibc specific macros

Check and define
rawmemchr, __asprintf, __mempcpy, __strtok_r
__always_inline, TEMP_FAILURE_RETRY

if not existing. Helps compiling with musl

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
Upstream-Status: Pending

diff --git a/src/rpcsvc/nis.h b/src/rpcsvc/nis.h
index 88cbca0..23fc20c 100644
--- a/src/rpcsvc/nis.h
+++ b/src/rpcsvc/nis.h
@@ -57,6 +57,34 @@ __BEGIN_DECLS
  *                                              <kukuk@suse.de>
  */
 
+#ifndef rawmemchr
+#define rawmemchr(s,c) memchr((s),(size_t)-1,(c))
+#endif
+
+#ifndef __asprintf
+#define __asprintf asprintf
+#endif
+
+#ifndef __mempcpy
+#define __mempcpy mempcpy
+#endif
+
+#ifndef __strtok_r
+#define __strtok_r strtok_r
+#endif
+
+#ifndef __always_inline
+#define __always_inline __attribute__((__always_inline__))
+#endif
+
+#ifndef TEMP_FAILURE_RETRY
+#define TEMP_FAILURE_RETRY(exp) ({ \
+typeof (exp) _rc; \
+ do { \
+  _rc = (exp); \
+ } while (_rc == -1 && errno == EINTR); \
+ _rc; })
+#endif
 
 #ifndef __nis_object_h
 #define __nis_object_h
-- 
2.12.2