mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-10-30 09:33:39 +01:00
MSYS2: remove support
MSYS2 version was built for smooth transition from POSIX api to Win32 api. It has almost identical output as Windows native version, except requiring msys runtime dll and being a bit slower.
This commit is contained in:
+2
-2
@@ -285,7 +285,7 @@ void ffInitInstance(FFinstance* instance)
|
||||
|
||||
FF_THREAD_ENTRY_DECL_WRAPPER(ffConnectDisplayServer, FFinstance*)
|
||||
|
||||
#if !(defined(__APPLE__) || defined(__MSYS__) || defined(_WIN32))
|
||||
#if !(defined(__APPLE__) || defined(_WIN32))
|
||||
|
||||
#define FF_DETECT_QT_GTK 1
|
||||
|
||||
@@ -294,7 +294,7 @@ 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(__MSYS__) || defined(_WIN32))
|
||||
#endif //!(defined(__APPLE__) || defined(_WIN32))
|
||||
|
||||
#endif //FF_HAVE_THREADS
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ static void* libraryLoad(const char* path, int maxVersion)
|
||||
{
|
||||
void* result = dlopen(path, FF_DLOPEN_FLAGS);
|
||||
|
||||
#if defined(_WIN32) || defined(__MSYS__)
|
||||
#ifdef _WIN32
|
||||
|
||||
// libX.dll.1 never exists on Windows, while libX-1.dll may exist
|
||||
FF_UNUSED(maxVersion)
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#include <dlfcn.h>
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32) || defined(__MSYS__)
|
||||
#ifdef _WIN32
|
||||
#define FF_LIBRARY_EXTENSION ".dll"
|
||||
#elif defined(__APPLE__)
|
||||
#define FF_LIBRARY_EXTENSION ".dylib"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#if defined(_WIN32) || defined(__MSYS__)
|
||||
#ifdef _WIN32
|
||||
#include <winsock2.h>
|
||||
#include <ws2tcpip.h>
|
||||
#include <synchapi.h>
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
FFSockType ffNetworkingSendHttpRequest(const char* host, const char* path, const char* headers, uint32_t timeout)
|
||||
{
|
||||
#if defined(_WIN32) || defined(__MSYS__)
|
||||
#ifdef _WIN32
|
||||
static INIT_ONCE once = INIT_ONCE_STATIC_INIT;
|
||||
WSADATA* pData;
|
||||
if(!InitOnceExecuteOnce(&once, initWsaData, NULL, (LPVOID*) &pData))
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
#include "util/FFstrbuf.h"
|
||||
|
||||
#if defined(_WIN32) || defined(__MSYS__)
|
||||
#ifdef _WIN32
|
||||
typedef uintptr_t FFSockType; //SOCKET, unsigned
|
||||
#ifndef INVALID_SOCKET //Don't conflict with <winsock2.h>
|
||||
#define INVALID_SOCKET ((uintptr_t)~0)
|
||||
|
||||
+3
-3
@@ -4,7 +4,7 @@
|
||||
#define FF_INCLUDED_common_time
|
||||
|
||||
#include <stdint.h>
|
||||
#if defined(_WIN32) || defined(__MSYS__)
|
||||
#ifdef _WIN32
|
||||
#include <synchapi.h>
|
||||
#include <sysinfoapi.h>
|
||||
#else
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
static inline uint64_t ffTimeGetTick() //In msec
|
||||
{
|
||||
#if defined(_WIN32) || defined(__MSYS__)
|
||||
#ifdef _WIN32
|
||||
return GetTickCount64();
|
||||
#else
|
||||
struct timeval timeNow;
|
||||
@@ -25,7 +25,7 @@ static inline uint64_t ffTimeGetTick() //In msec
|
||||
|
||||
static inline void ffTimeSleep(uint32_t msec)
|
||||
{
|
||||
#if defined(_WIN32) || defined(__MSYS__)
|
||||
#ifdef _WIN32
|
||||
SleepEx(msec, TRUE);
|
||||
#else
|
||||
nanosleep(&(struct timespec){ msec / 1000, (msec % 1000) * 1000000 }, NULL);
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#ifndef FF_INCLUDED_detection_cpu_cpuUsage
|
||||
#define FF_INCLUDED_detection_cpu_cpuUsage
|
||||
|
||||
#if defined(_WIN32) || defined(__MSYS__)
|
||||
#ifdef _WIN32
|
||||
// Disabled by default because the result does need some time to generate
|
||||
#define FF_DETECTION_CPUUSAGE_NOWAIT 0
|
||||
#endif
|
||||
|
||||
@@ -59,11 +59,7 @@ void ffDetectOSImpl(FFOSResult* os, const FFinstance* instance)
|
||||
ffStrbufClear(&os->variant);
|
||||
}
|
||||
|
||||
#ifdef __MSYS__
|
||||
ffStrbufAppendS(&os->id, "MSYS2");
|
||||
#else
|
||||
ffStrbufAppendF(&os->id, "Windows %*s", os->version.length, os->version.chars);
|
||||
#endif
|
||||
ffStrbufAppendF(&os->id, "Windows %*s", os->version.length, os->version.chars);
|
||||
|
||||
ffGetWmiObjString(pclsObj, L"BuildNumber", &os->buildID);
|
||||
ffGetWmiObjString(pclsObj, L"OSArchitecture", &os->architecture);
|
||||
|
||||
@@ -64,7 +64,7 @@ static void detectTTY(FFTerminalFontResult* terminalFont)
|
||||
ffStrbufDestroy(&fontName);
|
||||
}
|
||||
|
||||
#if defined(_WIN32) || defined(__MSYS__) || defined(__linux__)
|
||||
#if defined(_WIN32) || defined(__linux__)
|
||||
#ifdef FF_HAVE_LIBCJSON
|
||||
|
||||
#include "common/library.h"
|
||||
@@ -241,7 +241,7 @@ static void detectFromWindowsTeriminal(const FFinstance* instance, FFTerminalFon
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif //defined(_WIN32) || defined(__MSYS__) || defined(__linux__)
|
||||
#endif //defined(_WIN32) || defined(__linux__)
|
||||
|
||||
void ffDetectTerminalFontPlatform(const FFinstance* instance, const FFTerminalShellResult* terminalShell, FFTerminalFontResult* terminalFont);
|
||||
|
||||
@@ -259,7 +259,7 @@ const FFTerminalFontResult* ffDetectTerminalFont(const FFinstance* instance)
|
||||
else if(ffStrbufStartsWithIgnCaseS(&terminalShell->terminalExe, "/dev/tty"))
|
||||
detectTTY(&result);
|
||||
|
||||
#if defined(_WIN32) || defined(__MSYS__) || defined(__linux__)
|
||||
#if defined(_WIN32) || defined(__linux__)
|
||||
//Used by both Linux (WSL) and Windows
|
||||
else if(ffStrbufIgnCaseCompS(&terminalShell->terminalProcessName, "Windows Terminal") == 0 ||
|
||||
ffStrbufIgnCaseCompS(&terminalShell->terminalProcessName, "WindowsTerminal.exe") == 0)
|
||||
|
||||
@@ -28,7 +28,7 @@ static void getProcessInformation(pid_t pid, FFstrbuf* processName, FFstrbuf* ex
|
||||
assert(processName->length > 0);
|
||||
ffStrbufClear(exe);
|
||||
|
||||
#if defined(__linux__) || defined(__MSYS__)
|
||||
#ifdef __linux__
|
||||
|
||||
char cmdlineFilePath[64];
|
||||
snprintf(cmdlineFilePath, sizeof(cmdlineFilePath), "/proc/%d/cmdline", (int)pid);
|
||||
@@ -61,7 +61,7 @@ static const char* getProcessNameAndPpid(pid_t pid, char* name, pid_t* ppid)
|
||||
{
|
||||
const char* error = NULL;
|
||||
|
||||
#if defined(__linux__) || defined(__MSYS__)
|
||||
#ifdef __linux__
|
||||
|
||||
char statFilePath[64];
|
||||
snprintf(statFilePath, sizeof(statFilePath), "/proc/%d/stat", (int)pid);
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#define FF_CURSOR_MODULE_NAME "Cursor"
|
||||
#define FF_CURSOR_NUM_FORMAT_ARGS 2
|
||||
|
||||
#if !(defined(__ANDROID__) || defined(__APPLE__) || defined(_WIN32) || defined(__MSYS__))
|
||||
#if !(defined(__ANDROID__) || defined(__APPLE__) || defined(_WIN32))
|
||||
|
||||
static void printCursor(FFinstance* instance, FFstrbuf* cursorTheme, const FFstrbuf* cursorSize)
|
||||
{
|
||||
@@ -196,7 +196,7 @@ static bool printCursorFromEnv(FFinstance* instance)
|
||||
|
||||
void ffPrintCursor(FFinstance* instance)
|
||||
{
|
||||
#if defined(__ANDROID__) || defined(__APPLE__) || defined(_WIN32) || defined(__MSYS__)
|
||||
#if defined(__ANDROID__) || defined(__APPLE__) || defined(_WIN32)
|
||||
|
||||
FF_UNUSED(instance);
|
||||
ffPrintError(instance, FF_CURSOR_MODULE_NAME, 0, &instance->config.cursor, "Cursor detection is not supported");
|
||||
|
||||
+1
-1
@@ -41,7 +41,7 @@ static void printFont(const FFFontResult* font)
|
||||
printf("%s [User]", font->fonts[1].chars);
|
||||
}
|
||||
|
||||
#elif defined(_WIN32) || defined(__MSYS__)
|
||||
#elif defined(_WIN32)
|
||||
|
||||
static void printFont(const FFFontResult* font)
|
||||
{
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@
|
||||
|
||||
void ffPrintIcons(FFinstance* instance)
|
||||
{
|
||||
#if defined(__ANDROID__) || defined(__APPLE__) || defined(_WIN32) || defined(__MSYS__)
|
||||
#if defined(__ANDROID__) || defined(__APPLE__) || defined(_WIN32)
|
||||
|
||||
FF_UNUSED(instance);
|
||||
ffPrintError(instance, FF_ICONS_MODULE_NAME, 0, &instance->config.icons, "Icons detection is not supported");
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@
|
||||
|
||||
void ffPrintTheme(FFinstance* instance)
|
||||
{
|
||||
#if defined(__ANDROID__) || defined(__APPLE__) || defined(_WIN32) || defined(__MSYS__)
|
||||
#if defined(__ANDROID__) || defined(__APPLE__) || defined(_WIN32)
|
||||
|
||||
FF_UNUSED(instance);
|
||||
ffPrintError(instance, FF_THEME_MODULE_NAME, 0, &instance->config.theme, "Theme detection is not supported");
|
||||
|
||||
Reference in New Issue
Block a user