Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 1 | From 60282514ea01af004d7f9e66dd3929223b7d2e7b Mon Sep 17 00:00:00 2001 |
| 2 | From: Khem Raj <raj.khem@gmail.com> |
| 3 | Date: Tue, 18 Apr 2017 09:16:12 -0700 |
| 4 | Subject: [PATCH 2/2] Define glibc specific macros |
| 5 | |
| 6 | Check and define |
| 7 | rawmemchr, __asprintf, __mempcpy, __strtok_r |
| 8 | __always_inline, TEMP_FAILURE_RETRY |
| 9 | |
| 10 | if not existing. Helps compiling with musl |
| 11 | |
| 12 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 13 | --- |
| 14 | Upstream-Status: Pending |
| 15 | |
| 16 | diff --git a/src/rpcsvc/nis.h b/src/rpcsvc/nis.h |
| 17 | index 88cbca0..23fc20c 100644 |
| 18 | --- a/src/rpcsvc/nis.h |
| 19 | +++ b/src/rpcsvc/nis.h |
| 20 | @@ -57,6 +57,34 @@ __BEGIN_DECLS |
| 21 | * <kukuk@suse.de> |
| 22 | */ |
| 23 | |
| 24 | +#ifndef rawmemchr |
| 25 | +#define rawmemchr(s,c) memchr((s),(size_t)-1,(c)) |
| 26 | +#endif |
| 27 | + |
| 28 | +#ifndef __asprintf |
| 29 | +#define __asprintf asprintf |
| 30 | +#endif |
| 31 | + |
| 32 | +#ifndef __mempcpy |
| 33 | +#define __mempcpy mempcpy |
| 34 | +#endif |
| 35 | + |
| 36 | +#ifndef __strtok_r |
| 37 | +#define __strtok_r strtok_r |
| 38 | +#endif |
| 39 | + |
| 40 | +#ifndef __always_inline |
| 41 | +#define __always_inline __attribute__((__always_inline__)) |
| 42 | +#endif |
| 43 | + |
| 44 | +#ifndef TEMP_FAILURE_RETRY |
| 45 | +#define TEMP_FAILURE_RETRY(exp) ({ \ |
| 46 | +typeof (exp) _rc; \ |
| 47 | + do { \ |
| 48 | + _rc = (exp); \ |
| 49 | + } while (_rc == -1 && errno == EINTR); \ |
| 50 | + _rc; }) |
| 51 | +#endif |
| 52 | |
| 53 | #ifndef __nis_object_h |
| 54 | #define __nis_object_h |
| 55 | -- |
| 56 | 2.12.2 |
| 57 | |