From 5a4095825a8f4d65bfabb6f784503b53c2cbbf77 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Fri, 26 Feb 2016 14:51:15 +0000
Subject: Haiku patch


diff --git a/arscan.c b/arscan.c
index 24286fd..768bbfe 100644
--- a/arscan.c
+++ b/arscan.c
@@ -325,7 +325,7 @@ ar_scan (const char *archive, ar_member_func_t function, const void *varg)
 #endif
 
 #ifndef WINDOWS32
-# if !defined (__ANDROID__) && !defined (__BEOS__)
+# if !defined (__ANDROID__) && !defined (__BEOS__) && !defined (__HAIKU__)
 #  include <ar.h>
 # else
    /* These platforms don't have <ar.h> but have archives in the same format
-- 
2.30.2


From a1217a6b3f8a251d5283f93b24a0a2eaddc5609f Mon Sep 17 00:00:00 2001
From: David Karoly <david.karoly@outlook.com>
Date: Sun, 21 Nov 2021 15:21:15 +0000
Subject: fix build


diff --git a/dir.c b/dir.c
index 7e00b8f..d87adb9 100644
--- a/dir.c
+++ b/dir.c
@@ -1142,7 +1142,7 @@ read_dirstream (__ptr_t stream)
           /* The glob interface wants a 'struct dirent', so mock one up.  */
           struct dirent *d;
           unsigned int len = df->length + 1;
-          unsigned int sz = sizeof (*d) - sizeof (d->d_name) + len;
+          unsigned int sz = offsetof (struct dirent, d_name) + len;
           if (sz > bufsz)
             {
               bufsz *= 2;
-- 
2.30.2

