microsoft / wil

Windows Implementation Library
MIT License
2.57k stars 234 forks source link

LLVM MinGW compatibility improvements #454

Closed m417z closed 1 month ago

m417z commented 1 month ago

I tried to use WIL with LLVM MinGW. After the changes in this PR and with the compiler options and definitions below, I'm able to compile the main WIL functionality.

Related issue: https://github.com/microsoft/wil/issues/117.

Compiler options:

-fms-extensions

Definitions added before including WIL:

#define _Frees_ptr_
#define _Frees_ptr_opt_
#define _Post_z_
#define _Pre_maybenull_
#define _Pre_opt_valid_
#define _Pre_valid_
#define _Ret_opt_bytecap_(size)
#define _Translates_last_error_to_HRESULT_
#define _Translates_NTSTATUS_to_HRESULT_(status)
#define _Translates_Win32_to_HRESULT_(err)
#define InterlockedDecrementNoFence InterlockedDecrement
#define InterlockedIncrementNoFence InterlockedIncrement
#define WIL_NO_SLIM_EVENT
dunhor commented 1 month ago

CppWinRTAuthoringTests::NotifyPropertyChanged timed out which is a known issue