--- a/scanner.c
+++ b/scanner.c
@@ -604,10 +604,14 @@
 static int
 filter_type(scan_filter *d)
 {
+#if HAVE_STRUCT_DIRENT_D_TYPE
 	return ( (d->d_type == DT_DIR) ||
 	         (d->d_type == DT_LNK) ||
 	         (d->d_type == DT_UNKNOWN)
 	       );
+#else
+	return 1;
+#endif
 }
 
 static int
@@ -615,7 +619,7 @@
 {
 	return ( filter_hidden(d) &&
 	         (filter_type(d) ||
-		  ((d->d_type == DT_REG) &&
+		  (is_reg(d) &&
 		   (is_audio(d->d_name) ||
 	            is_playlist(d->d_name))))
 	       );
@@ -626,7 +630,7 @@
 {
 	return ( filter_hidden(d) &&
 	         (filter_type(d) ||
-		  ((d->d_type == DT_REG) &&
+		  (is_reg(d) &&
 		   (is_audio(d->d_name) ||
 		    is_video(d->d_name) ||
 	            is_playlist(d->d_name))))
@@ -638,7 +642,7 @@
 {
 	return ( filter_hidden(d) &&
 	         (filter_type(d) ||
-		  ((d->d_type == DT_REG) &&
+		  (is_reg(d) &&
 		   (is_audio(d->d_name) ||
 		    is_image(d->d_name) ||
 	            is_playlist(d->d_name))))
@@ -650,7 +654,7 @@
 {
 	return ( filter_hidden(d) &&
 	         (filter_type(d) ||
-		  (d->d_type == DT_REG &&
+		  (is_reg(d) &&
 	           is_video(d->d_name)))
 	       );
 }
@@ -660,7 +664,7 @@
 {
 	return ( filter_hidden(d) &&
 	         (filter_type(d) ||
-		  ((d->d_type == DT_REG) &&
+		  (is_reg(d) &&
 		   (is_video(d->d_name) ||
 	            is_image(d->d_name))))
 	       );
@@ -671,7 +675,7 @@
 {
 	return ( filter_hidden(d) &&
 	         (filter_type(d) ||
-		  (d->d_type == DT_REG &&
+		  (is_reg(d) &&
 		   is_image(d->d_name)))
 	       );
 }
@@ -681,7 +685,7 @@
 {
 	return ( filter_hidden(d) &&
 	         (filter_type(d) ||
-		  ((d->d_type == DT_REG) &&
+		  (is_reg(d) &&
 		   (is_audio(d->d_name) ||
 		    is_image(d->d_name) ||
 		    is_video(d->d_name) ||
@@ -754,11 +758,11 @@
 		type = TYPE_UNKNOWN;
 		snprintf(full_path, PATH_MAX, "%s/%s", dir, namelist[i]->d_name);
 		name = escape_tag(namelist[i]->d_name, 1);
-		if( namelist[i]->d_type == DT_DIR )
+		if( is_dir(namelist[i]) == 1 )
 		{
 			type = TYPE_DIR;
 		}
-		else if( namelist[i]->d_type == DT_REG )
+		else if( is_reg(namelist[i]) == 1 )
 		{
 			type = TYPE_FILE;
 		}