aboutsummaryrefslogtreecommitdiff
path: root/bb.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2019-05-31 00:22:37 -0700
committerBruce Hill <bruce@bruce-hill.com>2019-05-31 00:22:37 -0700
commit6db0c1bed4eb09dd497485db95b930a6019fd300 (patch)
tree5e398d37a9c8848dfc6584380a4a115f09d7de01 /bb.c
parent928b712ad75548783f64cc0841993b61438e0edd (diff)
Fixed one more qsort argument issue
Diffstat (limited to 'bb.c')
-rw-r--r--bb.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/bb.c b/bb.c
index 5098290..6596a71 100644
--- a/bb.c
+++ b/bb.c
@@ -130,7 +130,11 @@ static int fputs_escaped(FILE *f, const char *str, const char *color);
static const char* color_of(mode_t mode);
static void set_sort(bb_t *bb, const char *sort);
static void render(bb_t *bb);
+#ifdef __APPLE__
static int compare_files(void *v, const void *v1, const void *v2);
+#else
+static int compare_files(const void *v1, const void *v2, void *v);
+#endif
static void clear_selection(bb_t *bb);
static void select_entry(bb_t *bb, entry_t *e);
static void deselect_entry(bb_t *bb, entry_t *e);
@@ -575,7 +579,11 @@ void render(bb_t *bb)
* Used for sorting, this function compares files according to the sorting-related options,
* like bb->sort
*/
+#ifdef __APPLE__
int compare_files(void *v, const void *v1, const void *v2)
+#else
+int compare_files(const void *v1, const void *v2, void *v)
+#endif
{
#define COMPARE(a, b) if ((a) != (b)) { return sign*((a) < (b) ? 1 : -1); }
#define COMPARE_TIME(t1, t2) COMPARE((t1).tv_sec, (t2).tv_sec) COMPARE((t1).tv_nsec, (t2).tv_nsec)