diff --git a/backends/imgui_impl_wgpu.cpp b/backends/imgui_impl_wgpu.cpp index 86c30cfd4..47c31726b 100644 --- a/backends/imgui_impl_wgpu.cpp +++ b/backends/imgui_impl_wgpu.cpp @@ -1015,7 +1015,7 @@ void ImGui_ImplWGPU_DebugPrintAdapterInfo(const WGPUAdapter& adapter) wgpuAdapterInfoFreeMembers(info); } -#if defined(IMGUI_IMPL_WEBGPU_BACKEND_WGPU) || defined(IMGUI_IMPL_WEBGPU_BACKEND_DAWN) && !defined(__EMSCRIPTEN__) +#ifndef __EMSCRIPTEN__ #if defined(__APPLE__) // MacOS specific: is necessary to compile with "-x objective-c++" flags @@ -1079,7 +1079,7 @@ WGPUSurface ImGui_ImplWGPU_CreateWGPUSurfaceHelper(ImGui_ImplWGPU_CreateSurfaceI #endif return surface; } -#endif +#endif // #ifndef __EMSCRIPTEN__ //----------------------------------------------------------------------------- diff --git a/backends/imgui_impl_wgpu.h b/backends/imgui_impl_wgpu.h index 3d0cf5cc1..f17fe6c25 100644 --- a/backends/imgui_impl_wgpu.h +++ b/backends/imgui_impl_wgpu.h @@ -105,7 +105,7 @@ const char* ImGui_ImplWGPU_GetLogLevelName(WGPULogLevel level); #endif // (Optional) Helper to create a surface on macOS/Wayland/X11/Window -#if defined(IMGUI_IMPL_WEBGPU_BACKEND_WGPU) || defined(IMGUI_IMPL_WEBGPU_BACKEND_DAWN) && !defined(__EMSCRIPTEN__) +#ifndef __EMSCRIPTEN__ struct ImGui_ImplWGPU_CreateSurfaceInfo { WGPUInstance Instance; @@ -116,6 +116,6 @@ struct ImGui_ImplWGPU_CreateSurfaceInfo void* RawInstance; // 0 | 0 | 0 | HINSTANCE }; WGPUSurface ImGui_ImplWGPU_CreateWGPUSurfaceHelper(ImGui_ImplWGPU_CreateSurfaceInfo* info); -#endif +#endif // #ifndef __EMSCRIPTEN__ #endif // #ifndef IMGUI_DISABLE diff --git a/examples/example_glfw_wgpu/main.cpp b/examples/example_glfw_wgpu/main.cpp index 2fd746903..ad64ef403 100644 --- a/examples/example_glfw_wgpu/main.cpp +++ b/examples/example_glfw_wgpu/main.cpp @@ -506,7 +506,7 @@ static bool InitWGPU(GLFWwindow* window) // As of today (2025/10) there is no "official" support in GLFW to create a surface for WebGPU backend // This stub uses "low level" GLFW calls to acquire information from a specific Window Manager. // Currently supported platforms: Windows / Linux (X11 and Wayland) / MacOS. Not necessary nor available with EMSCRIPTEN. -#if !defined(__EMSCRIPTEN__) && (defined(IMGUI_IMPL_WEBGPU_BACKEND_WGPU) || defined(IMGUI_IMPL_WEBGPU_BACKEND_DAWN)) +#ifndef __EMSCRIPTEN__ #if defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__DragonFly__) #define GLFW_HAS_X11_OR_WAYLAND 1 @@ -573,4 +573,4 @@ WGPUSurface CreateWGPUSurface(const WGPUInstance& instance, GLFWwindow* window) #endif return nullptr; } -#endif +#endif // #ifndef __EMSCRIPTEN__ diff --git a/examples/example_sdl2_wgpu/main.cpp b/examples/example_sdl2_wgpu/main.cpp index bddc91b39..d4b9a021b 100644 --- a/examples/example_sdl2_wgpu/main.cpp +++ b/examples/example_sdl2_wgpu/main.cpp @@ -491,7 +491,7 @@ static bool InitWGPU(SDL_Window* window) // As of today (2025/10/31) there is no "official" support in SDL2 to create a surface for WebGPU backend. // This stub uses "low level" SDL2 calls to acquire information from a specific Window Manager. // Currently supported platforms: Windows / Linux (X11 and Wayland) / MacOS. Not necessary nor available with EMSCRIPTEN. -#if !defined(__EMSCRIPTEN__) && (defined(IMGUI_IMPL_WEBGPU_BACKEND_WGPU) || defined(IMGUI_IMPL_WEBGPU_BACKEND_DAWN)) +#ifndef __EMSCRIPTEN__ #include #undef Status // X11 headers are leaking this and also 'Success', 'Always', 'None', all used in DAWN api. Add #undef if necessary. @@ -538,4 +538,4 @@ WGPUSurface CreateWGPUSurface(const WGPUInstance& instance, SDL_Window* window) #endif return nullptr; } -#endif +#endif // #ifndef __EMSCRIPTEN__ diff --git a/examples/example_sdl3_wgpu/main.cpp b/examples/example_sdl3_wgpu/main.cpp index abfbf6cfa..d56b703c0 100644 --- a/examples/example_sdl3_wgpu/main.cpp +++ b/examples/example_sdl3_wgpu/main.cpp @@ -502,7 +502,7 @@ static bool InitWGPU(SDL_Window* window) // As of today (2025/10) there is no "official" support in SDL3 to create a surface for WebGPU backend // This stub uses "low level" SDL3 calls to acquire information from a specific Window Manager. // Currently supported platforms: Windows / Linux (X11 and Wayland) / MacOS. Not necessary nor available with EMSCRIPTEN. -#if !defined(__EMSCRIPTEN__) && (defined(IMGUI_IMPL_WEBGPU_BACKEND_WGPU) || defined(IMGUI_IMPL_WEBGPU_BACKEND_DAWN)) +#ifndef __EMSCRIPTEN__ #if defined(SDL_PLATFORM_WIN32) #ifndef WIN32_LEAN_AND_MEAN @@ -550,4 +550,4 @@ static WGPUSurface CreateWGPUSurface(const WGPUInstance& instance, SDL_Window* w #endif return nullptr; } -#endif +#endif // #ifndef __EMSCRIPTEN__