mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-12 10:22:12 +02:00
Common (Windows): allows COM be used in C sources
This commit is contained in:
+1
-1
@@ -1033,7 +1033,7 @@ elseif(WIN32)
|
||||
src/common/impl/debug_windows.c
|
||||
src/common/impl/kmod_windows.c
|
||||
src/common/windows/getline.c
|
||||
src/common/windows/com.cpp
|
||||
src/common/windows/com.c
|
||||
src/common/windows/registry.c
|
||||
src/common/windows/unicode.c
|
||||
src/common/windows/variant.cpp
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "com.hpp"
|
||||
#include "com.h"
|
||||
|
||||
#include <roapi.h>
|
||||
|
||||
@@ -1,23 +1,23 @@
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
#include "common/attributes.h"
|
||||
#include <unknwn.h>
|
||||
#include "common/attributes.h"
|
||||
#include <assert.h>
|
||||
#include <unknwn.h>
|
||||
|
||||
// Initialize COM & WinRT
|
||||
const char* ffInitCom(void);
|
||||
|
||||
static inline void ffReleaseComObject(void* ppUnknown) {
|
||||
assert(ppUnknown);
|
||||
IUnknown* pUnknown = *(IUnknown**) ppUnknown;
|
||||
if (pUnknown) {
|
||||
#ifdef __cplusplus
|
||||
pUnknown->Release();
|
||||
#else
|
||||
pUnknown->lpVtbl->Release(pUnknown);
|
||||
#endif
|
||||
*(IUnknown**) ppUnknown = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
#define FF_AUTO_RELEASE_COM_OBJECT FF_A_CLEANUP(ffReleaseComObject)
|
||||
|
||||
#else
|
||||
// Win32 COM headers requires C++ compiler
|
||||
#error Must be included in C++ source file
|
||||
#endif
|
||||
#define FF_AUTO_RELEASE_COM_OBJECT FF_A_CLEANUP(ffReleaseComObject)
|
||||
@@ -1,8 +1,8 @@
|
||||
extern "C" {
|
||||
#include "camera.h"
|
||||
#include "common/library.h"
|
||||
#include "common/windows/com.h"
|
||||
}
|
||||
#include "common/windows/com.hpp"
|
||||
#include "common/windows/unicode.hpp"
|
||||
#include "common/windows/util.hpp"
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ extern "C" {
|
||||
#include "media.h"
|
||||
#include "common/time.h"
|
||||
#include "common/windows/unicode.h"
|
||||
#include "common/windows/com.h"
|
||||
}
|
||||
|
||||
#if FF_HAVE_WINRT
|
||||
@@ -15,8 +16,6 @@ extern "C" {
|
||||
#include <winrt/Windows.Media.Control.h>
|
||||
#include <winrt/Windows.Storage.Streams.h>
|
||||
|
||||
#include "common/windows/com.hpp"
|
||||
|
||||
#define FF_BIND_FRONT(method, pobject) std::bind_front(&std::remove_cvref_t<decltype(*(pobject))>::method, (pobject))
|
||||
|
||||
using winrt::impl::abi_t;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
extern "C" {
|
||||
#include "sound.h"
|
||||
#include "common/windows/com.h"
|
||||
}
|
||||
#include "common/windows/unicode.hpp"
|
||||
#include "common/windows/com.hpp"
|
||||
#include "common/windows/variant.hpp"
|
||||
|
||||
#include <initguid.h>
|
||||
|
||||
Reference in New Issue
Block a user