From 8a917ed2afb2dd2a165a93812b6f52b9060eec5f Mon Sep 17 00:00:00 2001
From: Rui Chen <rui@chenrui.dev>
Date: Sun, 31 Jan 2021 12:43:12 -0500
Subject: [PATCH] fix: patch for osx build

Signed-off-by: Rui Chen <rui@chenrui.dev>
---
 src/blkdev/blkdev.c | 4 +++-
 src/device_info.c   | 5 ++++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/blkdev/blkdev.c b/src/blkdev/blkdev.c
index d97a4b3..029d694 100644
--- src/blkdev/blkdev.c.orig
+++ src/blkdev/blkdev.c
@@ -7,7 +7,9 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/ioctl.h>
-#include <sys/sysmacros.h>
+#ifdef HAVE_SYS_SYSMACROS_H
+# include <sys/sysmacros.h>
+#endif
 #include <unistd.h>
 #include <stdint.h>
 #include <stdio.h>
diff --git a/src/device_info.c b/src/device_info.c
index 21c438f..5db5192 100644
--- src/device_info.c.orig
+++ src/device_info.c
@@ -24,7 +24,10 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/ioctl.h>
-#include <sys/sysmacros.h>
+
+#ifdef HAVE_SYS_SYSMACROS_H
+# include <sys/sysmacros.h>
+#endif
 
 #ifdef HAVE_LINUX_LOOP_H
 #include <linux/loop.h>
