From 4204773d9debe898d72f52216779191c88459a27 Mon Sep 17 00:00:00 2001
From: Sergey Fedorov <vital.had@gmail.com>
Date: Tue, 3 Jan 2023 23:56:12 +0700
Subject: [PATCH 03/10] Fix for missing COMPAR_FN_T

---
 include/alphasparse/opt.h     | 5 +++++
 tools/reversible_sparse_gen.c | 5 +++++
 tools/sparse_gen.c            | 5 +++++
 tools/sparse_gen_symv.c       | 5 +++++
 4 files changed, 20 insertions(+)

diff --git a/include/alphasparse/opt.h b/include/alphasparse/opt.h
index 68cc4e7..20693d7 100644
--- a/include/alphasparse/opt.h
+++ b/include/alphasparse/opt.h
@@ -5,3 +5,8 @@
  */
 
 #include "alphasparse/util/thread.h"
+
+#ifndef __COMPAR_FN_T
+#define __COMPAR_FN_T
+    typedef int (*__compar_fn_t)(const void *, const void *);
+#endif
diff --git a/tools/reversible_sparse_gen.c b/tools/reversible_sparse_gen.c
index ceedf8e..39bd20d 100644
--- a/tools/reversible_sparse_gen.c
+++ b/tools/reversible_sparse_gen.c
@@ -8,6 +8,11 @@
 #include <time.h>
 #include <stdint.h>
 
+#ifndef __COMPAR_FN_T
+#define __COMPAR_FN_T
+    typedef int (*__compar_fn_t)(const void *, const void *);
+#endif
+
 inline static int random_int(int m)
 {
     return rand() % m;
diff --git a/tools/sparse_gen.c b/tools/sparse_gen.c
index 00ec853..c64b3d4 100644
--- a/tools/sparse_gen.c
+++ b/tools/sparse_gen.c
@@ -8,6 +8,11 @@
 #include <time.h>
 #include <stdint.h>
 
+#ifndef __COMPAR_FN_T
+#define __COMPAR_FN_T
+    typedef int (*__compar_fn_t)(const void *, const void *);
+#endif
+
 inline static int random_int(int m)
 {
     return rand() % m;
diff --git a/tools/sparse_gen_symv.c b/tools/sparse_gen_symv.c
index 1d7891d..2ad4c35 100644
--- a/tools/sparse_gen_symv.c
+++ b/tools/sparse_gen_symv.c
@@ -8,6 +8,11 @@
 #include <time.h>
 #include <stdint.h>
 
+#ifndef __COMPAR_FN_T
+#define __COMPAR_FN_T
+    typedef int (*__compar_fn_t)(const void *, const void *);
+#endif
+
 inline static int random_int(int m)
 {
     return rand() % m;
-- 
2.39.0

