From 3fb9c1bbfb2354053da778a99c6129bafc8f317e Mon Sep 17 00:00:00 2001 From: Austin Eng Date: Tue, 2 Jun 2020 18:54:20 +0000 Subject: [PATCH] Add warning for non-c-typedef-for-linkage This is blocking Skia from updating to newer clang Tbr=cwallez@chromium.org Bug: chromium:1064305 Change-Id: I7d894dba701ebe2fe0e1b78d5fb42032d88846aa Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/22522 Commit-Queue: Austin Eng Reviewed-by: Austin Eng Reviewed-by: Mike Klein --- src/common/BUILD.gn | 1 + src/include/dawn/dawn_wsi.h | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/common/BUILD.gn b/src/common/BUILD.gn index 3f5a09b378..244baebc48 100644 --- a/src/common/BUILD.gn +++ b/src/common/BUILD.gn @@ -104,6 +104,7 @@ config("dawn_internal") { "-Wshadow-field", "-Wstrict-prototypes", "-Wtautological-unsigned-zero-compare", + "-Wnon-c-typedef-for-linkage", ] if (is_win) { diff --git a/src/include/dawn/dawn_wsi.h b/src/include/dawn/dawn_wsi.h index e07e74185c..f1a6047b5b 100644 --- a/src/include/dawn/dawn_wsi.h +++ b/src/include/dawn/dawn_wsi.h @@ -59,18 +59,18 @@ typedef struct { } DawnSwapChainImplementation; #if defined(DAWN_ENABLE_BACKEND_D3D12) && defined(__cplusplus) -typedef struct { +struct DawnWSIContextD3D12 { WGPUDevice device = nullptr; -} DawnWSIContextD3D12; +}; #endif #if defined(DAWN_ENABLE_BACKEND_METAL) && defined(__OBJC__) # import -typedef struct { +struct DawnWSIContextMetal { id device = nil; id queue = nil; -} DawnWSIContextMetal; +}; #endif #ifdef DAWN_ENABLE_BACKEND_OPENGL