Fix FreeBSD build of VK_EXT_physical_device_drm tests
authorJames Jones <jajones@nvidia.com>
Wed, 7 Jul 2021 20:59:12 +0000 (13:59 -0700)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Wed, 14 Jul 2021 07:01:37 +0000 (07:01 +0000)
Linux defines the major() and minor() macros in
the sys/sysmacros.h header, but FreeBSD does not
have this header and instead defines them in
sys/types.h.

Components: Vulkan
Affects: dEQP-VK.api.device_drm_properties.*

Change-Id: I0bed149d24241e152437f530f5eb137738c46122

external/vulkancts/modules/vulkan/api/vktApiDeviceDrmPropertiesTests.cpp

index 882d11d..12ac828 100644 (file)
 #include "deDirectoryIterator.hpp"
 #include "deDynamicLibrary.hpp"
 #if DEQP_SUPPORT_DRM
+#if !defined(__FreeBSD__)
+// major() and minor() are defined in sys/types.h on FreeBSD, and in
+// sys/sysmacros.h on Linux and Solaris.
 #include <sys/sysmacros.h>
+#endif // !defined(__FreeBSD__)
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <unistd.h>
 #include <xf86drm.h>
-#endif
+#endif // DEQP_SUPPORT_DRM
 
 using namespace vk;