From e51f8dd09af0794c55386c1a7656baaf2c3ae5d2 Mon Sep 17 00:00:00 2001 From: Corentin Wallez Date: Tue, 18 Feb 2020 02:44:05 +0000 Subject: [PATCH] Fix compilation with stdlibc++ (instead of libc++) Also fixes some warnings when compiling with GCC Bug: dawn:333 Change-Id: Ib597bb3b950476279a1e20e3556765ec9f1db697 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15960 Commit-Queue: Kai Ninomiya Reviewed-by: Kai Ninomiya --- generator/templates/dawn_wire/client/ApiProcs.cpp | 1 + src/dawn_native/Buffer.cpp | 4 ++++ src/dawn_native/CommandEncoder.cpp | 1 + src/dawn_native/DawnNative.cpp | 4 ++-- src/dawn_native/ErrorData.h | 1 + src/dawn_native/RefCounted.cpp | 2 ++ src/dawn_native/RenderPipeline.cpp | 2 ++ src/dawn_native/vulkan/RenderPipelineVk.cpp | 4 ++++ 8 files changed, 17 insertions(+), 2 deletions(-) diff --git a/generator/templates/dawn_wire/client/ApiProcs.cpp b/generator/templates/dawn_wire/client/ApiProcs.cpp index 121e9835b5..1659cdf9c2 100644 --- a/generator/templates/dawn_wire/client/ApiProcs.cpp +++ b/generator/templates/dawn_wire/client/ApiProcs.cpp @@ -17,6 +17,7 @@ #include "dawn_wire/client/Client.h" #include +#include #include #include diff --git a/src/dawn_native/Buffer.cpp b/src/dawn_native/Buffer.cpp index e38724063b..5e173f375a 100644 --- a/src/dawn_native/Buffer.cpp +++ b/src/dawn_native/Buffer.cpp @@ -192,6 +192,8 @@ namespace dawn_native { return DAWN_VALIDATION_ERROR("Buffer used in a submit while mapped"); case BufferState::Unmapped: return {}; + default: + UNREACHABLE(); } } @@ -444,6 +446,8 @@ namespace dawn_native { return {}; case BufferState::Destroyed: return DAWN_VALIDATION_ERROR("Buffer is destroyed"); + default: + UNREACHABLE(); } } diff --git a/src/dawn_native/CommandEncoder.cpp b/src/dawn_native/CommandEncoder.cpp index 5185d1b64e..9cdd4a7d0f 100644 --- a/src/dawn_native/CommandEncoder.cpp +++ b/src/dawn_native/CommandEncoder.cpp @@ -30,6 +30,7 @@ #include "dawn_platform/DawnPlatform.h" #include "dawn_platform/tracing/TraceEvent.h" +#include #include namespace dawn_native { diff --git a/src/dawn_native/DawnNative.cpp b/src/dawn_native/DawnNative.cpp index dc95bc1cf9..b39b9f27cf 100644 --- a/src/dawn_native/DawnNative.cpp +++ b/src/dawn_native/DawnNative.cpp @@ -64,10 +64,8 @@ namespace dawn_native { return BackendType::OpenGL; case wgpu::BackendType::Vulkan: return BackendType::Vulkan; - default: UNREACHABLE(); - return BackendType::Null; } } @@ -81,6 +79,8 @@ namespace dawn_native { return DeviceType::CPU; case wgpu::AdapterType::Unknown: return DeviceType::Unknown; + default: + UNREACHABLE(); } } diff --git a/src/dawn_native/ErrorData.h b/src/dawn_native/ErrorData.h index 5d74d36327..52769b4069 100644 --- a/src/dawn_native/ErrorData.h +++ b/src/dawn_native/ErrorData.h @@ -16,6 +16,7 @@ #define DAWNNATIVE_ERRORDATA_H_ #include +#include #include #include diff --git a/src/dawn_native/RefCounted.cpp b/src/dawn_native/RefCounted.cpp index 9b4c1c2521..a0e50b8b75 100644 --- a/src/dawn_native/RefCounted.cpp +++ b/src/dawn_native/RefCounted.cpp @@ -16,6 +16,8 @@ #include "common/Assert.h" +#include + namespace dawn_native { static constexpr size_t kPayloadBits = 1; diff --git a/src/dawn_native/RenderPipeline.cpp b/src/dawn_native/RenderPipeline.cpp index ee28fcf9d0..dc4a508c29 100644 --- a/src/dawn_native/RenderPipeline.cpp +++ b/src/dawn_native/RenderPipeline.cpp @@ -20,6 +20,8 @@ #include "dawn_native/Device.h" #include "dawn_native/ValidationUtils_autogen.h" +#include + namespace dawn_native { // Helper functions namespace { diff --git a/src/dawn_native/vulkan/RenderPipelineVk.cpp b/src/dawn_native/vulkan/RenderPipelineVk.cpp index b0ba4fd701..88447fb73e 100644 --- a/src/dawn_native/vulkan/RenderPipelineVk.cpp +++ b/src/dawn_native/vulkan/RenderPipelineVk.cpp @@ -144,6 +144,8 @@ namespace dawn_native { namespace vulkan { return VK_FRONT_FACE_COUNTER_CLOCKWISE; case wgpu::FrontFace::CW: return VK_FRONT_FACE_CLOCKWISE; + default: + UNREACHABLE(); } } @@ -155,6 +157,8 @@ namespace dawn_native { namespace vulkan { return VK_CULL_MODE_FRONT_BIT; case wgpu::CullMode::Back: return VK_CULL_MODE_BACK_BIT; + default: + UNREACHABLE(); } }