From: Jacek Caban jacek@codeweavers.com
To keep it in sync with winnt.h. --- include/msvcrt/corecrt.h | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/include/msvcrt/corecrt.h b/include/msvcrt/corecrt.h index 945d8ac4055..b3d9aa0992c 100644 --- a/include/msvcrt/corecrt.h +++ b/include/msvcrt/corecrt.h @@ -86,6 +86,14 @@ #define __has_attribute(x) 0 #endif
+#ifndef __has_declspec_attribute +# if defined(_MSC_VER) +# define __has_declspec_attribute(x) 1 +# else +# define __has_declspec_attribute(x) 0 +# endif +#endif + #if !defined(_MSC_VER) && !defined(__MINGW32__) # undef __stdcall # ifdef __i386__ @@ -132,7 +140,7 @@ #endif
#ifndef DECLSPEC_NORETURN -# if defined(_MSC_VER) && (_MSC_VER >= 1200) && !defined(MIDL_PASS) +# if __has_declspec_attribute(noreturn) && !defined(MIDL_PASS) # define DECLSPEC_NORETURN __declspec(noreturn) # elif defined(__GNUC__) # define DECLSPEC_NORETURN __attribute__((noreturn)) @@ -142,7 +150,7 @@ #endif
#ifndef DECLSPEC_ALIGN -# if defined(_MSC_VER) && (_MSC_VER >= 1300) && !defined(MIDL_PASS) +# if __has_declspec_attribute(align) && !defined(MIDL_PASS) # define DECLSPEC_ALIGN(x) __declspec(align(x)) # elif defined(__GNUC__) # define DECLSPEC_ALIGN(x) __attribute__((aligned(x))) @@ -154,7 +162,7 @@ #ifndef _ACRTIMP # ifdef _CRTIMP # define _ACRTIMP _CRTIMP -# elif defined(_MSC_VER) +# elif __has_declspec_attribute(dllimport) # define _ACRTIMP __declspec(dllimport) # elif defined(__MINGW32__) || defined(__CYGWIN__) # define _ACRTIMP __attribute__((dllimport))