summaryrefslogtreecommitdiff
path: root/misc/raspberrypi-userland/patches/patch-host__applications_linux_apps_dtoverlay_dtoverlay__main.c
blob: e86f4b66b02888f77787f477580210e7605a9a5a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
$NetBSD: patch-host__applications_linux_apps_dtoverlay_dtoverlay__main.c,v 1.3 2017/04/16 19:25:25 skrll Exp $

--- host_applications/linux/apps/dtoverlay/dtoverlay_main.c.orig	2017-01-07 08:24:37.000000000 +0000
+++ host_applications/linux/apps/dtoverlay/dtoverlay_main.c
@@ -36,6 +36,10 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBI
 
 #include <libfdt.h>
 
+#ifdef __NetBSD__
+#include <sys/param.h>
+#endif
+
 #include "dtoverlay.h"
 #include "utils.h"
 
@@ -1006,8 +1010,15 @@ int seq_filter(const struct dirent *de)
     return (sscanf(de->d_name, "%d_", &num) == 1);
 }
 
+#if defined (__NetBSD__) && __NetBSD_Version__-0 >= 799005100
 int seq_compare(const struct dirent **de1, const struct dirent **de2)
 {
+#else
+int seq_compare(const void *d1, const void *d2)
+{
+     const struct dirent * const *de1 = d1;
+     const struct dirent * const *de2 = d2;
+#endif
     int num1 = atoi((*de1)->d_name);
     int num2 = atoi((*de2)->d_name);
     if (num1 < num2)