summaryrefslogtreecommitdiffstats
path: root/toolbox/newfs_msdos.c
diff options
context:
space:
mode:
Diffstat (limited to 'toolbox/newfs_msdos.c')
-rw-r--r--toolbox/newfs_msdos.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/toolbox/newfs_msdos.c b/toolbox/newfs_msdos.c
index d7047e2c4..5fc8b0242 100644
--- a/toolbox/newfs_msdos.c
+++ b/toolbox/newfs_msdos.c
@@ -32,15 +32,17 @@ static const char rcsid[] =
#include <sys/param.h>
-#ifndef ANDROID
+#ifdef __APPLE__
+#elif defined(ANDROID)
+#include <linux/fs.h>
+#include <linux/hdreg.h>
+#include <stdarg.h>
+#include <sys/ioctl.h>
+#else
#include <sys/fdcio.h>
#include <sys/disk.h>
#include <sys/disklabel.h>
#include <sys/mount.h>
-#else
-#include <stdarg.h>
-#include <linux/fs.h>
-#include <linux/hdreg.h>
#endif
#include <sys/stat.h>
@@ -58,6 +60,10 @@ static const char rcsid[] =
#include <time.h>
#include <unistd.h>
+#ifndef __unused
+#define __unused __attribute__((__unused__))
+#endif
+
#define MAXU16 0xffff /* maximum unsigned 16-bit quantity */
#define BPN 4 /* bits per nibble */
#define NPB 2 /* nibbles per byte */
@@ -794,7 +800,10 @@ static void getstdfmt(const char *fmt, struct bpb *bpb)
* Get disk slice, partition, and geometry information.
*/
-#ifdef ANDROID
+#ifdef __APPLE__
+static void getdiskinfo(__unused int fd, __unused const char* fname, __unused const char* dtype,
+ __unused int oflag, __unused struct bpb* bpb) {}
+#elif ANDROID
static void getdiskinfo(int fd, const char *fname, const char *dtype,
__unused int oflag,struct bpb *bpb)
{