Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use 0.0f/0.0f instead of math.h NAN #461

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion gen/cheader.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@
{{- if eq .Name "webgpu"}}
#include <stdint.h>
#include <stddef.h>
#include <math.h>
{{else}}
#include "webgpu.h"
{{end}}
Expand Down
2 changes: 1 addition & 1 deletion gen/gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions webgpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@

#include <stdint.h>
#include <stddef.h>
#include <math.h>

#define _wgpu_COMMA ,
#if defined(__cplusplus)
Expand Down Expand Up @@ -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)
Expand Down
Loading