From 7ee008e150bc5bcf76082d726f719ee0fdfda982 Mon Sep 17 00:00:00 2001 From: SulfurNitride Date: Wed, 11 Feb 2026 02:37:39 -0600 Subject: Fluorine Manager: full Linux port of Mod Organizer 2 Complete native Linux port with FUSE-based virtual filesystem, Proton/umu-run integration, and Flatpak packaging. Key features: - FUSE VFS replacing Windows USVFS (in-process + standalone helper for Flatpak) - Proton/GE-Proton/umu-run launcher with env var forwarding - Flatpak support (sandbox-aware VFS, NXM handler, umu-run) - Wine prefix management UI - Case-insensitive path resolution for Linux filesystems - QSettings-safe INI handling (avoids Bethesda INI corruption) - Portable instance support with auto-generated launcher scripts Co-Authored-By: Claude Opus 4.6 --- libs/archive/src/compat.h | 87 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 libs/archive/src/compat.h (limited to 'libs/archive/src/compat.h') diff --git a/libs/archive/src/compat.h b/libs/archive/src/compat.h new file mode 100644 index 0000000..65c2ec5 --- /dev/null +++ b/libs/archive/src/compat.h @@ -0,0 +1,87 @@ +/* +Mod Organizer archive handling - Linux compatibility header + +Copyright (C) 2024 MO2 Team. All rights reserved. + +This header provides Windows COM compatibility types for Linux builds. +On Windows, the real Windows headers are used instead. +*/ + +#ifndef ARCHIVE_COMPAT_H +#define ARCHIVE_COMPAT_H + +#ifdef _WIN32 + +#include +#include +#include +#include +#include + +#else // Linux + +#include +#include + +// PropVariantInit / PropVariantClear - map to VariantClear from 7zip SDK +inline HRESULT PropVariantInit(PROPVARIANT* pvar) { + pvar->vt = VT_EMPTY; + return S_OK; +} + +inline HRESULT PropVariantClear(PROPVARIANT* pvar) { + return VariantClear(pvar); +} + +// A minimal CComPtr replacement for Linux +template +class CComPtr +{ +public: + CComPtr() : p(nullptr) {} + CComPtr(T* lp) : p(lp) { if (p) p->AddRef(); } + CComPtr(const CComPtr& other) : p(other.p) { if (p) p->AddRef(); } + ~CComPtr() { Release(); } + + CComPtr& operator=(T* lp) { + if (lp) lp->AddRef(); + Release(); + p = lp; + return *this; + } + + CComPtr& operator=(const CComPtr& other) { + if (this != &other) { + if (other.p) other.p->AddRef(); + Release(); + p = other.p; + } + return *this; + } + + void Release() { + if (p) { + p->Release(); + p = nullptr; + } + } + + T* Detach() { + T* pt = p; + p = nullptr; + return pt; + } + + operator T*() const { return p; } + T* operator->() const { return p; } + T** operator&() { return &p; } + bool operator!() const { return p == nullptr; } + bool operator==(std::nullptr_t) const { return p == nullptr; } + bool operator!=(std::nullptr_t) const { return p != nullptr; } + + T* p; +}; + +#endif // _WIN32 + +#endif // ARCHIVE_COMPAT_H -- cgit v1.3.1