From 52c304ecae2829cab8bf10bdebbeff83f0a963f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Thu, 23 Feb 2023 11:13:50 +0800 Subject: [PATCH 01/11] IO (Linux): add detailed error messages for ffProcessAppendStdOut --- src/common/io/io.h | 19 +++++++++++++++++++ src/common/processing_linux.c | 19 +++++++++++++++---- 2 files changed, 34 insertions(+), 4 deletions(-) diff --git a/src/common/io/io.h b/src/common/io/io.h index ca800dbe65..ed8d38b108 100644 --- a/src/common/io/io.h +++ b/src/common/io/io.h @@ -101,4 +101,23 @@ static inline void ffUnsuppressIO(bool* suppressed) void ffListFilesRecursively(const char* path); +static inline bool wrapClose(FFNativeFD* pfd) +{ + assert(pfd); + + #ifndef WIN32 + if (*pfd < 0) + return false; + close(*pfd); + #else + // https://devblogs.microsoft.com/oldnewthing/20040302-00/?p=40443 + if (*pfd == NULL || *pfd == INVALID_HANDLE_VALUE) + return false; + CloseHandle(*pfd); + #endif + + return true; +} +#define FF_AUTO_CLOSE_FD __attribute__((__cleanup__(wrapClose))) + #endif // FF_INCLUDED_common_io_io diff --git a/src/common/processing_linux.c b/src/common/processing_linux.c index 74502ef521..b9bf20c1b7 100644 --- a/src/common/processing_linux.c +++ b/src/common/processing_linux.c @@ -30,9 +30,20 @@ const char* ffProcessAppendStdOut(FFstrbuf* buffer, char* const argv[]) //Parent close(pipes[1]); - waitpid(childPid, NULL, 0); - bool ok = ffAppendFDBuffer(pipes[0], buffer); - close(pipes[0]); - return ok ? NULL : "ffAppendFDBuffer() failed"; + int FF_AUTO_CLOSE_FD childPipeFd = pipes[0]; + int status = -1; + if(waitpid(childPid, &status, 0) < 0) + return "waitpid(childPid, &status, 0) failed"; + + if (!WIFEXITED(status)) + return "WIFEXITED(status) == false"; + + if(WEXITSTATUS(status) == 901) + return "WEXITSTATUS(status) == 901 ( execvp failed )"; + + if(!ffAppendFDBuffer(childPipeFd, buffer)) + return "ffAppendFDBuffer(childPipeFd, buffer) failed"; + + return NULL; } From c570c5bf970cb5c1eb247ea14947384594f75d95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Thu, 23 Feb 2023 13:58:39 +0800 Subject: [PATCH 02/11] IO: use FF_AUTO_CLOSE_FD --- src/common/io/io_unix.c | 24 ++++++------------------ src/common/io/io_windows.c | 28 +++++++--------------------- 2 files changed, 13 insertions(+), 39 deletions(-) diff --git a/src/common/io/io_unix.c b/src/common/io/io_unix.c index 12afb7bc20..420e4374e1 100644 --- a/src/common/io/io_unix.c +++ b/src/common/io/io_unix.c @@ -27,7 +27,7 @@ bool ffWriteFileData(const char* fileName, size_t dataSize, const void* data) int openFlagsModes = O_WRONLY | O_CREAT | O_TRUNC; int openFlagsRights = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH; - int fd = open(fileName, openFlagsModes, openFlagsRights); + int FF_AUTO_CLOSE_FD fd = open(fileName, openFlagsModes, openFlagsRights); if(fd == -1) { createSubfolders(fileName); @@ -36,11 +36,7 @@ bool ffWriteFileData(const char* fileName, size_t dataSize, const void* data) return false; } - bool ret = write(fd, data, dataSize) != -1; - - close(fd); - - return ret; + return write(fd, data, dataSize) > 0; } bool ffAppendFDBuffer(int fd, FFstrbuf* buffer) @@ -77,28 +73,20 @@ bool ffAppendFDBuffer(int fd, FFstrbuf* buffer) ssize_t ffReadFileData(const char* fileName, size_t dataSize, void* data) { - int fd = open(fileName, O_RDONLY); + int FF_AUTO_CLOSE_FD fd = open(fileName, O_RDONLY); if(fd == -1) return -1; - ssize_t readed = ffReadFDData(fd, dataSize, data); - - close(fd); - - return readed; + return ffReadFDData(fd, dataSize, data); } bool ffAppendFileBuffer(const char* fileName, FFstrbuf* buffer) { - int fd = open(fileName, O_RDONLY); + int FF_AUTO_CLOSE_FD fd = open(fileName, O_RDONLY); if(fd == -1) return false; - bool ret = ffAppendFDBuffer(fd, buffer); - - close(fd); - - return ret; + return ffAppendFDBuffer(fd, buffer); } bool ffPathExists(const char* path, FFPathType type) diff --git a/src/common/io/io_windows.c b/src/common/io/io_windows.c index 152c7c9a47..78cdad7404 100644 --- a/src/common/io/io_windows.c +++ b/src/common/io/io_windows.c @@ -2,7 +2,7 @@ static void createSubfolders(const char* fileName) { - FFstrbuf path; + FF_STRBUF_AUTO_DESTROY path; ffStrbufInit(&path); while(*fileName != '\0') @@ -12,13 +12,11 @@ static void createSubfolders(const char* fileName) CreateDirectoryA(path.chars, NULL); ++fileName; } - - ffStrbufDestroy(&path); } bool ffWriteFileData(const char* fileName, size_t dataSize, const void* data) { - HANDLE handle = CreateFileA(fileName, GENERIC_WRITE, FILE_SHARE_WRITE, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); + HANDLE FF_AUTO_CLOSE_FD handle = CreateFileA(fileName, GENERIC_WRITE, FILE_SHARE_WRITE, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); if(handle == INVALID_HANDLE_VALUE) { createSubfolders(fileName); @@ -28,11 +26,7 @@ bool ffWriteFileData(const char* fileName, size_t dataSize, const void* data) } DWORD written; - bool ret = !!WriteFile(handle, data, (DWORD)dataSize, &written, NULL); - - CloseHandle(handle); - - return ret; + return !!WriteFile(handle, data, (DWORD)dataSize, &written, NULL); } bool ffAppendFDBuffer(HANDLE handle, FFstrbuf* buffer) @@ -69,28 +63,20 @@ bool ffAppendFDBuffer(HANDLE handle, FFstrbuf* buffer) ssize_t ffReadFileData(const char* fileName, size_t dataSize, void* data) { - HANDLE handle = CreateFileA(fileName, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + HANDLE FF_AUTO_CLOSE_FD handle = CreateFileA(fileName, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); if(handle == INVALID_HANDLE_VALUE) return -1; - ssize_t readed = ffReadFDData(handle, dataSize, data); - - CloseHandle(handle); - - return readed; + return ffReadFDData(handle, dataSize, data); } bool ffAppendFileBuffer(const char* fileName, FFstrbuf* buffer) { - HANDLE handle = CreateFileA(fileName, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + HANDLE FF_AUTO_CLOSE_FD handle = CreateFileA(fileName, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); if(handle == INVALID_HANDLE_VALUE) return false; - bool ret = ffAppendFDBuffer(handle, buffer); - - CloseHandle(handle); - - return ret; + return ffAppendFDBuffer(handle, buffer); } bool ffPathExists(const char* path, FFPathType type) From 7f15f91bd3cbc7f26f56b4159737ae7eca593d03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Thu, 23 Feb 2023 21:31:33 +0800 Subject: [PATCH 03/11] Temps (Windows): dirty support Note: https://stackoverflow.com/a/17083409 --- CMakeLists.txt | 1 + src/detection/cpu/cpu_windows.c | 4 ++++ src/detection/temps/temps_windows.cpp | 25 +++++++++++++++++++++++++ src/detection/temps/temps_windows.h | 8 ++++++++ 4 files changed, 38 insertions(+) create mode 100644 src/detection/temps/temps_windows.cpp create mode 100644 src/detection/temps/temps_windows.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 0d1e281525..31bfcac0a4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -519,6 +519,7 @@ elseif(WIN32) src/detection/swap/swap_windows.cpp src/detection/terminalfont/terminalfont_windows.c src/detection/terminalshell/terminalshell_windows.cpp + src/detection/temps/temps_windows.cpp src/detection/uptime/uptime_windows.c src/detection/users/users_windows.c src/detection/wifi/wifi_windows.c diff --git a/src/detection/cpu/cpu_windows.c b/src/detection/cpu/cpu_windows.c index 84af8ecfb7..05116870f4 100644 --- a/src/detection/cpu/cpu_windows.c +++ b/src/detection/cpu/cpu_windows.c @@ -1,4 +1,5 @@ #include "cpu.h" +#include "detection/temps/temps_windows.h" #include "util/windows/registry.h" #include "util/mallocHelper.h" @@ -46,4 +47,7 @@ void ffDetectCPUImpl(const FFinstance* instance, FFCPUResult* cpu) ffRegReadStrbuf(hKey, L"ProcessorNameString", &cpu->name, NULL); ffRegReadStrbuf(hKey, L"VendorIdentifier", &cpu->vendor, NULL); + + if(instance->config.cpuTemp) + ffDetectSmbiosTemp(&cpu->temperature, NULL); } diff --git a/src/detection/temps/temps_windows.cpp b/src/detection/temps/temps_windows.cpp new file mode 100644 index 0000000000..9c741b4cd5 --- /dev/null +++ b/src/detection/temps/temps_windows.cpp @@ -0,0 +1,25 @@ +extern "C" +{ +#include "temps_windows.h" +} +#include "util/windows/wmi.hpp" + +extern "C" +const char* ffDetectSmbiosTemp(double* current, double* critical) +{ + // Requires Administrator priviledges + // https://wutils.com/wmi/root/wmi/msacpi_thermalzonetemperature/#properties + FFWmiQuery query(L"SELECT CurrentTemperature, CriticalTripPoint FROM MSAcpi_ThermalZoneTemperature WHERE Active = TRUE", nullptr, FFWmiNamespace::WMI); + if(!query) + return "Query WMI service failed"; + + if(FFWmiRecord record = query.next()) + { + if (current && record.getReal(L"CurrentTemperature", current)) // In tenth of degrees Kelvin + *current = *current / 10 - 273.15; + if (critical && record.getReal(L"CriticalTripPoint", critical)) // In tenth of degrees Kelvin + *critical = *critical / 10 - 273.15; + } + + return "No WMI result returned"; +} diff --git a/src/detection/temps/temps_windows.h b/src/detection/temps/temps_windows.h new file mode 100644 index 0000000000..57e27ba5ad --- /dev/null +++ b/src/detection/temps/temps_windows.h @@ -0,0 +1,8 @@ +#pragma once + +#ifndef FF_INCLUDED_detection_temps_windows +#define FF_INCLUDED_detection_temps_windows + +const char* ffDetectSmbiosTemp(double* current, double* critical); + +#endif From de72c98a28ffadf7bad8e5738cf4a614ebb1ae01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Fri, 24 Feb 2023 17:45:04 +0800 Subject: [PATCH 04/11] Init: don't create detection thread for displayserver on Windows / macOS Displayserver (mainly resolutions) detection is cheap on win / mac, but creating an detection thread is unnecessary --- src/common/init.c | 31 ++++++++++--------------------- 1 file changed, 10 insertions(+), 21 deletions(-) diff --git a/src/common/init.c b/src/common/init.c index 90970089aa..ca9cf7c699 100644 --- a/src/common/init.c +++ b/src/common/init.c @@ -212,42 +212,29 @@ void ffInitInstance(FFinstance* instance) defaultConfig(instance); } -#ifdef FF_HAVE_THREADS - -FF_THREAD_ENTRY_DECL_WRAPPER(ffConnectDisplayServer, FFinstance*) - -#if !(defined(__APPLE__) || defined(_WIN32)) +#if defined(FF_HAVE_THREADS) && !(defined(__APPLE__) || defined(_WIN32) || defined(__ANDROID__)) #include "detection/gtk_qt/gtk_qt.h" -#define FF_DETECT_QT_GTK 1 +#define FF_START_DETECTION_THREADS +FF_THREAD_ENTRY_DECL_WRAPPER(ffConnectDisplayServer, FFinstance*) FF_THREAD_ENTRY_DECL_WRAPPER(ffDetectQt, FFinstance*) FF_THREAD_ENTRY_DECL_WRAPPER(ffDetectGTK2, FFinstance*) FF_THREAD_ENTRY_DECL_WRAPPER(ffDetectGTK3, FFinstance*) FF_THREAD_ENTRY_DECL_WRAPPER(ffDetectGTK4, FFinstance*) -#endif //!(defined(__APPLE__) || defined(_WIN32)) - -#endif //FF_HAVE_THREADS - void startDetectionThreads(FFinstance* instance) { - #ifdef FF_HAVE_THREADS ffThreadDetach(ffThreadCreate(ffConnectDisplayServerThreadMain, instance)); - - #ifdef FF_DETECT_QT_GTK ffThreadDetach(ffThreadCreate(ffDetectQtThreadMain, instance)); ffThreadDetach(ffThreadCreate(ffDetectGTK2ThreadMain, instance)); ffThreadDetach(ffThreadCreate(ffDetectGTK3ThreadMain, instance)); ffThreadDetach(ffThreadCreate(ffDetectGTK4ThreadMain, instance)); - #endif - - #else - FF_UNUSED(instance); - #endif } +#endif //FF_HAVE_THREADS + static volatile bool ffDisableLinewrap = true; static volatile bool ffHideCursor = true; @@ -268,7 +255,7 @@ static void resetConsole() BOOL WINAPI consoleHandler(DWORD signal) { FF_UNUSED(signal); - resetConsole(); + resetConsole(); exit(0); } #else @@ -282,8 +269,10 @@ static void exitSignalHandler(int signal) void ffStart(FFinstance* instance) { - if(instance->config.multithreading) - startDetectionThreads(instance); + #ifdef FF_START_DETECTION_THREADS + if(instance->config.multithreading) + startDetectionThreads(instance); + #endif ffDisableLinewrap = instance->config.disableLinewrap && !instance->config.pipe; ffHideCursor = instance->config.hideCursor && !instance->config.pipe; From e953ea65420e2eb043a522bd40c2a211f89a2941 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Fri, 24 Feb 2023 17:45:50 +0800 Subject: [PATCH 05/11] Android: enable mutltithreading public-ip / weather detection --- CMakeLists.txt | 2 +- src/fastfetch.c | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 31bfcac0a4..65465def34 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -71,7 +71,7 @@ cmake_dependent_option(ENABLE_LIBCJSON "Enable libcjson" ON "LINUX OR WIN32" OFF cmake_dependent_option(ENABLE_LIBNM "Enable libnm" ON "LINUX" OFF) cmake_dependent_option(ENABLE_FREETYPE "Enable freetype" ON "ANDROID" OFF) cmake_dependent_option(ENABLE_PULSE "Enable pulse" ON "LINUX OR BSD" OFF) -cmake_dependent_option(ENABLE_THREADS "Enable multithreading" ON "Threads_FOUND AND NOT ANDROID" OFF) +cmake_dependent_option(ENABLE_THREADS "Enable multithreading" ON "Threads_FOUND" OFF) cmake_dependent_option(ENABLE_BUFFER "Enable stdout buffer" ON "LINUX OR APPLE OR BSD OR WIN32 OR ANDROID" OFF) cmake_dependent_option(USE_WIN_NTAPI "Allow using internal NTAPI" ON "WIN32" OFF) diff --git a/src/fastfetch.c b/src/fastfetch.c index deebe41d8c..cc08fe5a10 100644 --- a/src/fastfetch.c +++ b/src/fastfetch.c @@ -1527,11 +1527,14 @@ int main(int argc, const char** argv) if(ffStrbufContainIgnCaseS(&data.structure, "CPUUsage")) ffPrepareCPUUsage(); - if(ffStrbufContainIgnCaseS(&data.structure, "PublicIp")) - ffPreparePublicIp(&instance); + if(instance.config.multithreading) + { + if(ffStrbufContainIgnCaseS(&data.structure, "PublicIp")) + ffPreparePublicIp(&instance); - if(ffStrbufContainIgnCaseS(&data.structure, "Weather")) - ffPrepareWeather(&instance); + if(ffStrbufContainIgnCaseS(&data.structure, "Weather")) + ffPrepareWeather(&instance); + } ffStart(&instance); From 4f28ae62a7f4a9546b5a594f9226614a3141d2dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Fri, 24 Feb 2023 17:47:27 +0800 Subject: [PATCH 06/11] Font: don't depend on displayserver detection on Windows and macOS. --- src/detection/font/font_linux.c | 9 +++++++++ src/modules/font.c | 8 -------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/detection/font/font_linux.c b/src/detection/font/font_linux.c index ae2f033314..1e51116f34 100644 --- a/src/detection/font/font_linux.c +++ b/src/detection/font/font_linux.c @@ -1,9 +1,18 @@ #include "common/font.h" +#include "detection/displayserver/displayserver.h" #include "detection/gtk_qt/gtk_qt.h" #include "font.h" void ffDetectFontImpl(const FFinstance* instance, FFFontResult* result) { + const FFDisplayServerResult* wmde = ffConnectDisplayServer(instance); + + if(ffStrbufIgnCaseCompS(&wmde->wmProtocolName, FF_WM_PROTOCOL_TTY) == 0) + { + ffStrbufAppendS(&result->error, "Font isn't supported in TTY"); + return; + } + FFfont qt; ffFontInitQt(&qt, ffDetectQt(instance)->font.chars); ffStrbufAppend(&result->fonts[0], &qt.pretty); diff --git a/src/modules/font.c b/src/modules/font.c index 29d3fac15c..3d6f91e379 100644 --- a/src/modules/font.c +++ b/src/modules/font.c @@ -75,14 +75,6 @@ void ffPrintFont(FFinstance* instance) { assert(FF_DETECT_FONT_NUM_FONTS == FF_FONT_NUM_FORMAT_ARGS); - const FFDisplayServerResult* wmde = ffConnectDisplayServer(instance); - - if(ffStrbufIgnCaseCompS(&wmde->wmProtocolName, FF_WM_PROTOCOL_TTY) == 0) - { - ffPrintError(instance, FF_FONT_MODULE_NAME, 0, &instance->config.font, "Font isn't supported in TTY"); - return; - } - const FFFontResult* font = ffDetectFont(instance); if(font->error.length > 0) From 09ccbca79c496be410a0d6246a0ec8896d430ca5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Fri, 24 Feb 2023 17:48:09 +0800 Subject: [PATCH 07/11] WmTheme (Apple): don't depend on displayserver detection --- src/detection/wmtheme/wmtheme_apple.m | 23 +---------------------- src/detection/wmtheme/wmtheme_nosupport.c | 1 - 2 files changed, 1 insertion(+), 23 deletions(-) diff --git a/src/detection/wmtheme/wmtheme_apple.m b/src/detection/wmtheme/wmtheme_apple.m index 437d6ed971..817a2cd652 100644 --- a/src/detection/wmtheme/wmtheme_apple.m +++ b/src/detection/wmtheme/wmtheme_apple.m @@ -1,13 +1,10 @@ #include "fastfetch.h" -#include "detection/displayserver/displayserver.h" #include "wmtheme.h" #import -static bool detectQuartzCompositor(FFinstance* instance, FFstrbuf* themeOrError) +bool ffDetectWmTheme(FF_MAYBE_UNUSED FFinstance* instance, FFstrbuf* themeOrError) { - FF_UNUSED(instance); - NSError* error; NSString* fileName = [NSString stringWithFormat:@"file://%s/Library/Preferences/.GlobalPreferences.plist", instance->state.platform.homeDir.chars]; NSDictionary* dict = [NSDictionary dictionaryWithContentsOfURL:[NSURL URLWithString:fileName] @@ -41,21 +38,3 @@ static bool detectQuartzCompositor(FFinstance* instance, FFstrbuf* themeOrError) ffStrbufAppendF(themeOrError, " (%s)", wmTheme ? wmTheme.UTF8String : "Light"); return true; } - -bool ffDetectWmTheme(FFinstance* instance, FFstrbuf* themeOrError) -{ - const FFDisplayServerResult* wm = ffConnectDisplayServer(instance); - - if(wm->wmPrettyName.length == 0) - { - ffStrbufAppendS(themeOrError, "WM Theme needs sucessfull WM detection"); - return false; - } - - if(ffStrbufIgnCaseCompS(&wm->wmPrettyName, "Quartz Compositor") == 0) - return detectQuartzCompositor(instance, themeOrError); - - ffStrbufAppendS(themeOrError, "Unknown WM: "); - ffStrbufAppend(themeOrError, &wm->dePrettyName); - return false; -} diff --git a/src/detection/wmtheme/wmtheme_nosupport.c b/src/detection/wmtheme/wmtheme_nosupport.c index 5dc5691d34..1f1dca61cf 100644 --- a/src/detection/wmtheme/wmtheme_nosupport.c +++ b/src/detection/wmtheme/wmtheme_nosupport.c @@ -1,5 +1,4 @@ #include "fastfetch.h" -#include "detection/displayserver/displayserver.h" #include "wmtheme.h" bool ffDetectWmTheme(FFinstance* instance, FFstrbuf* themeOrError) From 47cec48a491e564634db5e23254002471f3e8e51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Sat, 25 Feb 2023 13:30:01 +0800 Subject: [PATCH 08/11] GPU (Windows): fix uninited variables --- src/detection/gpu/gpu_windows.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/detection/gpu/gpu_windows.cpp b/src/detection/gpu/gpu_windows.cpp index 0ff1ad43cb..cb7b57a7f3 100644 --- a/src/detection/gpu/gpu_windows.cpp +++ b/src/detection/gpu/gpu_windows.cpp @@ -102,7 +102,7 @@ static const char* detectWithDxgi(FFlist* gpus) continue; FFGPUResult* gpu = (FFGPUResult*)ffListAdd(gpus); - gpu->dedicated.total = gpu->dedicated.total = gpu->shared.total = gpu->shared.used = FF_GPU_VMEM_SIZE_UNSET; + gpu->dedicated.total = gpu->dedicated.used = gpu->shared.total = gpu->shared.used = FF_GPU_VMEM_SIZE_UNSET; ffStrbufInit(&gpu->vendor); ffStrbufAppendS(&gpu->vendor, ffGetGPUVendorString(desc.VendorId)); From b66338494f6464ff7cebd99dccf8bff2eecae816 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Sat, 25 Feb 2023 13:30:31 +0800 Subject: [PATCH 09/11] CMake: fix compile error on Windows --- CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 65465def34..d03f42e343 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -117,7 +117,11 @@ if(NOT WIN32) set(FASTFETCH_FLAGS_DEBUG "${FASTFETCH_FLAGS_DEBUG} -fsanitize=address -fsanitize=undefined") endif() set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${FASTFETCH_FLAGS_DEBUG}") -set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} ${FASTFETCH_FLAGS_DEBUG} -rdynamic") +set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} ${FASTFETCH_FLAGS_DEBUG}") +if(NOT WIN32) + set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -rdynamic") +endif() + if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug") include(CheckIPOSupported) From 6b0add44eeb90be984eb393e838cbe4a226facda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Sat, 25 Feb 2023 15:29:12 +0800 Subject: [PATCH 10/11] Init: print `threads` for `--list-features` if supported --- src/common/init.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/common/init.c b/src/common/init.c index ca9cf7c699..04c0d5b7bf 100644 --- a/src/common/init.c +++ b/src/common/init.c @@ -439,6 +439,9 @@ void ffDestroyInstance(FFinstance* instance) void ffListFeatures() { fputs( + #ifdef FF_HAVE_THREADS + "threads\n" + #endif #ifdef FF_HAVE_LIBPCI "libpci\n" #endif From b19d8d67008dfcb88b0255fe63659a250a5baf33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Sat, 25 Feb 2023 16:06:16 +0800 Subject: [PATCH 11/11] Release: 1.10.3 --- CHANGELOG.md | 9 +++++++++ CMakeLists.txt | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a90abc86ed..7864da0a8f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +# 1.10.3 +Bugfixes: +* Fix uninitialized variables (GPU, Windows) +* Fix compiling errors (Windows) + +Improvements: +* Improve preformance (WmTheme amd Font, Windows and macOS) +* Enable nonblocking public-ip / weather detection (Android) + # 1.10.2 Bugfixes: diff --git a/CMakeLists.txt b/CMakeLists.txt index d03f42e343..56bcf6c21f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.12.0) # target_link_libraries with OBJECT libs & project homepage url project(fastfetch - VERSION 1.10.2 + VERSION 1.10.3 LANGUAGES C DESCRIPTION "Fast system information tool" HOMEPAGE_URL "https://github.com/LinusDierheimer/fastfetch"