https://llvm.org/bugs/show_bug.cgi?id=23071
Bug ID: 23071
Summary: MS-compatibility: XAudio2.h fails to compile due to
spaces in GUID
Product: clang
Version: trunk
Hardware: PC
OS: All
Status: NEW
Severity: normal
Priority: P
Component: Frontend
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Classification: Unclassified
The following code (excerpted from Microsoft's DirectX header XAudio2.h) fails
to compile with Windows compatibility:
#define DECLSPEC_UUID_WRAPPER(x) __declspec(uuid(#x))
#define DEFINE_CLSID(className, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
class
DECLSPEC_UUID_WRAPPER(l##-##w1##-##w2##-##b1##b2##-##b3##b4##b5##b6##b7##b8)
className
DEFINE_CLSID(XAudio2, 5a508685, a254, 4fba, 9b, 82, 9a, 24, b0, 03, 06, af);
//DEFINE_CLSID(XAudio2,5a508685,a254,4fba,9b,82,9a,24,b0,03,06,af);
This results in:
% clang++ -fms-extensions -Wno-invalid-token-paste -c clang.cpp
clang.cpp:6:1: error: uuid attribute contains a malformed GUID
DEFINE_CLSID(XAudio2, 5a508685, a254, 4fba, 9b, 82, 9a, 24, b0, 03, 06, af);
^
clang.cpp:4:8: note: expanded from macro 'DEFINE_CLSID'
class
DECLSPEC_UUID_WRAPPER(l##-##w1##-##w2##-##b1##b2##-##b3##b4##b5##b6##b7##b8)
className
^
clang.cpp:1:50: note: expanded from macro 'DECLSPEC_UUID_WRAPPER'
#define DECLSPEC_UUID_WRAPPER(x) __declspec(uuid(#x))
^
<scratch space>:16:1: note: expanded from here
"5a508685- a254- 4fba- 9b82- 9a24b00306af"
^
1 error generated.
When using the commented DEFINE_CLSID-line without the spaces, the code
compiles successfully.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs