1From 01195eb9f7d59139fb45df506ac6b3968c14a57f 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 01/22] missing_type.h: add comparison_fn_t 5 6Make it work with musl where comparison_fn_t and is not provided. 7 8Upstream-Status: Inappropriate [musl specific] 9 10Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> 11[Rebased for v244] 12Signed-off-by: Chen Qi <Qi.Chen@windriver.com> 13[Rebased for v242] 14Signed-off-by: Andrej Valek <andrej.valek@siemens.com> 15[Rebased for v250, Drop __compare_fn_t] 16Signed-off-by: Jiaqing Zhao <jiaqing.zhao@linux.intel.com> 17--- 18 src/basic/missing_type.h | 4 ++++ 19 src/basic/sort-util.h | 1 + 20 src/libsystemd/sd-journal/catalog.c | 1 + 21 3 files changed, 6 insertions(+) 22 23diff --git a/src/basic/missing_type.h b/src/basic/missing_type.h 24index f6233090a9..6c0456349d 100644 25--- a/src/basic/missing_type.h 26+++ b/src/basic/missing_type.h 27@@ -10,3 +10,7 @@ 28 #if !HAVE_CHAR16_T 29 #define char16_t uint16_t 30 #endif 31+ 32+#ifndef __GLIBC__ 33+typedef int (*comparison_fn_t)(const void *, const void *); 34+#endif 35diff --git a/src/basic/sort-util.h b/src/basic/sort-util.h 36index 9c818bd747..ef10c8be2c 100644 37--- a/src/basic/sort-util.h 38+++ b/src/basic/sort-util.h 39@@ -4,6 +4,7 @@ 40 #include <stdlib.h> 41 42 #include "macro.h" 43+#include "missing_type.h" 44 45 /* This is the same as glibc's internal __compar_d_fn_t type. glibc exports a public comparison_fn_t, for the 46 * external type __compar_fn_t, but doesn't do anything similar for __compar_d_fn_t. Let's hence do that 47diff --git a/src/libsystemd/sd-journal/catalog.c b/src/libsystemd/sd-journal/catalog.c 48index ae91534198..7f67eea38b 100644 49--- a/src/libsystemd/sd-journal/catalog.c 50+++ b/src/libsystemd/sd-journal/catalog.c 51@@ -28,6 +28,7 @@ 52 #include "string-util.h" 53 #include "strv.h" 54 #include "tmpfile-util.h" 55+#include "missing_type.h" 56 57 const char * const catalog_file_dirs[] = { 58 "/usr/local/lib/systemd/catalog/", 59-- 602.34.1 61 62