diff --git a/gen/cheader.tmpl b/gen/cheader.tmpl index d491c67e..bdd32edc 100644 --- a/gen/cheader.tmpl +++ b/gen/cheader.tmpl @@ -67,7 +67,6 @@ {{- if eq .Name "webgpu"}} #include #include -#include {{else}} #include "webgpu.h" {{end}} diff --git a/gen/gen.go b/gen/gen.go index 277221a7..3b6f87c1 100644 --- a/gen/gen.go +++ b/gen/gen.go @@ -196,7 +196,7 @@ func (g *Generator) CValue(s string) (string, error) { case "uint64_max": return "UINT64_MAX", nil case "nan": - return "NAN", nil + return "0.0f / 0.0f", nil default: var num string var base int diff --git a/webgpu.h b/webgpu.h index 6107babe..9a3bdab9 100644 --- a/webgpu.h +++ b/webgpu.h @@ -60,7 +60,6 @@ #include #include -#include #define _wgpu_COMMA , #if defined(__cplusplus) @@ -92,7 +91,7 @@ * Value to be assigned to member depthClearValue of @ref WGPURenderPassDepthStencilAttachment * to mean that it is not defined. */ -#define WGPU_DEPTH_CLEAR_VALUE_UNDEFINED (NAN) +#define WGPU_DEPTH_CLEAR_VALUE_UNDEFINED (0.0f / 0.0f) #define WGPU_DEPTH_SLICE_UNDEFINED (UINT32_MAX) #define WGPU_LIMIT_U32_UNDEFINED (UINT32_MAX) #define WGPU_LIMIT_U64_UNDEFINED (UINT64_MAX)