blob: 2e39f7a2e19b5e4163391b7da4d51126acab0d2e [file] [log] [blame]
Brad Bishop19323692019-04-05 15:28:33 -04001From a9421d55102fc84f77f7c21a2479fcd00652b896 Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Mon, 25 Feb 2019 13:55:12 +0800
4Subject: [PATCH 03/24] missing_type.h: add __compare_fn_t and comparison_fn_t
5
6Make it work with musl where comparison_fn_t and __compare_fn_t
7is not provided.
8
9Upstream-Status: Inappropriate [musl specific]
10
11Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Brad Bishopc342db32019-05-15 21:57:59 -040012[Rebased for v242]
13Signed-off-by: Andrej Valek <andrej.valek@siemens.com>
Brad Bishop19323692019-04-05 15:28:33 -040014---
15 src/basic/missing_type.h | 9 +++++++++
Brad Bishopc342db32019-05-15 21:57:59 -040016 src/basic/sort-util.h | 1 +
Brad Bishop19323692019-04-05 15:28:33 -040017 src/journal/catalog.c | 1 +
18 3 files changed, 11 insertions(+)
19
20diff --git a/src/basic/missing_type.h b/src/basic/missing_type.h
Brad Bishopc342db32019-05-15 21:57:59 -040021index bf8a6caa1b..2134fe5095 100644
Brad Bishop19323692019-04-05 15:28:33 -040022--- 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 Bishopc342db32019-05-15 21:57:59 -040037diff --git a/src/basic/sort-util.h b/src/basic/sort-util.h
38index 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 Bishop19323692019-04-05 15:28:33 -040044 #include "macro.h"
Brad Bishop19323692019-04-05 15:28:33 -040045+#include "missing.h"
46
Brad Bishopc342db32019-05-15 21:57:59 -040047 void *xbsearch_r(const void *key, const void *base, size_t nmemb, size_t size,
48 __compar_d_fn_t compar, void *arg);
Brad Bishop19323692019-04-05 15:28:33 -040049diff --git a/src/journal/catalog.c b/src/journal/catalog.c
Brad Bishopc342db32019-05-15 21:57:59 -040050index 7beffc1e1a..4818a2e5cc 100644
Brad Bishop19323692019-04-05 15:28:33 -040051--- a/src/journal/catalog.c
52+++ b/src/journal/catalog.c
Brad Bishopc342db32019-05-15 21:57:59 -040053@@ -29,6 +29,7 @@
54 #include "string-util.h"
Brad Bishop19323692019-04-05 15:28:33 -040055 #include "strv.h"
56 #include "tmpfile-util.h"
Brad Bishop19323692019-04-05 15:28:33 -040057+#include "missing.h"
58
59 const char * const catalog_file_dirs[] = {
60 "/usr/local/lib/systemd/catalog/",
61--
Brad Bishopc342db32019-05-15 21:57:59 -0400622.11.0
Brad Bishop19323692019-04-05 15:28:33 -040063