--- a/modules/highgui/src/cap_libv4l.cpp	2011-12-21 16:53:15.000000000 +0900
+++ b/modules/highgui/src/cap_libv4l.cpp	2011-12-21 16:54:16.000000000 +0900
@@ -236,7 +236,9 @@
 #include <sys/mman.h>
 #include <string.h>
 #include <stdlib.h>
+#if defined(__linux__)
 #include <asm/types.h>          /* for videodev2.h */
+#endif
 #include <assert.h>
 #include <sys/stat.h>
 #include <sys/ioctl.h>
--- a/modules/highgui/src/cap_v4l.cpp	2011-12-21 16:53:06.000000000 +0900
+++ b/modules/highgui/src/cap_v4l.cpp	2011-12-21 16:53:38.000000000 +0900
@@ -218,7 +218,9 @@
 
 #include <string.h>
 #include <stdlib.h>
+#if defined(__linux__)
 #include <asm/types.h>          /* for videodev2.h */
+#endif
 #include <assert.h>
 #include <sys/stat.h>
 #include <sys/ioctl.h>
