diff --git a/xtrn/sbl/smb2sbl.c b/xtrn/sbl/smb2sbl.c
index 0c0809a8397037805c8fedc2c7249743f298cc23..22a68f94b19454eb5c65258cc373865f41f50e2d 100644
--- a/xtrn/sbl/smb2sbl.c
+++ b/xtrn/sbl/smb2sbl.c
@@ -45,7 +45,7 @@
 #include <sys/stat.h>	/* S_IWRITE */
 #include <ctype.h>		/* isdigit */
 #include <stdlib.h>		/* atoi */
-#ifndef __BSD
+#ifndef __unix__
 	#include <malloc.h>
 #endif
 #include <string.h>
diff --git a/xtrn/sdk/xsdk.h b/xtrn/sdk/xsdk.h
index 265e20a2dcaf7cc35180b1e1ce92a26d21713600..bf15f8130699670d18a7f55e3d58d8ec76dc37b4 100644
--- a/xtrn/sdk/xsdk.h
+++ b/xtrn/sdk/xsdk.h
@@ -61,7 +61,7 @@
 #include <string.h>
 #include <stdlib.h>
 #include <stdarg.h>
-#ifndef __BSD		/* FreeBSD uses stdlib.h for malloc() */
+#ifndef __unix__
 	#include <malloc.h>
 #endif
 #include <sys/stat.h>
diff --git a/xtrn/sdk/xsdkinet.h b/xtrn/sdk/xsdkinet.h
index cee0f6a7ec11be0fbe5b7a4dd629f555b408624a..5e5682e30161e43bd29010b51b6c546d76b4b740 100644
--- a/xtrn/sdk/xsdkinet.h
+++ b/xtrn/sdk/xsdkinet.h
@@ -52,9 +52,7 @@
 
 #elif defined __unix__	/* Unix-variant */
 
-#ifdef __BSD
 #include <sys/types.h>	/* u_intXX_t */
-#endif
 
 #include <netdb.h>		/* gethostbyname */
 #include <netinet/in.h>	/* IPPROTO_IP */
diff --git a/xtrn/sdk/xsdkwrap.c b/xtrn/sdk/xsdkwrap.c
index ef4cbc28153ce3f0629a4603e3482ba4e624b04c..a8ca317f90629e94385710092bcd16cb9be4878a 100644
--- a/xtrn/sdk/xsdkwrap.c
+++ b/xtrn/sdk/xsdkwrap.c
@@ -49,11 +49,9 @@
 	#include <stdlib.h>
 	#include <unistd.h>
 	#include <termios.h>
-	#ifdef __BSD
-	#ifndef __OpenBSD__
+	#if defined(__FreeBSD__)
 	#include <sys/kbio.h>
-	#endif
-	#else
+	#elif defined(__Linux__)
 	#include <sys/kd.h>
 	#endif
 	#include <sys/time.h>