diff options
Diffstat (limited to 'src/env.c')
| -rw-r--r-- | src/env.c | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -1,3 +1,5 @@ +#include <math.h> + #include <SDL3/SDL_error.h> #include <SDL3/SDL_stdinc.h> #include <SDL3/SDL_timer.h> @@ -244,3 +246,22 @@ void w2c_env_0x5Femscripten_set_main_loop(struct w2c_env *env, uint32_t func, (void)fps; (void)simulate_infinite_loop; } + +static struct w2c_global shared_global = { + .infinity = INFINITY, + .nan = NAN, +}; + +double *w2c_global_Infinity(struct w2c_global *global) { + if (!global) { + global = &shared_global; + } + return &global->infinity; +} + +double *w2c_global_NaN(struct w2c_global *global) { + if (!global) { + global = &shared_global; + } + return &global->nan; +} |
