FNA-XNA / FAudio

FAudio - Accuracy-focused XAudio reimplementation for open platforms
https://fna-xna.github.io/
Other
534 stars 72 forks source link

build: fix building with MSVC #333

Closed rkitover closed 4 months ago

rkitover commented 4 months ago

Add an ALIGN(type, boundary) macro with an MSVC equivalent using declspec(align(x)) to the gcc/clang-specific attribute__((aligned(x))). Fallback to no alignment for other compilers.

Link system DLLs on Windows by name instead of as an -l linker flag, cmake automatically produces the correct linker invocation on both MINGW and MSVC.

Include with WIN32_LEAN_AND_MEAN defined instead of including and , because this breaks the Windows header architecture detection on MSVC.

Define the GUIDs for IID_IAudioClient, IID_IAudioRenderClient, IID_IMMDeviceEnumerator and CLSID_MMDeviceEnumerator for PLATFORM_WIN32 taken from the SDK headers, because MSVC cannot find the linkage for them.

flibitijibibo commented 4 months ago

All looks good except for the language version bump - does __declspec(align) work with newer VS versions? We should be able to stay on the old version if so.

rkitover commented 4 months ago

How's this, I added an ALIGN(type, boundary) macro.

rkitover commented 4 months ago

Can you rerun the CI please, I fixed the MINGW fail.