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 <enga@chromium.org> Reviewed-by: Austin Eng <enga@chromium.org> Reviewed-by: Mike Klein <mtklein@google.com>
diff --git a/src/common/BUILD.gn b/src/common/BUILD.gn index 3f5a09b..244baeb 100644 --- a/src/common/BUILD.gn +++ b/src/common/BUILD.gn
@@ -104,6 +104,7 @@ "-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 e07e741..f1a6047 100644 --- a/src/include/dawn/dawn_wsi.h +++ b/src/include/dawn/dawn_wsi.h
@@ -59,18 +59,18 @@ } 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 <Metal/Metal.h> -typedef struct { +struct DawnWSIContextMetal { id<MTLDevice> device = nil; id<MTLCommandQueue> queue = nil; -} DawnWSIContextMetal; +}; #endif #ifdef DAWN_ENABLE_BACKEND_OPENGL