vulkan/wsi: Fix compiler warning when no WSI platforms are enabled.
authorEric Anholt <eric@anholt.net>
Tue, 17 Dec 2019 03:58:39 +0000 (19:58 -0800)
committerEric Anholt <eric@anholt.net>
Tue, 28 Jan 2020 20:30:48 +0000 (12:30 -0800)
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3539>

src/vulkan/wsi/wsi_common.c

index dfc90b5900d56eb5fe56a284ff8eb3f813777422..0adf54eab8f3a46e6e8a255b9ee1f44f8501a50e 100644 (file)
@@ -42,7 +42,7 @@ wsi_device_init(struct wsi_device *wsi,
                 const struct driOptionCache *dri_options)
 {
    const char *present_mode;
-   VkResult result;
+   UNUSED VkResult result;
 
    memset(wsi, 0, sizeof(*wsi));
 
@@ -145,10 +145,13 @@ wsi_device_init(struct wsi_device *wsi,
    }
 
    return VK_SUCCESS;
-
+#if defined(VK_USE_PLATFORM_XCB_KHR) || \
+   defined(VK_USE_PLATFORM_WAYLAND_KHR) || \
+   defined(VK_USE_PLATFORM_DISPLAY_KHR)
 fail:
    wsi_device_finish(wsi, alloc);
    return result;
+#endif
 }
 
 void