Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 1 | From a9421d55102fc84f77f7c21a2479fcd00652b896 Mon Sep 17 00:00:00 2001 |
| 2 | From: Chen Qi <Qi.Chen@windriver.com> |
| 3 | Date: Mon, 25 Feb 2019 13:55:12 +0800 |
| 4 | Subject: [PATCH 03/24] missing_type.h: add __compare_fn_t and comparison_fn_t |
| 5 | |
| 6 | Make it work with musl where comparison_fn_t and __compare_fn_t |
| 7 | is not provided. |
| 8 | |
| 9 | Upstream-Status: Inappropriate [musl specific] |
| 10 | |
| 11 | Signed-off-by: Chen Qi <Qi.Chen@windriver.com> |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 12 | [Rebased for v242] |
| 13 | Signed-off-by: Andrej Valek <andrej.valek@siemens.com> |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 14 | --- |
| 15 | src/basic/missing_type.h | 9 +++++++++ |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 16 | src/basic/sort-util.h | 1 + |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 17 | src/journal/catalog.c | 1 + |
| 18 | 3 files changed, 11 insertions(+) |
| 19 | |
| 20 | diff --git a/src/basic/missing_type.h b/src/basic/missing_type.h |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 21 | index bf8a6caa1b..2134fe5095 100644 |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 22 | --- a/src/basic/missing_type.h |
| 23 | +++ b/src/basic/missing_type.h |
| 24 | @@ -10,3 +10,12 @@ |
| 25 | #if !HAVE_CHAR16_T |
| 26 | #define char16_t uint16_t |
| 27 | #endif |
| 28 | + |
| 29 | +#ifndef __GLIBC__ |
| 30 | +typedef int (*comparison_fn_t)(const void *, const void *); |
| 31 | +#endif |
| 32 | + |
| 33 | +#ifndef __COMPAR_FN_T |
| 34 | +#define __COMPAR_FN_T |
| 35 | +typedef int (*__compar_fn_t)(const void *, const void *); |
| 36 | +#endif |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 37 | diff --git a/src/basic/sort-util.h b/src/basic/sort-util.h |
| 38 | index e029f86..7247d40 100644 |
| 39 | --- a/src/basic/sort-util.h |
| 40 | +++ b/src/basic/sort-util.h |
| 41 | @@ -4,6 +4,7 @@ |
| 42 | #include <stdlib.h> |
| 43 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 44 | #include "macro.h" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 45 | +#include "missing.h" |
| 46 | |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 47 | void *xbsearch_r(const void *key, const void *base, size_t nmemb, size_t size, |
| 48 | __compar_d_fn_t compar, void *arg); |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 49 | diff --git a/src/journal/catalog.c b/src/journal/catalog.c |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 50 | index 7beffc1e1a..4818a2e5cc 100644 |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 51 | --- a/src/journal/catalog.c |
| 52 | +++ b/src/journal/catalog.c |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 53 | @@ -29,6 +29,7 @@ |
| 54 | #include "string-util.h" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 55 | #include "strv.h" |
| 56 | #include "tmpfile-util.h" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 57 | +#include "missing.h" |
| 58 | |
| 59 | const char * const catalog_file_dirs[] = { |
| 60 | "/usr/local/lib/systemd/catalog/", |
| 61 | -- |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 62 | 2.11.0 |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 63 | |