mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-13 02:42:09 +02:00
Windows: fix <Windows.h> header mess
This commit is contained in:
+3
-1
@@ -542,7 +542,9 @@ add_library(libfastfetch OBJECT
|
||||
)
|
||||
|
||||
target_compile_definitions(libfastfetch PUBLIC _GNU_SOURCE)
|
||||
target_compile_definitions(libfastfetch PUBLIC YYJSON_DISABLE_WRITER=1)
|
||||
if(WIN32)
|
||||
target_compile_definitions(libfastfetch PUBLIC WIN32_LEAN_AND_MEAN=1)
|
||||
endif()
|
||||
|
||||
CHECK_INCLUDE_FILE("utmpx.h" HAVE_UTMPX_H)
|
||||
if(HAVE_UTMPX_H)
|
||||
|
||||
+1
-2
@@ -8,9 +8,8 @@
|
||||
#include <unistd.h>
|
||||
#include <sys/stat.h>
|
||||
#ifdef _WIN32
|
||||
#include <wincon.h>
|
||||
#include <windows.h>
|
||||
#include <locale.h>
|
||||
#include <shlobj.h>
|
||||
#include "util/windows/unicode.h"
|
||||
#else
|
||||
#include <signal.h>
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <fileapi.h>
|
||||
#include <handleapi.h>
|
||||
#include <io.h>
|
||||
typedef HANDLE FFNativeFD;
|
||||
#else
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#include "fastfetch.h"
|
||||
#include "common/processing.h"
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN 1
|
||||
#include <Windows.h>
|
||||
|
||||
const char* ffProcessAppendStdOut(FFstrbuf* buffer, char* const argv[])
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@
|
||||
}
|
||||
#define FF_THREAD_ENTRY_DECL_WRAPPER(fn, paramType) static __stdcall unsigned fn ## ThreadMain (void* data) { fn((paramType)data); return 0; }
|
||||
static inline void ffThreadDetach(FFThreadType thread) { CloseHandle(thread); }
|
||||
static inline void ffThreadJoin(FFThreadType thread) { WaitForSingleObject(thread, INFINITE); }
|
||||
static inline void ffThreadJoin(FFThreadType thread) { WaitForSingleObject(thread, 0xffffffff /*INFINITE*/); }
|
||||
#else
|
||||
#include <pthread.h>
|
||||
#define FF_THREAD_MUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER
|
||||
|
||||
@@ -2,11 +2,12 @@
|
||||
#include "util/windows/unicode.h"
|
||||
#include "util/mallocHelper.h"
|
||||
|
||||
#undef WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#include <setupapi.h>
|
||||
#include <batclass.h>
|
||||
#include <devguid.h>
|
||||
#include <winternl.h>
|
||||
#include <powrprof.h>
|
||||
|
||||
#ifdef FF_USE_WIN_NTAPI
|
||||
NTSYSCALLAPI
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "bluetooth.h"
|
||||
#include "util/windows/unicode.h"
|
||||
|
||||
#include <windows.h>
|
||||
#include <bluetoothapis.h>
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include "disk.h"
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN 1
|
||||
#include <windows.h>
|
||||
|
||||
void ffDetectDisksImpl(FFDiskResult* disks)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "font.h"
|
||||
#include "util/windows/unicode.h"
|
||||
|
||||
#include <winuser.h>
|
||||
#include <windows.h>
|
||||
|
||||
void ffDetectFontImpl(const FFinstance* instance, FFFontResult* result)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#include "memory.h"
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
void ffDetectMemory(FFMemoryStorage* ram)
|
||||
{
|
||||
MEMORYSTATUSEX statex = {
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
#include "common/printing.h"
|
||||
#include "opengl.h"
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN 1
|
||||
#include <Windows.h>
|
||||
#include <GL/gl.h>
|
||||
#ifndef GL_SHADING_LANGUAGE_VERSION // For WGL
|
||||
|
||||
@@ -7,6 +7,7 @@ extern "C" {
|
||||
|
||||
#include <winternl.h>
|
||||
#include <ntstatus.h>
|
||||
#include <windows.h>
|
||||
|
||||
extern "C"
|
||||
void ffDetectSwap(FFMemoryStorage* swap)
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include "terminalfont.h"
|
||||
#include "util/windows/unicode.h"
|
||||
|
||||
#include <wincon.h>
|
||||
#include <windows.h>
|
||||
|
||||
static void detectMintty(const FFinstance* instance, FFTerminalFontResult* terminalFont)
|
||||
{
|
||||
|
||||
@@ -5,7 +5,7 @@ extern "C" {
|
||||
#include "util/mallocHelper.h"
|
||||
}
|
||||
|
||||
#include <processthreadsapi.h>
|
||||
#include <windows.h>
|
||||
#include <wchar.h>
|
||||
#include <tlhelp32.h>
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include "uptime.h"
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <sysinfoapi.h>
|
||||
|
||||
uint64_t ffDetectUptime()
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "users.h"
|
||||
#include "util/windows/unicode.h"
|
||||
|
||||
#include <windows.h>
|
||||
#include <wtsapi32.h>
|
||||
|
||||
void ffDetectUsers(FFlist* users, FFstrbuf* error)
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include "common/library.h"
|
||||
#include "util/windows/unicode.h"
|
||||
|
||||
#include <windows.h>
|
||||
#include <wlanapi.h>
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
|
||||
+2
-1
@@ -14,7 +14,8 @@
|
||||
#include <assert.h>
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <shlwapi.h>
|
||||
// #include <shlwapi.h>
|
||||
__stdcall const char* StrStrIA(const char* lpFirst, const char* lpSrch);
|
||||
#define strcasestr StrStrIA
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#include "FFPlatform_private.h"
|
||||
#include "util/stringUtils.h"
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <Windows.h>
|
||||
#include <shlobj.h>
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
#include "fastfetch.h"
|
||||
|
||||
#include <winreg.h>
|
||||
#include <windows.h>
|
||||
|
||||
static inline void wrapRegCloseKey(HKEY* phKey)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#include "unicode.h"
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
void ffStrbufSetNWS(FFstrbuf* result, uint32_t length, const wchar_t* source)
|
||||
{
|
||||
if(!length)
|
||||
|
||||
Reference in New Issue
Block a user