__declspec(align) with MSVC-built clang


I noticed clang (MSVC built: clang version 3.0 (trunk 143028) Target:
x86_64-pc-win32) seems to ignore __declspec(align(n)) when I was
trying to compile the winpthreads library from mingw-w64 project.

This causes APIs like setjmp(), GetThreadContext() to fail (there are
most likely more but these I have encountered and can confirm to work
after fixing).

I first tried some macro "massage" that replaced __declspec(align(n))
with __attribute__((aligned(n)) and things compiled and worked fine.
Such workaround is not elegant I think: it feels a bit dangerous to
#define align(x) aligned(x) #define __declspec(x) __attribute__((x))
globally? How would this affect other supported __declspecs
(dllimport, dllexport...)?

Since this didn't seem too complicated I wondered if I could make my
first clang "hack" :wink: It turned out there's not more to do than:

Index: lib/Sema/SemaDeclAttr.cpp