Skip to content

Commit 5e0b960

Browse files
committed
Fix vgm-audio failing to compile on Clang on Windows
On Windows, audio/CMakeLists.txt (AKA vgm-audio) adds libs/include_vc to the include path on MSVC, and libs/include_mingw on all other compilers. This works on MSVC and MinGW, but causes compilation errors on Clang on Windows (msvc-abi), which uses MSVC's headers. Since vgm-audio adds libs/include_mingw to Clang's include path, MSVC's headers include libs/include_mingw/sal.h instead of Microsoft's sal.h, and fail to compile (due to missing _In_ etc.). We cannot switch Clang to use include_vc, since Clang hits -Winvalid-token-paste errors when compiling libs/include_vc/XAudio2.h. Instead, fix this issue by keeping Clang on libs/include_mingw, but renaming include_mingw/sal.h to sal_stub.h.
1 parent bf6d32e commit 5e0b960

File tree

3 files changed

+2
-2
lines changed

3 files changed

+2
-2
lines changed

libs/include_mingw/XAudio2.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ DEFINE_IID(IXAudio2, 8bcf1f58, 9fe7, 4583, 8a, c6, e2, ad, c4, 65, c8, bb);
6262
#include <objbase.h> // Windows COM declarations
6363
#endif
6464

65-
#include <sal.h> // Markers for documenting API semantics
65+
#include "sal_stub.h" // Markers for documenting API semantics
6666
#include <audiodefs.h> // Basic audio data types and constants
6767
#include <xma2defs.h> // Data types and constants for XMA2 audio
6868

File renamed without changes.

libs/include_mingw/xma2defs.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#ifndef __XMA2DEFS_INCLUDED__
1111
#define __XMA2DEFS_INCLUDED__
1212

13-
#include <sal.h> // Markers for documenting API semantics
13+
#include "sal_stub.h" // Markers for documenting API semantics
1414
#include <winerror.h> // For S_OK, E_FAIL
1515
#include <audiodefs.h> // Basic data types and constants for audio work
1616

0 commit comments

Comments
 (0)