diff --git a/source/lib/sysdep/os/win/wposix/wposix.cpp b/source/lib/sysdep/os/win/wposix/wposix.cpp index ce0eb2daf8..efa067cb6a 100644 --- a/source/lib/sysdep/os/win/wposix/wposix.cpp +++ b/source/lib/sysdep/os/win/wposix/wposix.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2010 Wildfire Games. +/* Copyright (C) 2026 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -25,21 +25,25 @@ */ #include "precompiled.h" -#include "lib/sysdep/os/win/wposix/wposix.h" -#include "lib/sysdep/os/win/wposix/wposix_internal.h" -#include "lib/bits.h" +#include "wposix.h" + +#include "lib/sysdep/os/win/win.h" + +#include +#include +#include int setenv(const char* envname, const char* envval, int overwrite) { - if(!envname || envname[0] == '\0' || strchr(envname, '=')) + if(!envname || envname[0] == '\0' || std::strchr(envname, '=')) { errno = EINVAL; return -1; } - if(overwrite || !getenv(envname)) + if(overwrite || !std::getenv(envname)) SetEnvironmentVariableA(envname, envval); return 0; diff --git a/source/lib/sysdep/os/win/wposix/wposix.h b/source/lib/sysdep/os/win/wposix/wposix.h index a21e87bff7..cbc64c7558 100644 --- a/source/lib/sysdep/os/win/wposix/wposix.h +++ b/source/lib/sysdep/os/win/wposix/wposix.h @@ -54,17 +54,4 @@ int setenv(const char* envname, const char* envval, int overwrite); - -// -// -// - -// (missing on MSVC) -#ifndef INFINITY -#define INFINITY (std::numeric_limits::infinity()) -#endif -#ifndef NAN -#define NAN (std::numeric_limits::quiet_NaN()) -#endif - #endif // #ifndef INCLUDED_WPOSIX diff --git a/source/scriptinterface/tests/test_ScriptConversions.h b/source/scriptinterface/tests/test_ScriptConversions.h index 482ae99f56..7dea78522c 100644 --- a/source/scriptinterface/tests/test_ScriptConversions.h +++ b/source/scriptinterface/tests/test_ScriptConversions.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2025 Wildfire Games. +/* Copyright (C) 2026 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -213,7 +213,7 @@ public: float f = 0; JS::RootedValue testNANVal(rq.cx); - Script::ToJSVal(rq, &testNANVal, NAN); + Script::ToJSVal(rq, &testNANVal, std::numeric_limits::quiet_NaN()); TS_ASSERT(Script::FromJSVal(rq, testNANVal, f)); TS_ASSERT(std::isnan(f)); }