Global: fixes -ffast-math compatibility

Unifies unset double handling using `-DBL_MAX` sentinel

Fixes #1894
This commit is contained in:
李通洲
2025-08-14 09:47:14 +08:00
parent 7446828866
commit 61f2823903
33 changed files with 119 additions and 84 deletions
+2 -2
View File
@@ -3,11 +3,11 @@
#include "fastfetch.h"
#include "modules/gpu/option.h"
#define FF_GPU_TEMP_UNSET (0/0.0)
#define FF_GPU_TEMP_UNSET (-DBL_MAX)
#define FF_GPU_CORE_COUNT_UNSET -1
#define FF_GPU_VMEM_SIZE_UNSET ((uint64_t)-1)
#define FF_GPU_FREQUENCY_UNSET 0
#define FF_GPU_CORE_USAGE_UNSET (0/0.0)
#define FF_GPU_CORE_USAGE_UNSET (-DBL_MAX)
#define FF_GPU_INDEX_UNSET ((uint32_t)-1)
extern const char* FF_GPU_VENDOR_NAME_APPLE;
+1 -1
View File
@@ -411,7 +411,7 @@ const char* ffDetectGPUImpl(FF_MAYBE_UNUSED const FFGPUOptions* options, FFlist*
FF_DEBUG("Failed to open adapter from LUID");
}
if (options->temp && gpu->temperature != gpu->temperature)
if (options->temp && gpu->temperature == FF_GPU_TEMP_UNSET)
{
FF_DEBUG("Trying to get GPU temperature");
D3DKMT_QUERYSTATISTICS queryStatistics = {