Fix and enable -Wnested-anon-types

Bug: dawn:394
Change-Id: I51b533c07f21bcacd22a058cf4a080b9b2b853f7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/20700
Reviewed-by: Stephen White <senorblanco@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
Corentin Wallez 2020-04-30 15:58:28 +00:00 committed by Commit Bot service account
parent 754c161fd3
commit e642b1d959
3 changed files with 17 additions and 8 deletions

View File

@ -118,7 +118,6 @@ config("dawn_internal") {
"-Wno-gnu-zero-variadic-macro-arguments", "-Wno-gnu-zero-variadic-macro-arguments",
"-Wno-language-extension-token", "-Wno-language-extension-token",
"-Wno-microsoft-enum-value", "-Wno-microsoft-enum-value",
"-Wno-nested-anon-types",
] ]
} }
} }

View File

@ -71,19 +71,23 @@ namespace dawn_native {
// Track whether this block has been split or not. // Track whether this block has been split or not.
BlockState mState; BlockState mState;
struct FreeLinks {
BuddyBlock* pPrev;
BuddyBlock* pNext;
};
struct SplitLink {
BuddyBlock* pLeft;
};
union { union {
// Used upon allocation. // Used upon allocation.
// Avoids searching for the next free block. // Avoids searching for the next free block.
struct { FreeLinks free;
BuddyBlock* pPrev;
BuddyBlock* pNext;
} free;
// Used upon de-allocation. // Used upon de-allocation.
// Had this block split upon allocation, it and it's buddy is to be deleted. // Had this block split upon allocation, it and it's buddy is to be deleted.
struct { SplitLink split;
BuddyBlock* pLeft;
} split;
}; };
}; };

View File

@ -18,6 +18,12 @@ assert(dawn_standalone)
config("glm_public_config") { config("glm_public_config") {
include_dirs = [ "${dawn_glm_dir}" ] include_dirs = [ "${dawn_glm_dir}" ]
# GLM tries to suppress the warning for clang but gets confused by clang-cl
# and thinks it is MSVC.
if (is_win && is_clang) {
cflags = [ "-Wno-nested-anon-types" ]
}
} }
source_set("glm") { source_set("glm") {
configs -= [ "//build/config/compiler:chromium_code" ] configs -= [ "//build/config/compiler:chromium_code" ]