Turn off CMAKE_CXX_EXTENSIONS, don't use ##__VA_ARGS__
This reverts commit 2d6e9ab3aa35202a1311a1ea947f22818529cc99.
Avoid using ##__VA_ARGS__, which is a GCC extension
Fixed: chromium:353964697
Change-Id: I3a9ca666e5714dea87f867e502f3eb19d59bf64d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/199495
Auto-Submit: David Neto <dneto@google.com>
Commit-Queue: James Price <jrprice@google.com>
Reviewed-by: James Price <jrprice@google.com>
diff --git a/src/cmake/DawnCompilerChecks.cmake b/src/cmake/DawnCompilerChecks.cmake
index 3b597b3..d8bbe42 100644
--- a/src/cmake/DawnCompilerChecks.cmake
+++ b/src/cmake/DawnCompilerChecks.cmake
@@ -30,3 +30,4 @@
# dawn_add_library still have the C++17 compiler flags enabled
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)
+set(CMAKE_CXX_EXTENSIONS False)
diff --git a/src/dawn/native/CMakeLists.txt b/src/dawn/native/CMakeLists.txt
index 04611c7..9c0bd6f 100644
--- a/src/dawn/native/CMakeLists.txt
+++ b/src/dawn/native/CMakeLists.txt
@@ -888,8 +888,6 @@
"WGPU_SHARED_LIBRARY"
"DAWN_NATIVE_SHARED_LIBRARY"
)
- # TODO: Revert https://dawn-review.googlesource.com/c/dawn/+/196361 and remove the next line.
- set_target_properties(webgpu_dawn PROPERTIES CXX_EXTENSIONS NO)
# Apart from dawn_public_config, everything else goes inside PRIVATE, otherwise install rules will complain that they were not exported.
target_link_libraries(webgpu_dawn
PUBLIC
diff --git a/src/dawn/node/binding/GPUShaderModule.cpp b/src/dawn/node/binding/GPUShaderModule.cpp
index aef597a..94a3bb9 100644
--- a/src/dawn/node/binding/GPUShaderModule.cpp
+++ b/src/dawn/node/binding/GPUShaderModule.cpp
@@ -59,7 +59,7 @@
case WGPUCompilationMessageType_Info:
return interop::GPUCompilationMessageType::kInfo;
default:
- UNREACHABLE();
+ UNREACHABLE("unrecognized handled compilation message type", message.type);
}
}
uint64_t getLineNum(Napi::Env) override { return message.lineNum; }
diff --git a/src/dawn/node/utils/Debug.h b/src/dawn/node/utils/Debug.h
index c1f5288..13ed0c3 100644
--- a/src/dawn/node/utils/Debug.h
+++ b/src/dawn/node/utils/Debug.h
@@ -149,11 +149,11 @@
} while (false)
// UNREACHABLE() prints 'UNREACHABLE' with the current file, line and
-// function to stdout, along with the optional message, then calls abort().
+// function to stdout, along with the message, then calls abort().
// The macro calls Fatal(), which is annotated with [[noreturn]].
// Used to stub code that has not yet been implemented.
#define UNREACHABLE(...) \
- ::wgpu::utils::Fatal("UNREACHABLE", __FILE__, __LINE__, __FUNCTION__, ##__VA_ARGS__)
+ ::wgpu::utils::Fatal("UNREACHABLE", __FILE__, __LINE__, __FUNCTION__, __VA_ARGS__)
} // namespace wgpu::utils